|
@@ -1,5 +1,6 @@
|
|
|
package com.fdkankan.manage.controller;
|
|
|
|
|
|
+import cn.dev33.satoken.stp.StpUtil;
|
|
|
import com.auth0.jwt.JWT;
|
|
|
import com.auth0.jwt.interfaces.DecodedJWT;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -21,9 +22,7 @@ public class BaseController {
|
|
|
}
|
|
|
|
|
|
protected Long getUserId(){
|
|
|
- String token = request.getHeader("token");
|
|
|
- DecodedJWT jwt = JWT.decode(token);
|
|
|
- return jwt.getClaim("userId").asLong();
|
|
|
+ return Long.valueOf(StpUtil.getLoginId().toString());
|
|
|
}
|
|
|
|
|
|
}
|