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/ EVEAL_API_URL=/api/
evepraisal_api_url=/appraisal/ EVEPRAISAL_URL=/appraisal/

7
package-lock.json generated
View File

@@ -14,6 +14,7 @@
"vue": "^3.3.4" "vue": "^3.3.4"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^20.4.5",
"@vitejs/plugin-vue": "^4.2.3", "@vitejs/plugin-vue": "^4.2.3",
"autoprefixer": "^10.4.14", "autoprefixer": "^10.4.14",
"postcss": "^8.4.27", "postcss": "^8.4.27",
@@ -486,6 +487,12 @@
"node": ">= 8" "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": { "node_modules/@types/web-bluetooth": {
"version": "0.0.17", "version": "0.0.17",
"resolved": "https://registry.npmjs.org/@types/web-bluetooth/-/web-bluetooth-0.0.17.tgz", "resolved": "https://registry.npmjs.org/@types/web-bluetooth/-/web-bluetooth-0.0.17.tgz",

View File

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

View File

@@ -1,7 +1,10 @@
import axios from 'axios'; import axios from 'axios';
const evealApiUrl = process.env.EVEAL_API_URL;
const evepraisalUrl = process.env.EVEPRAISAL_URL;
export const apiAxiosInstance = axios.create({ export const apiAxiosInstance = axios.create({
baseURL: '/api/', baseURL: evealApiUrl,
headers: { headers: {
'accept': 'application/json', 'accept': 'application/json',
"Content-Type": "application/json" "Content-Type": "application/json"
@@ -9,7 +12,7 @@ export const apiAxiosInstance = axios.create({
}) })
export const evepraisalAxiosInstance = axios.create({ export const evepraisalAxiosInstance = axios.create({
baseURL: '/appraisal/', baseURL: evepraisalUrl,
headers: { headers: {
'accept': 'application/json', 'accept': 'application/json',
"Content-Type": "application/json" "Content-Type": "application/json"

View File

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