|
|
@@ -2,7 +2,9 @@ package com.template.controller;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.auth0.jwt.interfaces.Claim;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import com.github.pagehelper.util.StringUtil;
|
|
|
@@ -929,4 +931,17 @@ public class WechatScanLoginController implements WechatScanLoginControllerAPI {
|
|
|
|
|
|
return CommonResult.ok("200", "获取成功", result.toString());
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @PassToken
|
|
|
+ public CommonResult checkToken(String token) {
|
|
|
+ Map<String, Claim> stringClaimMap = JWTUtil.verifyToken(token);
|
|
|
+
|
|
|
+ if (ObjectUtils.isNotEmpty(stringClaimMap)) { // 登录
|
|
|
+ return CommonResult.ok("校验通过");
|
|
|
+ }
|
|
|
+
|
|
|
+ return CommonResult.fail("校验失败");
|
|
|
+ }
|
|
|
+
|
|
|
}
|