|
@@ -1,5 +1,7 @@
|
|
package org.jeecg.modules.system.controller;
|
|
package org.jeecg.modules.system.controller;
|
|
|
|
|
|
|
|
+import cn.com.ctop.common.module.entity.CtopCorpWexinUser;
|
|
|
|
+import cn.com.ctop.common.module.service.ICtopCorpWexinUserService;
|
|
import cn.com.ctop.common.module.utils.AesEncryptUtil;
|
|
import cn.com.ctop.common.module.utils.AesEncryptUtil;
|
|
import cn.com.ctop.common.module.utils.EncryptedString;
|
|
import cn.com.ctop.common.module.utils.EncryptedString;
|
|
import cn.hutool.core.util.RandomUtil;
|
|
import cn.hutool.core.util.RandomUtil;
|
|
@@ -62,6 +64,8 @@ public class LoginController {
|
|
private RedisUtil redisUtil;
|
|
private RedisUtil redisUtil;
|
|
@Autowired
|
|
@Autowired
|
|
private ISysDepartService sysDepartService;
|
|
private ISysDepartService sysDepartService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ICtopCorpWexinUserService ctopCorpWexinUserService;
|
|
|
|
|
|
@RequestMapping(value = "/wxlogin", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/wxlogin", method = RequestMethod.POST)
|
|
@ApiOperation("企业微信登录接口")
|
|
@ApiOperation("企业微信登录接口")
|
|
@@ -93,6 +97,17 @@ public class LoginController {
|
|
//用户登录信息
|
|
//用户登录信息
|
|
userInfo(sysUser, result);
|
|
userInfo(sysUser, result);
|
|
sysBaseApi.addLog("用户名: " + email + ",登录成功!", CommonConstant.LOG_TYPE_1, null);
|
|
sysBaseApi.addLog("用户名: " + email + ",登录成功!", CommonConstant.LOG_TYPE_1, null);
|
|
|
|
+ CtopCorpWexinUser ctopCorpWexinUser = ctopCorpWexinUserService.getById(sysUser.getId());
|
|
|
|
+ if(ctopCorpWexinUser == null){
|
|
|
|
+ ctopCorpWexinUser = new CtopCorpWexinUser();
|
|
|
|
+ ctopCorpWexinUser.setUserId(sysUser.getId());
|
|
|
|
+ ctopCorpWexinUser.setWexinEmail(user.getEmail());
|
|
|
|
+ ctopCorpWexinUser.setWexinGender(user.getGender().getGenderName());
|
|
|
|
+ ctopCorpWexinUser.setWexinName(user.getName());
|
|
|
|
+ ctopCorpWexinUser.setWexinId(user.getUserId());
|
|
|
|
+ ctopCorpWexinUser.setWexinMobile(user.getMobile());
|
|
|
|
+ ctopCorpWexinUserService.save(ctopCorpWexinUser);
|
|
|
|
+ }
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
} catch (WxErrorException e) {
|
|
} catch (WxErrorException e) {
|