feat:1.优化commonResult 2. 重新初始化数据库结构

This commit is contained in:
2025-06-29 15:30:40 +08:00
parent 794a54c738
commit aa9a278108
10 changed files with 64 additions and 59 deletions
@@ -0,0 +1,17 @@
package com.guo.learningprogresstracker.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class WebCorsConfig implements WebMvcConfigurer {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**") // 配置所有路径
.allowedOrigins("http://localhost:5173")
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
.allowedHeaders("*")
.allowCredentials(true);
}
}
@@ -8,10 +8,6 @@ import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
/**
* @Author: ChangYu
* @Version 1.0
*/
/**
* 拦截器
@@ -23,10 +19,7 @@ public class Interceptor implements HandlerInterceptor {
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
/**
* token过期或失效时,由于前端基本都是AJAX请求,拦截器返回401,由前端负责跳转至OA登陆页面
* note:chang yu
*/
// StpUtil.checkLogin();
// //续签
// StpUtil.updateLastActiveToNow();