mirror of
https://github.com/luoye663/e5.git
synced 2024-12-25 11:18:50 +00:00
~
This commit is contained in:
parent
b934572be4
commit
179877f31e
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
# Created by .ignore support plugin (hsz.mobi)
|
||||
/.idea/
|
||||
/target/
|
||||
/src/main/resources/application-online.properties.bak
|
||||
|
@ -48,7 +48,7 @@ public class LinkTokenAuthenticationFilter extends OncePerRequestFilter {
|
||||
}
|
||||
}
|
||||
log.info("--------------Token鉴权---------------");
|
||||
/*设置跨域*/
|
||||
/*设置跨域 最好在nginx处设置*/
|
||||
HttpServletResponse response = httpServletResponse;
|
||||
response.setHeader("Access-Control-Allow-Origin", "*");
|
||||
response.setHeader("Access-Control-Allow-Credentials", "true");
|
||||
@ -57,7 +57,6 @@ public class LinkTokenAuthenticationFilter extends OncePerRequestFilter {
|
||||
response.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, token");
|
||||
/*如果是OPTIONS则结束请求*/
|
||||
if (HttpMethod.OPTIONS.toString().equals(httpServletRequest.getMethod())) {
|
||||
log.debug("OPTIONS请求");
|
||||
response.setStatus(HttpStatus.NO_CONTENT.value());
|
||||
} else {
|
||||
filterChain.doFilter(httpServletRequest, response);
|
||||
|
@ -1,27 +1,17 @@
|
||||
package io.qyi.e5.controller.admin;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.google.gson.Gson;
|
||||
import io.qyi.e5.outlook.entity.Outlook;
|
||||
import io.qyi.e5.outlook.service.IOutlookService;
|
||||
import io.qyi.e5.service.task.ITask;
|
||||
import io.qyi.e5.util.redis.RedisUtil;
|
||||
import org.springframework.amqp.core.MessageProperties;
|
||||
import org.springframework.amqp.rabbit.connection.CorrelationData;
|
||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.annotation.Secured;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @program: e5
|
||||
* @program: 此类里大多都是测试
|
||||
* @description:
|
||||
* @author: 落叶随风
|
||||
* @create: 2020-03-16 01:01
|
||||
@ -41,17 +31,38 @@ public class AdminController {
|
||||
@Autowired
|
||||
RedisUtil redisUtil;
|
||||
|
||||
@Value("user.admin.githubId")
|
||||
int adminGithubId;
|
||||
|
||||
/**
|
||||
* 测试队列
|
||||
* @Author: 落叶随风
|
||||
* @Date: 2020/9/7 14:44
|
||||
* @Return: * @return: void
|
||||
*/
|
||||
@GetMapping("/send")
|
||||
public void send() {
|
||||
Task.sendTaskOutlookMQ(19658189);
|
||||
Task.sendTaskOutlookMQ(adminGithubId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 对所有队列重新添加
|
||||
* @Author: 落叶随风
|
||||
* @Date: 2020/9/7 14:43
|
||||
* @Return: * @return: java.lang.String
|
||||
*/
|
||||
@GetMapping("/sendAll")
|
||||
public String sendAll() {
|
||||
Task.sendTaskOutlookMQALL();
|
||||
return "ok";
|
||||
}
|
||||
|
||||
/**
|
||||
* 清空redis
|
||||
* @Author: 落叶随风
|
||||
* @Date: 2020/9/7 14:41
|
||||
* @Return: * @return: java.lang.String
|
||||
*/
|
||||
@GetMapping("/emptyRedis")
|
||||
public String emptyRedis() {
|
||||
redisUtil.deleteALL();
|
||||
@ -62,7 +73,4 @@ public class AdminController {
|
||||
public String test() {
|
||||
return "ok";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -238,7 +238,7 @@ public class OutlookServiceImpl extends ServiceImpl<OutlookMapper, Outlook> impl
|
||||
JSONObject jsonObject = JSON.parseObject(s);
|
||||
if (!jsonObject.containsKey("access_token")) {
|
||||
logger.info("返回的access_token字段不存在");
|
||||
throw new Exception("返回的access_token字段不存在,无法刷新令牌! 需要重新授权!");
|
||||
throw new Exception("返回的access_token字段不存在,无法刷新令牌! 需要重新授权!" );
|
||||
}
|
||||
outlook.setRefreshToken(jsonObject.getString("refresh_token"));
|
||||
outlook.setAccessToken(jsonObject.getString("access_token"));
|
||||
|
Loading…
Reference in New Issue
Block a user