Merge branch 'dev/dev_xp' into dev/dev
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package com.ai.da.common.config.exception;
|
||||
|
||||
import com.ai.da.common.response.ResultEnum;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
@Data
|
||||
public class MissingTokenException extends RuntimeException {
|
||||
|
||||
public MissingTokenException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Throwable fillInStackTrace() {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -7,12 +7,12 @@ import lombok.Getter;
|
||||
@Getter
|
||||
public enum CreditsEventsEnum {
|
||||
|
||||
// PRICE("price","6"),
|
||||
PRICE("price","1"),// for test
|
||||
PRICE("price","6"),
|
||||
// PRICE("price","1"),// for test
|
||||
// PRICE("price","0.1"),
|
||||
|
||||
// BUY_CREDITS("Buy Credits","60"),
|
||||
BUY_CREDITS("Buy Credits","10"),// for test
|
||||
BUY_CREDITS("Buy Credits","60"),
|
||||
// BUY_CREDITS("Buy Credits","10"),// for test
|
||||
|
||||
REFUND("Refund","60"),
|
||||
// BUY_CREDITS("Buy Credits","10"),
|
||||
|
||||
@@ -7,7 +7,7 @@ import lombok.Getter;
|
||||
@AllArgsConstructor
|
||||
public enum ProductEnum {
|
||||
// 积分购买
|
||||
CreditsProduct("AiDA credits purchase", 1L),
|
||||
CreditsProduct("AiDA credits purchase", 6L),
|
||||
// 年度订阅
|
||||
AnnualSubscription("AiDA Annual Subscription", 5000L),
|
||||
// 月度订阅
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.ai.da.common.security.filter;
|
||||
|
||||
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.security.config.SecurityProperties;
|
||||
import com.ai.da.common.security.jwt.JWTTokenHelper;
|
||||
@@ -101,7 +102,8 @@ public class AuthenticationFilter extends OncePerRequestFilter {
|
||||
if (StrUtil.isBlank(jwtToken)) {
|
||||
String ipAddress = RequestInfoUtil.getIpAddress(request);
|
||||
log.info("本次请求的ip为 : " + ipAddress);
|
||||
throw new RuntimeException("请传入token!");
|
||||
// throw new RuntimeException("请传入token!");
|
||||
throw new MissingTokenException("请传入token!");
|
||||
}
|
||||
if(jwtToken.equals("Bearer-eyJhbGciOiJIUzUxMiJ9.eyJqdGkiOiIyIiwic3ViIjoie1wiaWRcIjoyLFwidXNlcm5hbWVcIjpcImxpcnNcIn0iLCJpYXQiOjE2NjU3NDEwODcsImlzcyI6IkRXSiIsImF1dGhvcml0aWVzIjoiW10iLCJleHAiOjE2NzQzODEwODd9.ShM9R_NNFD7oo1OvxrEgg7PFeWinOuAKkuInUCMQupp66s64Hhv8tN0Wwr83nIN4rHPqtn95wmd4msWcvaFYJA")){
|
||||
//写死 暂时放行
|
||||
|
||||
Reference in New Issue
Block a user