优化请求未携带token时的日志打印
This commit is contained in:
@@ -7,12 +7,12 @@ import lombok.Getter;
|
|||||||
@Getter
|
@Getter
|
||||||
public enum CreditsEventsEnum {
|
public enum CreditsEventsEnum {
|
||||||
|
|
||||||
// PRICE("price","6"),
|
PRICE("price","6"),
|
||||||
PRICE("price","1"),// for test
|
// PRICE("price","1"),// for test
|
||||||
// PRICE("price","0.1"),
|
// PRICE("price","0.1"),
|
||||||
|
|
||||||
// BUY_CREDITS("Buy Credits","60"),
|
BUY_CREDITS("Buy Credits","60"),
|
||||||
BUY_CREDITS("Buy Credits","10"),// for test
|
// BUY_CREDITS("Buy Credits","10"),// for test
|
||||||
|
|
||||||
REFUND("Refund","60"),
|
REFUND("Refund","60"),
|
||||||
// BUY_CREDITS("Buy Credits","10"),
|
// BUY_CREDITS("Buy Credits","10"),
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import lombok.Getter;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public enum ProductEnum {
|
public enum ProductEnum {
|
||||||
// 积分购买
|
// 积分购买
|
||||||
CreditsProduct("AiDA credits purchase", 1L),
|
CreditsProduct("AiDA credits purchase", 6L),
|
||||||
// 年度订阅
|
// 年度订阅
|
||||||
AnnualSubscription("AiDA Annual Subscription", 5000L),
|
AnnualSubscription("AiDA Annual Subscription", 5000L),
|
||||||
// 月度订阅
|
// 月度订阅
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.ai.da.common.security.filter;
|
package com.ai.da.common.security.filter;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.ai.da.common.config.exception.MissingTokenException;
|
||||||
import com.ai.da.common.context.UserContext;
|
import com.ai.da.common.context.UserContext;
|
||||||
import com.ai.da.common.security.config.SecurityProperties;
|
import com.ai.da.common.security.config.SecurityProperties;
|
||||||
import com.ai.da.common.security.jwt.JWTTokenHelper;
|
import com.ai.da.common.security.jwt.JWTTokenHelper;
|
||||||
@@ -101,7 +102,8 @@ public class AuthenticationFilter extends OncePerRequestFilter {
|
|||||||
if (StrUtil.isBlank(jwtToken)) {
|
if (StrUtil.isBlank(jwtToken)) {
|
||||||
String ipAddress = RequestInfoUtil.getIpAddress(request);
|
String ipAddress = RequestInfoUtil.getIpAddress(request);
|
||||||
log.info("本次请求的ip为 : " + ipAddress);
|
log.info("本次请求的ip为 : " + ipAddress);
|
||||||
throw new RuntimeException("请传入token!");
|
// throw new RuntimeException("请传入token!");
|
||||||
|
throw new MissingTokenException("请传入token!");
|
||||||
}
|
}
|
||||||
if(jwtToken.equals("Bearer-eyJhbGciOiJIUzUxMiJ9.eyJqdGkiOiIyIiwic3ViIjoie1wiaWRcIjoyLFwidXNlcm5hbWVcIjpcImxpcnNcIn0iLCJpYXQiOjE2NjU3NDEwODcsImlzcyI6IkRXSiIsImF1dGhvcml0aWVzIjoiW10iLCJleHAiOjE2NzQzODEwODd9.ShM9R_NNFD7oo1OvxrEgg7PFeWinOuAKkuInUCMQupp66s64Hhv8tN0Wwr83nIN4rHPqtn95wmd4msWcvaFYJA")){
|
if(jwtToken.equals("Bearer-eyJhbGciOiJIUzUxMiJ9.eyJqdGkiOiIyIiwic3ViIjoie1wiaWRcIjoyLFwidXNlcm5hbWVcIjpcImxpcnNcIn0iLCJpYXQiOjE2NjU3NDEwODcsImlzcyI6IkRXSiIsImF1dGhvcml0aWVzIjoiW10iLCJleHAiOjE2NzQzODEwODd9.ShM9R_NNFD7oo1OvxrEgg7PFeWinOuAKkuInUCMQupp66s64Hhv8tN0Wwr83nIN4rHPqtn95wmd4msWcvaFYJA")){
|
||||||
//写死 暂时放行
|
//写死 暂时放行
|
||||||
|
|||||||
@@ -100,6 +100,7 @@
|
|||||||
<if test="payer != null and payer != ''">
|
<if test="payer != null and payer != ''">
|
||||||
AND a.user_name = #{payer}
|
AND a.user_name = #{payer}
|
||||||
</if>
|
</if>
|
||||||
|
AND p.transaction_id NOT LIKE 'cs_test%'
|
||||||
ORDER BY
|
ORDER BY
|
||||||
p.id ${order}
|
p.id ${order}
|
||||||
LIMIT ${limit} OFFSET ${offset}
|
LIMIT ${limit} OFFSET ${offset}
|
||||||
@@ -145,6 +146,7 @@
|
|||||||
<if test="payer != null and payer != ''">
|
<if test="payer != null and payer != ''">
|
||||||
AND a.user_name = #{payer}
|
AND a.user_name = #{payer}
|
||||||
</if>
|
</if>
|
||||||
|
AND p.transaction_id NOT LIKE 'cs_test%'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getCities" resultType="java.util.Map">
|
<select id="getCities" resultType="java.util.Map">
|
||||||
|
|||||||
Reference in New Issue
Block a user