fix env
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
eveal_api_url=/api/
|
||||
evepraisal_api_url=/appraisal/
|
||||
EVEAL_API_URL=/api/
|
||||
EVEPRAISAL_URL=/appraisal/
|
||||
@@ -1,7 +1,10 @@
|
||||
import axios from 'axios';
|
||||
|
||||
const evealApiUrl = process.env.EVEAL_API_URL;
|
||||
const evepraisalUrl = process.env.EVEPRAISAL_URL;
|
||||
|
||||
export const apiAxiosInstance = axios.create({
|
||||
baseURL: '/api/',
|
||||
baseURL: evealApiUrl,
|
||||
headers: {
|
||||
'accept': 'application/json',
|
||||
"Content-Type": "application/json"
|
||||
@@ -9,7 +12,7 @@ export const apiAxiosInstance = axios.create({
|
||||
})
|
||||
|
||||
export const evepraisalAxiosInstance = axios.create({
|
||||
baseURL: '/appraisal/',
|
||||
baseURL: evepraisalUrl,
|
||||
headers: {
|
||||
'accept': 'application/json',
|
||||
"Content-Type": "application/json"
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
import vue from '@vitejs/plugin-vue';
|
||||
import * as path from "path";
|
||||
import { defineConfig } from 'vite';
|
||||
import { defineConfig, loadEnv } from 'vite';
|
||||
|
||||
export default defineConfig({
|
||||
export default defineConfig(({ mode }) => {
|
||||
const env = loadEnv(mode, process.cwd(), '');
|
||||
|
||||
return {
|
||||
plugins: [vue()],
|
||||
resolve: {
|
||||
alias: {
|
||||
@@ -11,6 +14,10 @@ export default defineConfig({
|
||||
},
|
||||
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
|
||||
},
|
||||
define: {
|
||||
'process.env.EVEAL_API_URL': JSON.stringify(env.EVEAL_API_URL),
|
||||
'process.env.EVEPRAISAL_URL': JSON.stringify(env.EVEPRAISAL_URL),
|
||||
},
|
||||
server: {
|
||||
port: 3000,
|
||||
strictPort: true,
|
||||
@@ -28,5 +35,6 @@ export default defineConfig({
|
||||
rewrite: (path) => path.replace(/^\/appraisal/, ''),
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user