Browse Source

fix: 1

master
zhangli 1 year 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({
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,
}) as unknown as MyRequestInstance

28
vite.config.ts

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

Loading…
Cancel
Save