|
|
@@ -3,6 +3,7 @@ package com.fs.app.controller;
|
|
|
import cn.binarywang.wx.miniapp.api.WxMaService;
|
|
|
import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
|
|
|
import cn.hutool.core.date.DateTime;
|
|
|
+import com.fs.app.annotation.UserOperationLog;
|
|
|
import com.fs.app.param.FsUserLoginByCourseMpParam;
|
|
|
import com.fs.app.param.FsUserLoginByMpParam;
|
|
|
import com.fs.app.utils.JwtUtils;
|
|
|
@@ -18,6 +19,7 @@ import com.fs.course.mapper.FsCourseWatchLogMapper;
|
|
|
import com.fs.course.service.IFsUserCompanyUserService;
|
|
|
import com.fs.his.domain.FsUser;
|
|
|
import com.fs.his.domain.FsUserWx;
|
|
|
+import com.fs.his.enums.FsUserOperationEnum;
|
|
|
import com.fs.his.service.IFsUserService;
|
|
|
import com.fs.his.service.IFsUserWxService;
|
|
|
import com.fs.qw.mapper.QwExternalContactMapper;
|
|
|
@@ -77,6 +79,7 @@ public class WxH5MpController {
|
|
|
|
|
|
@ApiOperation("课程分享链接公众号登录")
|
|
|
@PostMapping("/loginByMp")
|
|
|
+ @UserOperationLog(operationType = FsUserOperationEnum.H5LOGIN)
|
|
|
public R loginByMp(@Valid @RequestBody FsUserLoginByMpParam param) {
|
|
|
log.info("=====================进入小程序授权登录, 入参: {}", param);
|
|
|
|
|
|
@@ -102,15 +105,18 @@ public class WxH5MpController {
|
|
|
WxOAuth2AccessToken wxMpOAuth2AccessToken = wxMpService.getOAuth2Service().getAccessToken(param.getCode());
|
|
|
WxOAuth2UserInfo wxMpUser = wxMpService.getOAuth2Service().getUserInfo(wxMpOAuth2AccessToken, null);
|
|
|
|
|
|
+ if (StringUtils.isEmpty(wxMpUser.getUnionId())){
|
|
|
+ return R.error("未绑定开放平台");
|
|
|
+ }
|
|
|
|
|
|
// 处理用户信息
|
|
|
FsUser user = processUserInfo(wxMpUser, company,companyUser,param);
|
|
|
|
|
|
- // 检查用户是否已绑定其他销售
|
|
|
- FsUserCompanyUser userCompanyUser = userCompanyUserService.selectByUserIdAndProjectId(user.getUserId(), param.getProjectId());
|
|
|
- if (Objects.nonNull(userCompanyUser) && !param.getCompanyUserId().equals(userCompanyUser.getCompanyUserId())){
|
|
|
- return R.error(500, "该用户("+user.getUserId() + ")已成为其他销售会员");
|
|
|
- }
|
|
|
+// // 检查用户是否已绑定其他销售
|
|
|
+// FsUserCompanyUser userCompanyUser = userCompanyUserService.selectByUserIdAndProjectId(user.getUserId(), param.getProjectId());
|
|
|
+// if (Objects.nonNull(userCompanyUser) && !param.getCompanyUserId().equals(userCompanyUser.getCompanyUserId())){
|
|
|
+// return R.error(500, "该用户("+user.getUserId() + ")已成为其他销售会员");
|
|
|
+// }
|
|
|
|
|
|
// // 处理用户与公司的关系
|
|
|
// processUserCompanyRelationship(user, param, companyUser, company);
|