diff --git a/front-end/app-product/vite.config.ts b/front-end/app-product/vite.config.ts index 1d0dce9..c856e1b 100644 --- a/front-end/app-product/vite.config.ts +++ b/front-end/app-product/vite.config.ts @@ -10,7 +10,7 @@ export default defineConfig(async ({ mode }) => { const env = loadEnv(mode, process.cwd()); return { - base: `/${ env.VITE_SERVER_NAME }/`, + base: `http://${ env.VITE_TRAEFIK_ADDRESS }/${ env.VITE_SERVER_NAME }/`, server: { port: Number(env.VITE_SERVER_PORT), host: '0.0.0.0', diff --git a/front-end/app-shared/package.json b/front-end/app-shared/package.json index a4647bf..4a8f7b1 100644 --- a/front-end/app-shared/package.json +++ b/front-end/app-shared/package.json @@ -17,8 +17,8 @@ "nacos-federation": "link:../nacos-federation" }, "devDependencies": { - "@vitejs/plugin-vue": "^6.0.1", "@originjs/vite-plugin-federation": "^1.4.1", + "@vitejs/plugin-vue": "^6.0.1", "typescript": "~5.8.3", "vite": "^7.1.6" } diff --git a/front-end/app-shared/src/infra/AxiosInfra.ts b/front-end/app-shared/src/infra/AxiosInfra.ts index fe47210..467e755 100644 --- a/front-end/app-shared/src/infra/AxiosInfra.ts +++ b/front-end/app-shared/src/infra/AxiosInfra.ts @@ -1,4 +1,10 @@ -import axios, { AxiosError, type AxiosInstance, type AxiosRequestConfig } from "axios"; +import axios, { + AxiosError, + type AxiosInstance, + type AxiosRequestConfig, + AxiosResponse, + InternalAxiosRequestConfig +} from "axios"; import { UrlCheckUtils } from '../utils/index' @@ -52,9 +58,9 @@ class AxiosInfra { * 响应拦截器 * @constructor */ - public async ResponseInterceptor(): Promise { + public async ResponseInterceptor(): Promise { this.instance.interceptors.response.use( - (response: any) => { + (response: AxiosResponse) => { return response.data.result; }, (error: AxiosError) => { @@ -79,8 +85,8 @@ class AxiosInfra { * 添加请求拦截器 * @constructor */ - public async RequestInterceptor(): Promise { - this.instance.interceptors.request.use((config: any) => { + public async RequestInterceptor(): Promise { + this.instance.interceptors.request.use((config: InternalAxiosRequestConfig) => { return config }, function (error: AxiosError) { return Promise.reject(error) diff --git a/front-end/app-shared/vite.config.ts b/front-end/app-shared/vite.config.ts index 21d8728..38e59b4 100644 --- a/front-end/app-shared/vite.config.ts +++ b/front-end/app-shared/vite.config.ts @@ -8,7 +8,7 @@ export default defineConfig(async ({ mode }): Promise => { const env = loadEnv(mode, process.cwd()); return { - base: `/${ env.VITE_SERVER_NAME }/`, + base: `http://${ env.VITE_TRAEFIK_ADDRESS }/${ env.VITE_SERVER_NAME }/`, server: { port: Number(env.VITE_SERVER_PORT), host: '0.0.0.0',