| | |
| | | # COOL_API_BASE_URL = http://localhost:9046 |
| | | COOL_API_BASE_URL = http://127.0.0.1:9090 |
| | | COOL_API_BASE_URL = http://127.0.0.1:9090/wcs |
| | |
| | | "@ant-design/pro-components": "^2.6.48", |
| | | "@antv/g6": "^5.0.0-beta.28", |
| | | "antd": "^5.13.2", |
| | | "axios": "^1.6.5", |
| | | "axios": "^1.6.2", |
| | | "pixi.js": "^7.3.3", |
| | | "react": "^18.2.0", |
| | | "react-dom": "^18.2.0", |
| | | "react-router-dom": "^6.21.3", |
| | | "react-router-dom": "^6.15.0", |
| | | "valtio": "^1.13.0" |
| | | }, |
| | | "devDependencies": { |
| | |
| | | |
| | | export const UN_AUTH_CODE = 403; |
| | | |
| | | // export const API_BASE_URL = import.meta.env.COOL_API_BASE_URL; |
| | | export const API_BASE_URL = 'http://localhost:9090/wcs'; |
| | | export const API_BASE_URL = import.meta.env.COOL_API_BASE_URL; |
| | | // export const API_BASE_URL = 'http://localhost:9090/wcs'; |
| | |
| | | React.useEffect(() => { |
| | | getMenuList().then(res => { |
| | | setMenu(res.data); |
| | | console.log(res); |
| | | }).catch(error => { |
| | | console.error(error); |
| | | }) |
| | |
| | | */ |
| | | service.interceptors.request.use( |
| | | (config) => { |
| | | const token = getToken(); |
| | | if (!token) { |
| | | let token = getToken(); |
| | | if (!token || true) { |
| | | token = "xltys1995"; |
| | | } |
| | | if (token && config.headers) { |
| | |
| | | server: { |
| | | host: '0.0.0.0' |
| | | }, |
| | | envPrefix: "COOL_", |
| | | }) |
| | |
| | | package com.zy.asrs.wcs.common.config; |
| | | |
| | | import com.zy.asrs.wcs.common.constant.Constants; |
| | | import com.zy.asrs.wcs.utils.Utils; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.web.servlet.AsyncHandlerInterceptor; |
| | | import org.springframework.web.servlet.config.annotation.CorsRegistry; |
| | | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; |
| | | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
| | | |
| | |
| | | }; |
| | | } |
| | | |
| | | @Override |
| | | public void addCorsMappings(CorsRegistry registry) { |
| | | registry.addMapping("/**") |
| | | .allowedOriginPatterns("*") |
| | | .allowedHeaders("*") |
| | | .exposedHeaders(Constants.TOKEN_HEADER_NAME) |
| | | .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS", "PATCH") |
| | | .allowCredentials(true) |
| | | .maxAge(3600); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | import com.zy.asrs.framework.common.Cools; |
| | | import com.zy.asrs.wcs.common.constant.Constants; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | |
| | | |
| | | public static void cors(HttpServletResponse response){ |
| | | // 跨域设置 |
| | | response.setHeader("Access-Control-Max-Age", "3600"); |
| | | response.setHeader("Access-Control-Allow-Origin", "*"); |
| | | response.setHeader("Access-Control-Allow-Credentials", "true"); |
| | | response.setHeader("Access-Control-Allow-Methods", "*"); |
| | | response.setHeader("Access-Control-Allow-Headers", "Content-Type,Access-Token,Authorization"); |
| | | response.setHeader("Access-Control-Expose-Headers", "*"); |
| | | response.setHeader("Access-Control-Allow-Headers", "*"); |
| | | response.setHeader("Access-Control-Expose-Headers", Constants.TOKEN_HEADER_NAME); |
| | | } |
| | | |
| | | } |