pwd
This commit is contained in:
parent
0a9a36b839
commit
1248591c91
|
|
@ -30,7 +30,6 @@ import com.bonus.config.SystemConfig;
|
|||
import com.bonus.system.api.RemoteConfigService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
|
@ -99,7 +98,7 @@ public class TokenController {
|
|||
{
|
||||
concurrency = Long.parseLong(result.get("msg").toString());
|
||||
}
|
||||
Collection<String> keys = redisService.keys(CustTokenService.CUST_LOGIN_TOKEN + "*");
|
||||
Collection<String> keys = redisService.keys(CustTokenService.LOGIN_TOKEN + "*");
|
||||
if (keys.size() >= concurrency){
|
||||
return R.fail("当前系统用户并发数超过系统配置,请稍后再试");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,9 +53,9 @@ public class CustTokenService {
|
|||
|
||||
public final static String IS_LOGIN = "isLogin";
|
||||
|
||||
public final static String CUST_LOGIN_TOKEN = "cust_login_tokens:";
|
||||
public final static String LOGIN_TOKEN = "login_tokens:";
|
||||
|
||||
private final static String CUST_LOGIN_USER_KEY = "cust_login_users:";
|
||||
private final static String LOGIN_USER_KEY = "login_users:";
|
||||
|
||||
private final static Long MILLIS_MINUTE_TEN = 120L * MILLIS_MINUTE;
|
||||
|
||||
|
|
@ -90,12 +90,12 @@ public class CustTokenService {
|
|||
rspMap.put(IS_LOGIN, isLogin(String.valueOf(custId)));
|
||||
long tokenTime = getTokenTime();
|
||||
//对token进行存储
|
||||
redisService.setCacheObject(CUST_LOGIN_USER_KEY + custId, token, tokenTime, TimeUnit.MINUTES);
|
||||
redisService.setCacheObject(LOGIN_USER_KEY + custId, token, tokenTime, TimeUnit.MINUTES);
|
||||
return rspMap;
|
||||
}
|
||||
|
||||
public boolean isLogin(String userId) {
|
||||
String existingTokenKey = redisService.getCacheObject(CUST_LOGIN_USER_KEY + userId);
|
||||
String existingTokenKey = redisService.getCacheObject(LOGIN_USER_KEY + userId);
|
||||
return existingTokenKey != null;
|
||||
}
|
||||
|
||||
|
|
@ -107,10 +107,10 @@ public class CustTokenService {
|
|||
* 删除已有的token
|
||||
*/
|
||||
public void delExistingToken(Long userId) {
|
||||
String existingTokenKey = redisService.getCacheObject(CUST_LOGIN_USER_KEY + userId);
|
||||
String existingTokenKey = redisService.getCacheObject(LOGIN_USER_KEY + userId);
|
||||
if (existingTokenKey != null) {
|
||||
redisService.deleteObject(getTokenKey(existingTokenKey));
|
||||
redisService.deleteObject(CUST_LOGIN_USER_KEY + userId);
|
||||
redisService.deleteObject(LOGIN_USER_KEY + userId);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -200,7 +200,7 @@ public class CustTokenService {
|
|||
}
|
||||
|
||||
private String getTokenKey(String token) {
|
||||
return CUST_LOGIN_TOKEN + token;
|
||||
return LOGIN_TOKEN + token;
|
||||
}
|
||||
|
||||
private Long getTokenTime(){
|
||||
|
|
|
|||
|
|
@ -33,8 +33,8 @@ public class CustInfoController extends BaseController {
|
|||
@ApiOperation("忘记密码")
|
||||
@PostMapping({"/forget/password"})
|
||||
public AjaxResult forgetPassword(@Validated @RequestBody CustForgetPasswordDTO content) {
|
||||
content.setMobile(AesEncryptUtil.aesDecode(content.getMobile()));
|
||||
content.setNewPassword(AesEncryptUtil.aesDecode(content.getNewPassword()));
|
||||
// content.setMobile(AesEncryptUtil.aesDecode(content.getMobile()));
|
||||
// content.setNewPassword(AesEncryptUtil.aesDecode(content.getNewPassword()));
|
||||
this.custInfoService.custForgetPassword(content);
|
||||
return success();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,8 +65,8 @@ public class CustInfoServiceImpl implements CustInfoService {
|
|||
}
|
||||
|
||||
public void custForgetPassword(CustForgetPasswordDTO content) {
|
||||
content.setMobile(AesEncryptUtil.aesDecode(content.getMobile()));
|
||||
content.setNewPassword(AesEncryptUtil.aesDecode(content.getNewPassword()));
|
||||
// content.setMobile(AesEncryptUtil.aesDecode(content.getMobile()));
|
||||
// content.setNewPassword(AesEncryptUtil.aesDecode(content.getNewPassword()));
|
||||
SmsCodeVerifyDTO smsCodeVerifyDTO = new SmsCodeVerifyDTO();
|
||||
smsCodeVerifyDTO.setTelephoneNumber(content.getMobile());
|
||||
smsCodeVerifyDTO.setCode(content.getCode());
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
select cust_id, cust_name, cust_num, cust_photo_url, mobile, pwd
|
||||
from cust_info
|
||||
<where>
|
||||
cust_status = 1
|
||||
cust_state = 1
|
||||
<if test="custId != null">
|
||||
and cust_id = #{custId}
|
||||
</if>
|
||||
|
|
|
|||
Reference in New Issue