|
|
@@ -16,10 +16,10 @@ import java.io.IOException;
|
|
|
*/
|
|
|
@Component
|
|
|
public class TokenFilter implements Filter {
|
|
|
- private final String secretKey;
|
|
|
+ private final StoreLocalCache storeLocalCache;
|
|
|
|
|
|
public TokenFilter(StoreLocalCache storeLocalCache) {
|
|
|
- this.secretKey = storeLocalCache.getSecretKey();
|
|
|
+ this.storeLocalCache = storeLocalCache;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -32,7 +32,7 @@ public class TokenFilter implements Filter {
|
|
|
int userId = -1;
|
|
|
String token = ServletUtil.getBearerToken(request);
|
|
|
if (token != null) {
|
|
|
- OssPayload ossPayload = JwtUtil.getOssPayload(token, secretKey);
|
|
|
+ OssPayload ossPayload = JwtUtil.getOssPayload(token, storeLocalCache.getSecretKey());
|
|
|
userId = ossPayload.getUserId();
|
|
|
}
|
|
|
|