|
@@ -4,6 +4,8 @@ import cn.jsms.api.ValidSMSResult;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.qs.mp.channel.domain.Channel;
|
|
|
+import com.qs.mp.channel.service.IChannelService;
|
|
|
import com.qs.mp.common.constant.Constants;
|
|
|
import com.qs.mp.common.core.domain.AjaxResult;
|
|
|
import com.qs.mp.common.enums.UserIdentityEnum;
|
|
@@ -64,6 +66,9 @@ public class UserController extends BaseApiController {
|
|
|
@Autowired
|
|
|
private IWxAccountService wxAccountService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IChannelService channelService;
|
|
|
+
|
|
|
@Value("${wx-channel.appId}")
|
|
|
private String channelAppId;
|
|
|
@Value("${wx-channel.appSecret}")
|
|
@@ -229,10 +234,16 @@ public class UserController extends BaseApiController {
|
|
|
@RequestMapping(value = "/user/getLoginUserinfo", method = RequestMethod.POST)
|
|
|
public AjaxResult getLoginUserinfo(@RequestBody JSONObject params) {
|
|
|
LoginUser loginUser = hostHolder.getUser();
|
|
|
+
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("userName", loginUser.getUsername());
|
|
|
jsonObject.put("avatar", loginUser.getUser().getAvatar());
|
|
|
- jsonObject.put("nickName", loginUser.getUser().getNickName());
|
|
|
+ if(loginUser.getIdentity() == UserIdentityEnum.CHANNEL) {
|
|
|
+ Channel channel = channelService.getById(loginUser.getChannelId());
|
|
|
+ jsonObject.put("nickName", channel.getName());
|
|
|
+ } else {
|
|
|
+ jsonObject.put("nickName", loginUser.getUser().getNickName());
|
|
|
+ }
|
|
|
jsonObject.put("openId", loginUser.getUser().getOpenId());
|
|
|
jsonObject.put("channelOpenId", loginUser.getUser().getChannelOpenId());
|
|
|
JSONArray roleKeys = new JSONArray();
|