From 3e210fac9492b90e21ca9bf76c1d9a8fda1f4388 Mon Sep 17 00:00:00 2001
From: rk <94314517@qq.com>
Date: 星期三, 13 五月 2026 11:32:17 +0800
Subject: [PATCH] 代码生成
---
server/services/src/main/java/com/doumee/config/jwt/WebMvcConfig.java | 24 +++++++++++++-----------
1 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/server/services/src/main/java/com/doumee/config/jwt/WebMvcConfig.java b/server/services/src/main/java/com/doumee/config/jwt/WebMvcConfig.java
index 289102e..1e96639 100644
--- a/server/services/src/main/java/com/doumee/config/jwt/WebMvcConfig.java
+++ b/server/services/src/main/java/com/doumee/config/jwt/WebMvcConfig.java
@@ -7,6 +7,7 @@
import com.doumee.core.constants.Constants;
import com.doumee.core.constants.ResponseStatus;
import com.doumee.core.exception.BusinessException;
+import com.doumee.dao.business.model.DriverInfo;
import com.doumee.dao.business.model.Member;
import com.doumee.dao.business.model.ShopInfo;
import io.jsonwebtoken.JwtException;
@@ -162,20 +163,16 @@
throw new BusinessException(ResponseStatus.SHOP_BE_OVERDUE);
}
String openid = shop.getOpenid();
- Integer shopId = getTokenId(token);
- Integer isDeleted = dao.queryForObject(" select COALESCE(DELETED,0) from shop_info where id = ?", Integer.class, shopId);
+ Integer shopId = shop.getId();//getTokenId(token);
+ Integer isDeleted = dao.queryForObject(" select COALESCE(DELETED,0) from shop_info where VERSION_TYPE = 0 and id = ?", Integer.class, shopId);
if(isDeleted== Constants.ONE){
throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鍟嗘埛宸插垹闄�,璇疯仈绯荤鐞嗗憳");
}
- Integer isForbidden = dao.queryForObject(" select COALESCE(STATUS,0) from shop_info where id = ?", Integer.class, shopId);
+ Integer isForbidden = dao.queryForObject(" select COALESCE(STATUS,0) from shop_info where VERSION_TYPE = 0 and id = ?", Integer.class, shopId);
if(isForbidden == Constants.ONE){
throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鍟嗘埛宸茬鐢�,璇疯仈绯荤鐞嗗憳");
}
- String dbOpenid = dao.queryForObject(" select ifnull(openid,'') from shop_info where id = ?", String.class, shopId);
- if(StringUtils.isBlank(dbOpenid)||!openid.equals(dbOpenid)){
- throw new BusinessException(ResponseStatus.SHOP_TOKEN_EXCEED_TIME);
- }
- Integer count = dao.queryForObject("select count(1) from shop_info where id = ?", Integer.class, shopId);
+ Integer count = dao.queryForObject("select count(1) from shop_info where VERSION_TYPE = 0 and id = ?", Integer.class, shopId);
if (count != null && count > 0) {
request.setAttribute(JwtTokenUtil.SHOP_ID, shop.getId());
return true;
@@ -198,9 +195,14 @@
if(StringUtils.isBlank(tokenRedis)){
throw new BusinessException(ResponseStatus.BE_OVERDUE);
}
- Integer memberId = getTokenId(token);
+ Integer driverId = getTokenId(token);
+ //鏌ヨ鍙告満淇℃伅
+ Integer memberId = dao.queryForObject(" select COALESCE(member_id,0) from driver_info where VERSION_TYPE = 0 and id = ?", Integer.class, driverId);
+ if(Objects.isNull(memberId)||Constants.equalsInteger(memberId,Constants.ZERO)){
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鍙告満淇℃伅淇℃伅鍑洪敊");
+ }
Integer isDeleted = dao.queryForObject(" select COALESCE(DELETED,1) from member where user_type = 1 and id = ?", Integer.class, memberId);
- if(isDeleted== Constants.ONE){
+ if(isDeleted == Constants.ONE){
throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鍙告満淇℃伅宸插垹闄�,璇疯仈绯荤鐞嗗憳");
}
Integer isForbidden = dao.queryForObject(" select COALESCE(STATUS,0) from member where user_type = 1 and id = ?", Integer.class, memberId);
@@ -209,7 +211,7 @@
}
Integer count = dao.queryForObject("select count(1) from member where user_type = 1 and id = ?", Integer.class, memberId);
if (count != null && count > 0) {
- request.setAttribute(JwtTokenUtil.DRIVER_ID, memberId);
+ request.setAttribute(JwtTokenUtil.DRIVER_ID, driverId);
return true;
}else{
throw new BusinessException(ResponseStatus.BE_OVERDUE.getCode(),"鍙告満淇℃伅鍑洪敊");
--
Gitblit v1.9.3