Compare commits

..

2 Commits

Author SHA1 Message Date
3fbcdaaf56 fix build 2023-07-26 13:54:28 +02:00
527b70122d fix env 2023-07-26 13:52:08 +02:00
5 changed files with 48 additions and 29 deletions

View File

@@ -1,2 +1,2 @@
eveal_api_url=/api/
evepraisal_api_url=/appraisal/
EVEAL_API_URL=/api/
EVEPRAISAL_URL=/appraisal/

7
package-lock.json generated
View File

@@ -14,6 +14,7 @@
"vue": "^3.3.4"
},
"devDependencies": {
"@types/node": "^20.4.5",
"@vitejs/plugin-vue": "^4.2.3",
"autoprefixer": "^10.4.14",
"postcss": "^8.4.27",
@@ -486,6 +487,12 @@
"node": ">= 8"
}
},
"node_modules/@types/node": {
"version": "20.4.5",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.4.5.tgz",
"integrity": "sha512-rt40Nk13II9JwQBdeYqmbn2Q6IVTA5uPhvSO+JVqdXw/6/4glI6oR9ezty/A9Hg5u7JH4OmYmuQ+XvjKm0Datg==",
"dev": true
},
"node_modules/@types/web-bluetooth": {
"version": "0.0.17",
"resolved": "https://registry.npmjs.org/@types/web-bluetooth/-/web-bluetooth-0.0.17.tgz",

View File

@@ -15,6 +15,7 @@
"vue": "^3.3.4"
},
"devDependencies": {
"@types/node": "^20.4.5",
"@vitejs/plugin-vue": "^4.2.3",
"autoprefixer": "^10.4.14",
"postcss": "^8.4.27",

View File

@@ -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"

View File

@@ -1,32 +1,40 @@
import vue from '@vitejs/plugin-vue';
import * as path from "path";
import { defineConfig } from 'vite';
import { defineConfig, loadEnv } from 'vite';
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
'src': path.resolve(__dirname, './src/'),
'@': path.resolve(__dirname, './src/'),
},
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
},
server: {
port: 3000,
strictPort: true,
proxy: {
'/api/': {
target: 'https://api.eveal.shendai.rip/',
changeOrigin: true,
followRedirects: true,
rewrite: (path) => path.replace(/^\/api/, ''),
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '');
return {
plugins: [vue()],
resolve: {
alias: {
'src': path.resolve(__dirname, './src/'),
'@': path.resolve(__dirname, './src/'),
},
'/appraisal/': {
target: 'https://evepraisal.shendai.rip/',
changeOrigin: true,
followRedirects: true,
rewrite: (path) => path.replace(/^\/appraisal/, ''),
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,
proxy: {
'/api/': {
target: 'https://api.eveal.shendai.rip/',
changeOrigin: true,
followRedirects: true,
rewrite: (path) => path.replace(/^\/api/, ''),
},
'/appraisal/': {
target: 'https://evepraisal.shendai.rip/',
changeOrigin: true,
followRedirects: true,
rewrite: (path) => path.replace(/^\/appraisal/, ''),
}
}
}
},
};
})