pwd
This commit is contained in:
parent
1248591c91
commit
85d88f01d0
|
|
@ -1,4 +1,4 @@
|
|||
package net.xnzn.constant;
|
||||
package com.bonus.constant;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package net.xnzn.constant;
|
||||
package com.bonus.constant;
|
||||
|
||||
public enum DelFlagEnum {
|
||||
DEL_TRUE(1, "删除"),
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package net.xnzn.constant;
|
||||
package com.bonus.constant;
|
||||
|
||||
/**
|
||||
* 全局常量
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package net.xnzn.constant;
|
||||
package com.bonus.constant;
|
||||
|
||||
public enum LeCodeUseSceneEnum {
|
||||
PAIRING(1, "配餐"),
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package net.xnzn.constant;
|
||||
package com.bonus.constant;
|
||||
|
||||
public interface LeConstants {
|
||||
String ID_TEMPORARY_PRE = "xnznkjxnznkj";
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package net.xnzn.constant;
|
||||
package com.bonus.constant;
|
||||
|
||||
public enum RetCodeEnum {
|
||||
SUCC(10000, "成功"),
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package net.xnzn.constant;
|
||||
package com.bonus.constant;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package net.xnzn.domain;
|
||||
package com.bonus.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package net.xnzn.domain;
|
||||
package com.bonus.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package net.xnzn.domain;
|
||||
package com.bonus.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package net.xnzn.domain;
|
||||
package com.bonus.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package net.xnzn.domain;
|
||||
package com.bonus.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package net.xnzn.domain;
|
||||
package com.bonus.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
//package com.bonus.service;
|
||||
//
|
||||
//import com.bonus.common.core.constant.CacheConstants;
|
||||
//import com.bonus.common.core.utils.StringUtils;
|
||||
//import com.bonus.common.core.utils.VerificationCodeUtils;
|
||||
//import com.bonus.common.redis.service.RedisService;
|
||||
//import com.bonus.common.security.config.VerificationCodeConfig;
|
||||
//import org.springframework.mail.SimpleMailMessage;
|
||||
//import org.springframework.mail.javamail.JavaMailSender;
|
||||
//import org.springframework.stereotype.Service;
|
||||
//
|
||||
//import javax.annotation.Resource;
|
||||
//import java.util.concurrent.TimeUnit;
|
||||
//
|
||||
//import static com.bonus.common.core.utils.VerificationCodeUtils.CodeType.NUMERIC;
|
||||
//
|
||||
///**
|
||||
// * @author bonus
|
||||
// */
|
||||
//@Service
|
||||
//public class EmailService {
|
||||
// @Resource
|
||||
// private VerificationCodeConfig verificationCodeConfig;
|
||||
// @Resource
|
||||
// private RedisService redisService;
|
||||
// @Resource
|
||||
// private JavaMailSender mailSender;
|
||||
//
|
||||
// /**
|
||||
// * 发送简单邮件
|
||||
// *
|
||||
// * @param to 接收者邮箱地址
|
||||
// */
|
||||
// public String sendSimpleEmail(String to) {
|
||||
// String code = VerificationCodeUtils.generateVerificationCode(NUMERIC);
|
||||
// String str = verificationCodeConfig.getContent().replace("<code>", code);
|
||||
// str = str.replace("<time>", verificationCodeConfig.getTime().toString());
|
||||
// SimpleMailMessage message = new SimpleMailMessage();
|
||||
// // 发件人邮箱地址
|
||||
// message.setFrom("2642480752@qq.com");
|
||||
// // 收件人邮箱地址
|
||||
// message.setTo(to);
|
||||
// // 邮件主题
|
||||
// message.setSubject(verificationCodeConfig.getTitle());
|
||||
// // 邮件内容
|
||||
// message.setText(str);
|
||||
// // 发送邮件
|
||||
// mailSender.send(message);
|
||||
// String uuid = StringUtils.randomUUID();
|
||||
// String verifyKey = CacheConstants.VERIFICATION_CODE + uuid;
|
||||
// redisService.setCacheObject(verifyKey, code, verificationCodeConfig.getTime(), TimeUnit.MINUTES);
|
||||
// return uuid;
|
||||
// }
|
||||
//}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
//package com.bonus.service;
|
||||
//
|
||||
//import com.bonus.common.core.constant.CacheConstants;
|
||||
//import com.bonus.common.core.exception.CaptchaException;
|
||||
//import com.bonus.common.core.utils.StringUtils;
|
||||
//import com.bonus.common.core.utils.VerificationCodeUtils;
|
||||
//import com.bonus.common.core.utils.sms.SmsUtils;
|
||||
//import com.bonus.common.redis.service.RedisService;
|
||||
//import com.bonus.common.security.config.VerificationCodeConfig;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//
|
||||
//import javax.annotation.Resource;
|
||||
//import java.util.concurrent.TimeUnit;
|
||||
//
|
||||
//import static com.bonus.common.core.utils.VerificationCodeUtils.CodeType.NUMERIC;
|
||||
//
|
||||
///**
|
||||
// * @author bonus
|
||||
// */
|
||||
//@Component
|
||||
//public class SmsService {
|
||||
// @Resource
|
||||
// private VerificationCodeConfig verificationCodeConfig;
|
||||
// @Resource
|
||||
// private RedisService redisService;
|
||||
//
|
||||
// /**
|
||||
// * 生成手机验证码
|
||||
// *
|
||||
// * @return AjaxResult
|
||||
// * @throws CaptchaException 自定义captcha 异常
|
||||
// */
|
||||
// public void sendSimplePhone(String to) {
|
||||
// if (StringUtils.isEmpty(to)) {
|
||||
// throw new CaptchaException("手机号不能为空");
|
||||
// }
|
||||
// String code = VerificationCodeUtils.generateVerificationCode(NUMERIC);
|
||||
// String str = verificationCodeConfig.getContent().replace("<code>", code);
|
||||
// str = str.replace("<time>", verificationCodeConfig.getTime().toString());
|
||||
// String s = SmsUtils.smsToken(to, str, "");
|
||||
// if (StringUtils.isNotEmpty(s)) {
|
||||
// if (s.contains("ok")) {
|
||||
// String verifyKey = CacheConstants.VERIFICATION_CODE + StringUtils.nvl(to, "");
|
||||
// redisService.setCacheObject(verifyKey, code, verificationCodeConfig.getTime(), TimeUnit.MINUTES);
|
||||
// } else {
|
||||
// throw new CaptchaException("获取短信失败");
|
||||
// }
|
||||
// } else {
|
||||
// throw new CaptchaException("获取短信失败");
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package net.xnzn.utils;
|
||||
package com.bonus.utils;
|
||||
|
||||
import cn.hutool.core.codec.Base64;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
|
@ -59,6 +59,8 @@ public class AesEncryptUtil {
|
|||
public static void main(String[] args) {
|
||||
System.out.println(aesEncrypt("Bonus$2026"));
|
||||
System.out.println(aesDecode("PCAGz8j5ByU2AzoT6vtlLA=="));
|
||||
System.out.println(aesEncrypt("Bonus$2027"));
|
||||
System.out.println(aesDecode("MF1Nui79h/OHRGoUx1jhcg=="));
|
||||
System.out.println(aesEncrypt("18110922397"));
|
||||
System.out.println(aesDecode("poEWO1yyC/EaUR9vmrrNSA=="));
|
||||
System.out.println(aesDecode("poEWO1yyC/EaUR9vmrrNSA=="));
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package net.xnzn.utils;
|
||||
package com.bonus.utils;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package net.xnzn.utils;
|
||||
package com.bonus.utils;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package net.xnzn.utils;
|
||||
package com.bonus.utils;
|
||||
|
||||
import cn.hutool.core.util.DesensitizedUtil;
|
||||
import cn.hutool.crypto.SecureUtil;
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
package net.xnzn.service;
|
||||
|
||||
import com.bonus.common.core.constant.CacheConstants;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.core.utils.VerificationCodeUtils;
|
||||
import com.bonus.common.redis.service.RedisService;
|
||||
import com.bonus.common.security.config.VerificationCodeConfig;
|
||||
import org.springframework.mail.SimpleMailMessage;
|
||||
import org.springframework.mail.javamail.JavaMailSender;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static com.bonus.common.core.utils.VerificationCodeUtils.CodeType.NUMERIC;
|
||||
|
||||
/**
|
||||
* @author bonus
|
||||
*/
|
||||
@Service
|
||||
public class EmailService {
|
||||
@Resource
|
||||
private VerificationCodeConfig verificationCodeConfig;
|
||||
@Resource
|
||||
private RedisService redisService;
|
||||
@Resource
|
||||
private JavaMailSender mailSender;
|
||||
|
||||
/**
|
||||
* 发送简单邮件
|
||||
*
|
||||
* @param to 接收者邮箱地址
|
||||
*/
|
||||
public String sendSimpleEmail(String to) {
|
||||
String code = VerificationCodeUtils.generateVerificationCode(NUMERIC);
|
||||
String str = verificationCodeConfig.getContent().replace("<code>", code);
|
||||
str = str.replace("<time>", verificationCodeConfig.getTime().toString());
|
||||
SimpleMailMessage message = new SimpleMailMessage();
|
||||
// 发件人邮箱地址
|
||||
message.setFrom("2642480752@qq.com");
|
||||
// 收件人邮箱地址
|
||||
message.setTo(to);
|
||||
// 邮件主题
|
||||
message.setSubject(verificationCodeConfig.getTitle());
|
||||
// 邮件内容
|
||||
message.setText(str);
|
||||
// 发送邮件
|
||||
mailSender.send(message);
|
||||
String uuid = StringUtils.randomUUID();
|
||||
String verifyKey = CacheConstants.VERIFICATION_CODE + uuid;
|
||||
redisService.setCacheObject(verifyKey, code, verificationCodeConfig.getTime(), TimeUnit.MINUTES);
|
||||
return uuid;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
package net.xnzn.service;
|
||||
|
||||
import com.bonus.common.core.constant.CacheConstants;
|
||||
import com.bonus.common.core.exception.CaptchaException;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.core.utils.VerificationCodeUtils;
|
||||
import com.bonus.common.core.utils.sms.SmsUtils;
|
||||
import com.bonus.common.redis.service.RedisService;
|
||||
import com.bonus.common.security.config.VerificationCodeConfig;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static com.bonus.common.core.utils.VerificationCodeUtils.CodeType.NUMERIC;
|
||||
|
||||
/**
|
||||
* @author bonus
|
||||
*/
|
||||
@Component
|
||||
public class SmsService {
|
||||
@Resource
|
||||
private VerificationCodeConfig verificationCodeConfig;
|
||||
@Resource
|
||||
private RedisService redisService;
|
||||
|
||||
/**
|
||||
* 生成手机验证码
|
||||
*
|
||||
* @return AjaxResult
|
||||
* @throws CaptchaException 自定义captcha 异常
|
||||
*/
|
||||
public void sendSimplePhone(String to) {
|
||||
if (StringUtils.isEmpty(to)) {
|
||||
throw new CaptchaException("手机号不能为空");
|
||||
}
|
||||
String code = VerificationCodeUtils.generateVerificationCode(NUMERIC);
|
||||
String str = verificationCodeConfig.getContent().replace("<code>", code);
|
||||
str = str.replace("<time>", verificationCodeConfig.getTime().toString());
|
||||
String s = SmsUtils.smsToken(to, str, "");
|
||||
if (StringUtils.isNotEmpty(s)) {
|
||||
if (s.contains("ok")) {
|
||||
String verifyKey = CacheConstants.VERIFICATION_CODE + StringUtils.nvl(to, "");
|
||||
redisService.setCacheObject(verifyKey, code, verificationCodeConfig.getTime(), TimeUnit.MINUTES);
|
||||
} else {
|
||||
throw new CaptchaException("获取短信失败");
|
||||
}
|
||||
} else {
|
||||
throw new CaptchaException("获取短信失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2,7 +2,7 @@ package com.bonus.auth.api;
|
|||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.bonus.common.redis.service.RedisService;
|
||||
import net.xnzn.domain.SmsCodeVerifyDTO;
|
||||
import com.bonus.domain.SmsCodeVerifyDTO;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
|
|||
|
|
@ -2,22 +2,22 @@ package com.bonus.auth.controller;
|
|||
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.bonus.auth.mapper.AuthCustInfoMapper;
|
||||
import com.bonus.common.core.constant.CacheConstants;
|
||||
import com.bonus.auth.api.SmsCodeApi;
|
||||
import net.xnzn.constant.CustLoginTypeEnum;
|
||||
import net.xnzn.constant.DelFlagEnum;
|
||||
import net.xnzn.constant.LeConstants;
|
||||
import net.xnzn.domain.CustCasual;
|
||||
import net.xnzn.domain.CustInfo;
|
||||
import net.xnzn.domain.CustInfoAppIdLoginVO;
|
||||
import com.bonus.constant.CustLoginTypeEnum;
|
||||
import com.bonus.constant.DelFlagEnum;
|
||||
import com.bonus.constant.LeConstants;
|
||||
import com.bonus.domain.CustCasual;
|
||||
import com.bonus.domain.CustInfo;
|
||||
import com.bonus.domain.CustInfoAppIdLoginVO;
|
||||
import com.bonus.auth.form.LoginBody;
|
||||
import com.bonus.auth.mapper.CustCasualMapper;
|
||||
import com.bonus.auth.mapper.CustInfoMapper;
|
||||
import com.bonus.auth.mapper.AuthCustCasualMapper;
|
||||
import com.bonus.auth.service.*;
|
||||
import net.xnzn.domain.SmsCodeVerifyDTO;
|
||||
import net.xnzn.utils.AesEncryptUtil;
|
||||
import net.xnzn.utils.Id;
|
||||
import net.xnzn.utils.SM4EncryptUtils;
|
||||
import com.bonus.domain.SmsCodeVerifyDTO;
|
||||
import com.bonus.utils.AesEncryptUtil;
|
||||
import com.bonus.utils.Id;
|
||||
import com.bonus.utils.SM4EncryptUtils;
|
||||
import com.bonus.common.core.domain.R;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.utils.JwtUtils;
|
||||
|
|
@ -68,10 +68,10 @@ public class TokenController {
|
|||
private SmsCodeApi smsCodeApi;
|
||||
|
||||
@Autowired
|
||||
private CustInfoMapper custInfoMapper;
|
||||
private AuthCustInfoMapper custInfoMapper;
|
||||
|
||||
@Autowired
|
||||
private CustCasualMapper custCasualMapper;
|
||||
private AuthCustCasualMapper authCustCasualMapper;
|
||||
|
||||
private static final BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();
|
||||
//private static final String CUST_LOGIN_TOKEN_KEY = "cust_login_tokens:";
|
||||
|
|
@ -162,7 +162,7 @@ public class TokenController {
|
|||
|
||||
public CustInfoAppIdLoginVO addOrUpdateCustCasual(Integer sourceType, CustInfoAppIdLoginVO result) {
|
||||
Long custId = result.getCustId();
|
||||
CustCasual custCasual = this.custCasualMapper.selectCustCasualByCustId(custId, sourceType, DelFlagEnum.DEL_FALSE.key());
|
||||
CustCasual custCasual = this.authCustCasualMapper.selectCustCasualByCustId(custId, sourceType, DelFlagEnum.DEL_FALSE.key());
|
||||
String openid;
|
||||
if (Objects.isNull(custCasual)) {
|
||||
CustCasual insertCasual = new CustCasual();
|
||||
|
|
@ -173,12 +173,12 @@ public class TokenController {
|
|||
insertCasual.setMobile(result.getMobile());
|
||||
insertCasual.setOpenid(openid);
|
||||
insertCasual.setSourceType(sourceType);
|
||||
this.custCasualMapper.addCustCasual(insertCasual);
|
||||
this.authCustCasualMapper.addCustCasual(insertCasual);
|
||||
} else {
|
||||
openid = custCasual.getOpenid();
|
||||
if (StringUtils.isBlank(openid)) {
|
||||
openid = IdUtil.simpleUUID();
|
||||
this.custCasualMapper.updateCustCasual(custCasual);
|
||||
this.authCustCasualMapper.updateCustCasual(custCasual);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -219,7 +219,7 @@ public class TokenController {
|
|||
tokenService.delExistingToken(Long.valueOf(userId));
|
||||
Long custId = Long.parseLong(headers.get("custId"));
|
||||
String openId = (String)headers.get("openid");
|
||||
custCasualMapper.updateByCustIdAndOpenId(custId, LeConstants.COMMON_NO, openId);
|
||||
authCustCasualMapper.updateByCustIdAndOpenId(custId, LeConstants.COMMON_NO, openId);
|
||||
sysLoginService.logout(username, userId);
|
||||
logService.saveLogout(username, "退出登录", "退出成功", userId, "成功");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
package com.bonus.auth.mapper;
|
||||
|
||||
import net.xnzn.domain.CustCasual;
|
||||
import net.xnzn.domain.CustCasualModel;
|
||||
import com.bonus.domain.CustCasual;
|
||||
import com.bonus.domain.CustCasualModel;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface CustCasualMapper {
|
||||
public interface AuthCustCasualMapper {
|
||||
List<CustCasualModel> queryPageCustCasual(@Param("custCasual") CustCasual custCasual);
|
||||
|
||||
String selectOpenidByCustId(@Param("custId") Long custId, @Param("sourceType") Integer sourceType, @Param("ifDel") Integer ifDel);
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
package com.bonus.auth.mapper;
|
||||
|
||||
import net.xnzn.domain.CustInfo;
|
||||
import net.xnzn.domain.CustInfoAppIdLoginVO;
|
||||
import com.bonus.domain.CustInfo;
|
||||
import com.bonus.domain.CustInfoAppIdLoginVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface CustInfoMapper {
|
||||
public interface AuthCustInfoMapper {
|
||||
CustInfoAppIdLoginVO selectLoginInfo(CustInfo custInfo);
|
||||
|
||||
}
|
||||
|
|
@ -10,7 +10,7 @@ import com.bonus.common.redis.service.RedisService;
|
|||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.config.SystemConfig;
|
||||
import com.bonus.system.api.RemoteUserService;
|
||||
import net.xnzn.domain.CustInfoAppIdLoginVO;
|
||||
import com.bonus.domain.CustInfoAppIdLoginVO;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.bonus.auth.mapper.CustCasualMapper">
|
||||
<mapper namespace="com.bonus.auth.mapper.AuthCustCasualMapper">
|
||||
|
||||
<resultMap id="custCasualMap" type="net.xnzn.domain.CustCasual">
|
||||
<resultMap id="custCasualMap" type="com.bonus.domain.CustCasual">
|
||||
<id property="id" column="id"/>
|
||||
<result property="casualId" column="casual_id"/>
|
||||
<result property="casualName" column="casual_name"/>
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
</resultMap>
|
||||
|
||||
<resultMap id="custCasualModel" extends="custCasualMap"
|
||||
type="net.xnzn.domain.CustCasualModel">
|
||||
type="com.bonus.domain.CustCasualModel">
|
||||
<result property="custNum" column="cust_num"/>
|
||||
<result property="custName" column="cust_name"/>
|
||||
<result property="age" column="age"/>
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
<!-- 分页查询临时人员,并关联查询相关人员信息 -->
|
||||
<select id="queryPageCustCasual" resultMap="custCasualModel"
|
||||
parameterType="net.xnzn.domain.CustCasual">
|
||||
parameterType="com.bonus.domain.CustCasual">
|
||||
select *
|
||||
from cust_casual t1
|
||||
left join cust_info t2 on t1.cust_id = t2.cust_id
|
||||
|
|
@ -59,7 +59,7 @@
|
|||
select openid from cust_casual where cust_id = #{custId} and source_type = #{sourceType} and if_del = #{ifDel}
|
||||
</select>
|
||||
|
||||
<select id="selectCustCasualByCustId" resultType="net.xnzn.domain.CustCasual">
|
||||
<select id="selectCustCasualByCustId" resultType="com.bonus.domain.CustCasual">
|
||||
select casual_id, openid from cust_casual where cust_id = #{custId} and source_type = #{sourceType} and if_del = #{ifDel}
|
||||
</select>
|
||||
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.bonus.auth.mapper.CustInfoMapper">
|
||||
<mapper namespace="com.bonus.auth.mapper.AuthCustInfoMapper">
|
||||
<!--根据人员id集合获取人员信息-->
|
||||
<select id="selectLoginInfo" resultType="net.xnzn.domain.CustInfoAppIdLoginVO">
|
||||
<select id="selectLoginInfo" resultType="com.bonus.domain.CustInfoAppIdLoginVO">
|
||||
select cust_id, cust_name, cust_num, cust_photo_url, mobile, pwd
|
||||
from cust_info
|
||||
<where>
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package net.xnzn.core;
|
||||
package com.bonus.core;
|
||||
|
||||
import com.bonus.common.security.annotation.EnableCustomConfig;
|
||||
import com.bonus.common.security.annotation.EnableRyFeignClients;
|
||||
|
|
@ -19,7 +19,6 @@ import org.springframework.scheduling.annotation.EnableScheduling;
|
|||
@EnableScheduling
|
||||
@EnableRyFeignClients
|
||||
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
|
||||
@MapperScan("net.xnzn.core")
|
||||
public class BonusSmartCanteenApplication
|
||||
{
|
||||
public static void main(String[] args)
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package net.xnzn.core.customer.api;
|
||||
package com.bonus.core.customer.api;
|
||||
|
||||
import net.xnzn.core.customer.service.CustCasualRelationService;
|
||||
import com.bonus.core.customer.service.CustCasualRelationService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package net.xnzn.core.customer.constants;
|
||||
package com.bonus.core.customer.constants;
|
||||
|
||||
public enum PersonalStatusEnum {
|
||||
NORMAL(1, "正常"),
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
package net.xnzn.core.customer.controller;
|
||||
package com.bonus.core.customer.controller;
|
||||
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.utils.AesEncryptUtil;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.xnzn.core.customer.dto.CustChangePasswordDTO;
|
||||
import net.xnzn.core.customer.dto.CustForgetPasswordDTO;
|
||||
import net.xnzn.core.customer.service.CustInfoService;
|
||||
import net.xnzn.utils.AesEncryptUtil;
|
||||
import com.bonus.core.customer.dto.CustChangePasswordDTO;
|
||||
import com.bonus.core.customer.dto.CustForgetPasswordDTO;
|
||||
import com.bonus.core.customer.service.CustInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
|
@ -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();
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package net.xnzn.core.customer.dto;
|
||||
package com.bonus.core.customer.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package net.xnzn.core.customer.dto;
|
||||
package com.bonus.core.customer.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package net.xnzn.core.customer.mapper;
|
||||
package com.bonus.core.customer.mapper;
|
||||
|
||||
import net.xnzn.core.customer.model.CustCasualRelation;
|
||||
import com.bonus.core.customer.model.CustCasualRelation;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
|
|
@ -1,8 +1,7 @@
|
|||
package net.xnzn.core.customer.mapper;
|
||||
package com.bonus.core.customer.mapper;
|
||||
|
||||
import net.xnzn.domain.CustInfo;
|
||||
import com.bonus.domain.CustInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface CustInfoMapper {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package net.xnzn.core.customer.model;
|
||||
package com.bonus.core.customer.model;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
|
@ -1,14 +1,12 @@
|
|||
package net.xnzn.core.customer.service;
|
||||
package com.bonus.core.customer.service;
|
||||
|
||||
import net.xnzn.constant.LeConstants;
|
||||
import net.xnzn.core.customer.mapper.CustCasualRelationMapper;
|
||||
import net.xnzn.core.customer.model.CustCasualRelation;
|
||||
import com.bonus.core.customer.mapper.CustCasualRelationMapper;
|
||||
import com.bonus.core.customer.model.CustCasualRelation;
|
||||
import com.bonus.constant.LeConstants;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Service
|
||||
public class CustCasualRelationService {
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package net.xnzn.core.customer.service;
|
||||
package com.bonus.core.customer.service;
|
||||
|
||||
import net.xnzn.core.customer.dto.CustChangePasswordDTO;
|
||||
import net.xnzn.core.customer.dto.CustForgetPasswordDTO;
|
||||
import com.bonus.core.customer.dto.CustChangePasswordDTO;
|
||||
import com.bonus.core.customer.dto.CustForgetPasswordDTO;
|
||||
|
||||
public interface CustInfoService {
|
||||
|
||||
|
|
@ -1,19 +1,19 @@
|
|||
package net.xnzn.core.customer.service.impl;
|
||||
package com.bonus.core.customer.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.bonus.common.core.constant.CacheConstants;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.redis.service.RedisService;
|
||||
import net.xnzn.constant.RetCodeEnum;
|
||||
import net.xnzn.core.customer.api.CustCasualApi;
|
||||
import net.xnzn.core.customer.dto.CustChangePasswordDTO;
|
||||
import net.xnzn.core.customer.dto.CustForgetPasswordDTO;
|
||||
import net.xnzn.core.customer.mapper.CustInfoMapper;
|
||||
import net.xnzn.core.customer.service.*;
|
||||
import net.xnzn.domain.SmsCodeVerifyDTO;
|
||||
import net.xnzn.domain.CustInfo;
|
||||
import net.xnzn.utils.AesEncryptUtil;
|
||||
import net.xnzn.utils.SM4EncryptUtils;
|
||||
import com.bonus.core.customer.dto.CustChangePasswordDTO;
|
||||
import com.bonus.core.customer.dto.CustForgetPasswordDTO;
|
||||
import com.bonus.core.customer.mapper.CustInfoMapper;
|
||||
import com.bonus.core.customer.service.CustInfoService;
|
||||
import com.bonus.constant.RetCodeEnum;
|
||||
import com.bonus.core.customer.api.CustCasualApi;
|
||||
import com.bonus.domain.SmsCodeVerifyDTO;
|
||||
import com.bonus.domain.CustInfo;
|
||||
import com.bonus.utils.AesEncryptUtil;
|
||||
import com.bonus.utils.SM4EncryptUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -44,6 +44,8 @@ public class CustInfoServiceImpl implements CustInfoService {
|
|||
log.error("小程序修改密码错误:人员不存在:" + String.valueOf(custInfo));
|
||||
throw new ServiceException("小程序修改密码错误:人员不存在");
|
||||
} else {
|
||||
content.setOldPassword(AesEncryptUtil.aesDecode(content.getOldPassword()));
|
||||
content.setNewPassword(AesEncryptUtil.aesDecode(content.getNewPassword()));
|
||||
String oldPassword = content.getOldPassword();
|
||||
String newPassword = content.getNewPassword();
|
||||
if (Objects.equals(oldPassword, newPassword)) {
|
||||
|
|
@ -64,9 +66,15 @@ public class CustInfoServiceImpl implements CustInfoService {
|
|||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
BCryptPasswordEncoder bCrypt = new BCryptPasswordEncoder();
|
||||
boolean flag = bCrypt.matches("Bonus$2026", "$2a$10$vrcmG0TyvgH5tS9g8ptaVOK2K3pYWVAa13SWEK7pQBGRtNAPlGV7O");
|
||||
System.out.println(flag);
|
||||
}
|
||||
|
||||
public void custForgetPassword(CustForgetPasswordDTO content) {
|
||||
// content.setMobile(AesEncryptUtil.aesDecode(content.getMobile()));
|
||||
// content.setNewPassword(AesEncryptUtil.aesDecode(content.getNewPassword()));
|
||||
content.setNewPassword(AesEncryptUtil.aesDecode(content.getNewPassword()));
|
||||
SmsCodeVerifyDTO smsCodeVerifyDTO = new SmsCodeVerifyDTO();
|
||||
smsCodeVerifyDTO.setTelephoneNumber(content.getMobile());
|
||||
smsCodeVerifyDTO.setCode(content.getCode());
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="net.xnzn.core.customer.mapper.CustCasualRelationMapper">
|
||||
<mapper namespace="com.bonus.core.customer.mapper.CustCasualRelationMapper">
|
||||
|
||||
<update id="updateByCustIdAndOpenId">
|
||||
update cust_casual_relation
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="net.xnzn.core.customer.mapper.CustInfoMapper">
|
||||
<mapper namespace="com.bonus.core.customer.mapper.CustInfoMapper">
|
||||
<!--根据人员id集合获取人员信息-->
|
||||
<select id="selectOne" resultType="net.xnzn.domain.CustInfo">
|
||||
<select id="selectOne" resultType="com.bonus.domain.CustInfo">
|
||||
select cust_id, cust_name, cust_num, cust_photo_url, mobile, pwd
|
||||
from cust_info
|
||||
<where>
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
<update id="updateById">
|
||||
update cust_info
|
||||
set cust_name = #{custName}, cust_num = #{custNum}, mobile = #{mobile}, id_card = #{idCard}
|
||||
set cust_name = #{custName}, cust_num = #{custNum}, mobile = #{mobile}, id_card = #{idCard}, pwd = #{pwd}
|
||||
where cust_id = #{custId}
|
||||
</update>
|
||||
|
||||
|
|
|
|||
Reference in New Issue