添加现金充值操作密码

This commit is contained in:
韩鹏辉
2024-07-11 13:51:22 +08:00
parent 707f846af0
commit 6e7ee2137b
5 changed files with 39 additions and 3 deletions

View File

@@ -45,6 +45,8 @@ public class TbmerchantAccount implements Serializable {
private String headImg;
private String pwd;
private static final long serialVersionUID = 1L;
public Integer getId() {
@@ -214,4 +216,12 @@ public class TbmerchantAccount implements Serializable {
public void setHeadImg(String headImg) {
this.headImg = headImg == null ? null : headImg.trim();
}
public String getPwd() {
return pwd;
}
public void setPwd(String pwd) {
this.pwd = pwd;
}
}

View File

@@ -37,8 +37,6 @@ public class SignInterceptor implements HandlerInterceptor {
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
throws Exception {
String requestURI = request.getRequestURI();
if (HttpMethod.OPTIONS.toString().equals(request.getMethod())) {

View File

@@ -31,6 +31,7 @@ import java.math.RoundingMode;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@Service
public class MemberService {
@@ -73,6 +74,9 @@ public class MemberService {
@Value("${thirdPay.callBack}")
private String callBack;
@Autowired
TbmerchantAccountMapper tbmerchantAccountMapper;
public Result queryMember(String shopId, String phone, int page, int pageSize) {
PageHelperUtil.startPage(page, pageSize);
@@ -519,10 +523,29 @@ public class MemberService {
|| !map.containsKey("shopId") || ObjectUtil.isEmpty(map.get("shopId"))
|| !map.containsKey("memberId") || ObjectUtil.isEmpty(map.get("memberId"))
|| !map.containsKey("amount") || ObjectUtil.isEmpty(map.get("amount"))
||!map.containsKey("pwd")||ObjectUtil.isEmpty(map.get("pwd"))
) {
return Result.fail(CodeEnum.PARAM);
}
String accountId= TokenUtil.parseParamFromToken(token).getString("accountId");
TbmerchantAccount account= tbmerchantAccountMapper.selectByPrimaryKey(Integer.valueOf(accountId));
if(Objects.isNull(account)){
return Result.fail(CodeEnum.ACCOUNTEIXST);
}
if(Objects.isNull(account.getPwd())||ObjectUtil.isEmpty(account.getPwd())){
return Result.fail(CodeEnum.PWDNOSET);
}
if(!account.getPwd().equals(MD5Util.encrypt(map.get("pwd").toString().concat(account.getAccount()).concat(account.getId().toString())))){
return Result.fail(CodeEnum.PWDERROE);
}
String memberId = String.valueOf(map.get("memberId"));
String shopId = String.valueOf(map.get("shopId"));

View File

@@ -98,8 +98,11 @@ public enum CodeEnum {
CONSERROR("100036",false,"商品已售罄","fail"),
PWDNOSET("100037",false,"操作密码未设置","fail"),
PWDERROE("100038",false,"操作密码错误","fail"),

View File

@@ -22,6 +22,8 @@
<result column="msg_able" jdbcType="TINYINT" property="msgAble" />
<result column="created_at" jdbcType="BIGINT" property="createdAt" />
<result column="updated_at" jdbcType="BIGINT" property="updatedAt" />
<result column="pwd" jdbcType="VARCHAR" property="pwd" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.chaozhanggui.system.cashierservice.entity.TbmerchantAccount">
<result column="head_img" jdbcType="LONGVARCHAR" property="headImg" />
@@ -29,7 +31,7 @@
<sql id="Base_Column_List">
id, account, password, merchant_id, shop_id, shop_snap, is_admin, is_mercantile,
name, sex, email, telephone, status, sort, role_id, last_login_at, mp_open_id, msg_able,
created_at, updated_at
created_at, updated_at,pwd
</sql>
<sql id="Blob_Column_List">
head_img