Browse Source

fix: 1

master
zhangli 12 months ago
parent
commit
3a0c2911b0
  1. 2
      src/api/axios.ts
  2. 28
      vite.config.ts

2
src/api/axios.ts

@ -19,7 +19,7 @@ export interface MyRequestInstance extends Axios {
} }
const axiosInstance = axios.create({ const axiosInstance = axios.create({
baseURL: `${import.meta.env.PROD ? import.meta.env.VITE_PRO_PATH : ''}${axiosPre}`, baseURL: `${import.meta.env.PROD ? import.meta.env.VITE_PRO_PATH : import.meta.env.VITE_DEV_PATH }${axiosPre}`,
timeout: ResultEnum.TIMEOUT, timeout: ResultEnum.TIMEOUT,
}) as unknown as MyRequestInstance }) as unknown as MyRequestInstance

28
vite.config.ts

@ -41,20 +41,20 @@ export default ({ mode }) => defineConfig({
} }
}, },
// 开发服务器配置 // 开发服务器配置
server: { // server: {
host: true, // host: true,
open: true, // open: true,
port: 3000, // port: 3000,
proxy: { // proxy: {
[axiosPre]: { // [axiosPre]: {
// @ts-ignore // // @ts-ignore
target: loadEnv(mode, process.cwd()).VITE_DEV_PATH, // target: loadEnv(mode, process.cwd()).VITE_DEV_PATH,
changeOrigin: true, // changeOrigin: true,
ws: true, // ws: true,
secure: true, // secure: true,
} // }
} // }
}, // },
plugins: [ plugins: [
vue(), vue(),
monacoEditorPlugin({ monacoEditorPlugin({

Loading…
Cancel
Save