|
@@ -9,11 +9,14 @@ import com.qs.mp.channel.service.IChannelService;
|
|
|
import com.qs.mp.common.core.domain.AjaxResult;
|
|
|
import com.qs.mp.common.core.domain.AjaxResult.Type;
|
|
|
import com.qs.mp.common.enums.ChannelRoleEnum;
|
|
|
+import com.qs.mp.common.enums.UserIdentityEnum;
|
|
|
import com.qs.mp.common.jsms.JSMSUtils;
|
|
|
import com.qs.mp.framework.service.IWxUrlLinkService;
|
|
|
+import com.qs.mp.framework.web.service.SysLoginService;
|
|
|
import com.qs.mp.utils.SecurityUtils;
|
|
|
import com.qs.mp.web.controller.common.BaseApiController;
|
|
|
import io.swagger.annotations.Api;
|
|
|
+import java.util.Map;
|
|
|
import ma.glasnost.orika.MapperFacade;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -47,6 +50,9 @@ public class ChannelInviteController extends BaseApiController {
|
|
|
@Value("${wx-channel.appId}")
|
|
|
private String channelAppId;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private SysLoginService sysLoginService;
|
|
|
+
|
|
|
/**
|
|
|
* 生成邀请码
|
|
|
*
|
|
@@ -99,6 +105,12 @@ public class ChannelInviteController extends BaseApiController {
|
|
|
channel.setMobile(param.getMobile());
|
|
|
channel.setName(param.getMobile());
|
|
|
channelService.saveChannel(channel, ChannelRoleEnum.SALESITE);
|
|
|
- return AjaxResult.success();
|
|
|
+ // 直接登录
|
|
|
+ Map<String, String> result = sysLoginService.wxAuthLogin(param.getMobile(), UserIdentityEnum.CHANNEL.ordinal());
|
|
|
+ AjaxResult ajax = AjaxResult.success();
|
|
|
+ for (String key : result.keySet()) {
|
|
|
+ ajax.put(key, result.get(key));
|
|
|
+ }
|
|
|
+ return ajax;
|
|
|
}
|
|
|
}
|