修改跨域 提取url

This commit is contained in:
623756217 2023-01-11 16:35:47 +08:00
parent 2f0adad89e
commit 48d499aac4
9 changed files with 5 additions and 3 deletions

View File

@ -14,8 +14,10 @@ public class AdminInterceptor extends OncePerRequestFilter {
@Override
protected void doFilterInternal(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, FilterChain filterChain) throws ServletException, IOException {
httpServletResponse.setHeader("Access-Control-Allow-Origin", "https://testforgeplus.trustie.net");
String reqUrl = httpServletRequest.getRequestURL().toString();
int pos = reqUrl.indexOf("/", 9);
reqUrl = reqUrl.substring(0,pos);
httpServletResponse.setHeader("Access-Control-Allow-Origin", reqUrl);
httpServletResponse.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
httpServletResponse.setHeader("Access-Control-Max-Age", "3600");
httpServletResponse.setHeader("Access-Control-Allow-Headers", "Content-Type,XFILENAME,XFILECATEGORY,XFILESIZE,x-requested-with,Authorization,Cookie");

View File

@ -24,7 +24,7 @@ DROP TABLE IF EXISTS `bot`;
CREATE TABLE `bot` (
`id` int(255) NOT NULL AUTO_INCREMENT COMMENT '主键',
`bot_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'bot名称',
`bot_des` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'bot描述',
`bot_des` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'bot描述',
`webhook` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'bot回调url',
`is_public` tinyint(255) NULL DEFAULT NULL COMMENT '0:私有1公开',
`logo` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'logo',