修改扫码登录bug

添加登录日志打印
master
Diyu0904 2025-03-08 20:36:24 +08:00
parent 29bedd38f4
commit 472a82d7cc
3 changed files with 13 additions and 1 deletions

View File

@ -119,6 +119,7 @@ public class WXController {
user = iSysUserThirdAccountService.selectUserByOpenId(openid);
}
LoginUser loginUser = new LoginUser(user.getUserId(), user.getDeptId(), user, permissionService.getMenuPermission(user));
log.info("生成token的数据user:{}",user);
// 生成token
String token = tokenService.createToken(loginUser);
ajax.put("token", token);

View File

@ -117,6 +117,13 @@ wechat:
# 应用密钥
secret: 11218568b79e2c5eb10459ef8c0374bd
#公众号配置
#wechat:
# # 应用ID
# appid: wx82d4c3c96f0ffa5b
# # 应用密钥
# secret: abbabcf1da711a3bbd95387ec83edcac
# yml版(application.yml)
aliyun:
oss:

View File

@ -1,11 +1,13 @@
package com.mcwl.system.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.mcwl.common.constant.CacheConstants;
import com.mcwl.common.core.domain.entity.SysUser;
import com.mcwl.system.domain.SysUserThirdAccount;
import com.mcwl.system.mapper.SysUserThirdAccountMapper;
import com.mcwl.system.service.ISysUserService;
import com.mcwl.system.service.ISysUserThirdAccountService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -17,6 +19,7 @@ import javax.annotation.Resource;
* @apiNote
*/
@Slf4j
@Service
public class SysUserThirdAccountServiceImpl implements ISysUserThirdAccountService {
@ -32,7 +35,7 @@ public class SysUserThirdAccountServiceImpl implements ISysUserThirdAccountServi
//根据openid查询第三方登录表数据
LambdaQueryWrapper<SysUserThirdAccount> sysUserThirdAccountLambdaQueryWrapper = new LambdaQueryWrapper<>();
sysUserThirdAccountLambdaQueryWrapper.eq(SysUserThirdAccount::getBindType,"WeChat");
sysUserThirdAccountLambdaQueryWrapper.eq(SysUserThirdAccount::getBindType, CacheConstants.WE_CHAT);
sysUserThirdAccountLambdaQueryWrapper.eq(SysUserThirdAccount::getOpenid,openid);
sysUserThirdAccountLambdaQueryWrapper.eq(SysUserThirdAccount::getDelFlag,0);
SysUserThirdAccount sysUserThirdAccount = sysUserThirdAccountMapper.selectOne(sysUserThirdAccountLambdaQueryWrapper);
@ -40,6 +43,7 @@ public class SysUserThirdAccountServiceImpl implements ISysUserThirdAccountServi
//未查询到返回空对象
if (sysUserThirdAccount == null){
log.info("获取到的数据:{}",sysUserThirdAccount);
return new SysUser();
}