|
@@ -1,10 +1,7 @@
|
|
|
package com.ruoyi.framework.web.service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
-import javax.validation.constraints.Size;
|
|
|
|
|
|
-import com.alibaba.fastjson2.JSON;
|
|
|
-import com.ruoyi.common.core.domain.R;
|
|
|
import com.ruoyi.common.enums.UserStatus;
|
|
|
import com.ruoyi.common.exception.base.BaseException;
|
|
|
import com.ruoyi.framework.utils.WxCodeSessionUtil;
|
|
@@ -15,7 +12,6 @@ import org.springframework.security.authentication.AuthenticationManager;
|
|
|
import org.springframework.security.authentication.BadCredentialsException;
|
|
|
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
|
|
import org.springframework.security.core.Authentication;
|
|
|
-import org.springframework.security.core.userdetails.UserDetails;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import com.ruoyi.common.constant.CacheConstants;
|
|
|
import com.ruoyi.common.constant.Constants;
|
|
@@ -64,9 +60,6 @@ public class SysLoginService
|
|
|
@Autowired
|
|
|
private ISysConfigService configService;
|
|
|
|
|
|
- @Resource
|
|
|
- private WxCodeSessionUtil codeUtil;
|
|
|
-
|
|
|
@Autowired
|
|
|
private SysPasswordService passwordService;
|
|
|
|
|
@@ -128,7 +121,7 @@ public class SysLoginService
|
|
|
{
|
|
|
//用户唯一标识 OpenID 、 用户在微信开放平台帐号下的唯一标识UnionID
|
|
|
// (若当前小程序已绑定到微信开放平台帐号) 和 会话密钥 session_key
|
|
|
- AppletSessionDTO dto = codeUtil.jscode2Session(form);
|
|
|
+ AppletSessionDTO dto = WxCodeSessionUtil.jscode2Session(form);
|
|
|
String phoneNumber = dto.getPhoneNumber();
|
|
|
if (StringUtils.isBlank(phoneNumber)){
|
|
|
throw new BaseException("对不起,未获取到手机号");
|
|
@@ -150,7 +143,7 @@ public class SysLoginService
|
|
|
|
|
|
throw new ServiceException("对不起,您的账号:" + phonenumber + " 已停用");
|
|
|
}
|
|
|
- passwordService.validate(user);
|
|
|
+ //passwordService.validate(user);
|
|
|
LoginUser loginUser = createLoginUser(user);
|
|
|
recordLoginInfo(loginUser.getUserId());
|
|
|
return tokenService.createToken(loginUser);
|