|
|
|
@ -10,6 +10,8 @@ import com.bnyer.common.core.context.SecurityContextHolder; |
|
|
|
import com.bnyer.common.core.utils.ServletUtils; |
|
|
|
import com.bnyer.common.core.utils.StringUtils; |
|
|
|
|
|
|
|
import java.util.Objects; |
|
|
|
|
|
|
|
/** |
|
|
|
* 权限获取工具类 |
|
|
|
* |
|
|
|
@ -52,9 +54,25 @@ public class SecurityUtils |
|
|
|
/** |
|
|
|
* 获取请求token |
|
|
|
*/ |
|
|
|
public static String getToken() |
|
|
|
public static String getToken(String authType) |
|
|
|
{ |
|
|
|
return getToken(ServletUtils.getRequest()); |
|
|
|
//PC
|
|
|
|
if(authType.equals(TokenConstants.AUTHENTICATION)){ |
|
|
|
return getToken(Objects.requireNonNull(ServletUtils.getRequest())); |
|
|
|
//抖音
|
|
|
|
}else if(authType.equals(TokenConstants.TIKTOK_APP_AUTH)){ |
|
|
|
return getTiktokToken(Objects.requireNonNull(ServletUtils.getRequest())); |
|
|
|
//快手
|
|
|
|
}else if(authType.equals(TokenConstants.FASTHAND_APP_AUTH)){ |
|
|
|
return getFhToken(Objects.requireNonNull(ServletUtils.getRequest())); |
|
|
|
//微信
|
|
|
|
}else if(authType.equals(TokenConstants.WECHAT_APP_AUTH)){ |
|
|
|
return getWechatToken(Objects.requireNonNull(ServletUtils.getRequest())); |
|
|
|
//艺术家端
|
|
|
|
}else{ |
|
|
|
return getCreatorToken(Objects.requireNonNull(ServletUtils.getRequest())); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
|