Browse Source

1.7.5认证通上传视频优化

JiangChongBo 2 years ago
parent
commit
cc5d480790
1 changed files with 12 additions and 7 deletions
  1. 12 7
      src/main/java/com/caimei/service/auth/impl/AuthServiceImpl.java

+ 12 - 7
src/main/java/com/caimei/service/auth/impl/AuthServiceImpl.java

@@ -47,10 +47,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
 import org.springframework.util.Assert;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
@@ -824,9 +821,6 @@ public class AuthServiceImpl implements AuthService {
 //        }
              //验证token是否过期
 //              long dYaccessToken = redisService.getExpireTime("DYaccessToken");
-        redisService.remove("DYaccessToken");
-        redisService.remove("DyrefreshToken");
-        redisService.remove("DyopenId");
         return redisService.getExpireTime("DYaccessToken")<0 ? ResponseJson.success(false): ResponseJson.success(true);
 //        String clintKey = "awwwvh9tsnvo54w1";//应用唯一标识
 //        String responestype = "code";//写死为'code'即可
@@ -838,6 +832,17 @@ public class AuthServiceImpl implements AuthService {
 //        response.sendRedirect(code);
     }
 
+    /**
+     * 清除抖音授权token缓存
+     * @return
+     */
+    @GetMapping("/clean/douyin/redis")
+     public  ResponseJson cleanDYRedis(){
+         redisService.remove("DYaccessToken");
+         redisService.remove("DyrefreshToken");
+         redisService.remove("DyopenId");
+         return ResponseJson.success();
+     }
     /**
      * 根据用户的code值获取AcessToken
      * ccode 用户授权登录code