|
@@ -1,5 +1,6 @@
|
|
|
package com.fdkankan.ucenter.common;
|
|
|
|
|
|
+import com.fdkankan.common.constant.ErrorCode;
|
|
|
import com.fdkankan.common.exception.BusinessException;
|
|
|
import com.fdkankan.common.util.DateEditor;
|
|
|
import com.fdkankan.common.util.JwtUtil;
|
|
@@ -93,7 +94,11 @@ public class BaseController {
|
|
|
}
|
|
|
|
|
|
protected String getToken(){
|
|
|
- return request.getHeader("token");
|
|
|
+ String token = request.getHeader("token");
|
|
|
+ if(StringUtils.isEmpty(token)){
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_3004);
|
|
|
+ }
|
|
|
+ return token;
|
|
|
}
|
|
|
protected Long getUserId(){
|
|
|
String token = request.getHeader("token");
|