Commit b1d390d8 by zhangxingmin

push

parent b8b49c0c
...@@ -67,6 +67,10 @@ public enum CommonEnum { ...@@ -67,6 +67,10 @@ public enum CommonEnum {
UID_TYPE_APPOINTMENT_USER_SIGN("appointment_user_sign","预约-签单员信息表"), UID_TYPE_APPOINTMENT_USER_SIGN("appointment_user_sign","预约-签单员信息表"),
UID_TYPE_APPOINTMENT_USER_SIGN_LOG("appointment_user_sign_log","预约-签单员信息日志表"), UID_TYPE_APPOINTMENT_USER_SIGN_LOG("appointment_user_sign_log","预约-签单员信息日志表"),
UID_TYPE_REL_OBJECT_MATERIAL("rel_object_material","对象材料关系表"), UID_TYPE_REL_OBJECT_MATERIAL("rel_object_material","对象材料关系表"),
UID_TYPE_USER_SIGN_EXPAND("user_sign_expand","系统用户-签单用户扩展表"),
UID_TYPE_USER_SALE_EXPAND("user_sale_expand","系统用户-销售用户扩展表"),
UID_TYPE_TAXATION("taxation","税务信息表"),
UID_TYPE_INSURANCE_COMPANY("insurance_company","保险公司表"),
//作用域枚举 //作用域枚举
SCOPE_SYS("1","系统级(全局)"), SCOPE_SYS("1","系统级(全局)"),
......
package com.yd.common.utils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
public class TokenUtils {
/**
* 获取当前请求的token
* @return
*/
public static String getCurrentToken() {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
if (attributes != null) {
HttpServletRequest request = attributes.getRequest();
// 从Header中获取token
String token = request.getHeader("Authorization");
if (token != null && token.startsWith("Bearer ")) {
return token;
}
// 从参数中获取token
token = request.getHeader("token");
if (token != null) {
return token;
}
}
return null;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment