diff --git a/.gitea/workflows/CI_local_test.yaml b/.gitea/workflows/CI_local_test.yaml index 34e01cd..28bbe3c 100644 --- a/.gitea/workflows/CI_local_test.yaml +++ b/.gitea/workflows/CI_local_test.yaml @@ -19,8 +19,6 @@ jobs: version: 'v18.19.1' cache: 'yarn' cache-dependency-path: 'yarn.lock' - env: URL_ENV: 'local' - environment: URL_ENV: 'test' - name: 安装yarn,并run build run: | node -v diff --git a/package.json b/package.json index 602f4ba..853223b 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "@typescript-eslint/eslint-plugin": "^5.10.0", "@typescript-eslint/parser": "^5.10.0", "autoprefixer": "^10.4.2", + "dotenv": "^16.4.5", "eslint": "^8.10.0", "eslint-config-prettier": "^8.1.0", "eslint-plugin-vue": "^9.0.0", diff --git a/quasar.config.js b/quasar.config.js index 9537ddf..805c43e 100644 --- a/quasar.config.js +++ b/quasar.config.js @@ -7,7 +7,7 @@ // Configuration for your app // https://v2.quasar.dev/quasar-cli-vite/quasar-config-js - +require('dotenv').config() const { configure } = require('quasar/wrappers'); const BasePath = 'bjrtss'; @@ -54,7 +54,7 @@ module.exports = configure(function (/* ctx */) { build: { env: { // test:测试服务器;publish:正式服务器;其他本地 - ENV_MODE: process.env.URL_ENV, + ENV_MODE: process.env.NODE_ENV, }, target: { browser: ['es2020'], diff --git a/rts-sim-testing-message b/rts-sim-testing-message index 8117a06..78f0ddf 160000 --- a/rts-sim-testing-message +++ b/rts-sim-testing-message @@ -1 +1 @@ -Subproject commit 8117a06f1ebccc1e239e56cfc0a3137f499c8515 +Subproject commit 78f0ddfd2413bdac81d33ea2b199edaa4de9e6fb diff --git a/src/configs/UrlManage.ts b/src/configs/UrlManage.ts index 6a9a6d1..0334a30 100644 --- a/src/configs/UrlManage.ts +++ b/src/configs/UrlManage.ts @@ -1,16 +1,16 @@ function getHost(): string { console.log(process.env.ENV_MODE, process.env.URL_ENV, '000'); - if (process.env.URL_ENV == 'test') { + if (process.env.ENV_MODE == 'test') { return 'test.joylink.club/bjrtsts-server'; - } else if (process.env.URL_ENV == 'publish') { + } else if (process.env.ENV_MODE == 'publish') { return 'joylink.club/bjrtsts-server'; - } else if (process.env.URL_ENV == 'local_test') { + } else if (process.env.ENV_MODE == 'local_test') { return '192.168.33.233:9091'; } // return '192.168.3.7:9091'; // return '192.168.3.47:9091'; // return '192.168.3.37:9091'; - return '192.168.33.207:9091'; // 张骞 + // return '192.168.33.207:9091'; // 张骞 // return '192.168.33.93:9091'; // return '192.168.3.37:9091'; //卫志宏 // return 'test.joylink.club/bjrtsts-service'; // 测试 diff --git a/src/env.d.ts b/src/env.d.ts index 8aa91be..dd757b1 100644 --- a/src/env.d.ts +++ b/src/env.d.ts @@ -5,6 +5,5 @@ declare namespace NodeJS { NODE_ENV: string; VUE_ROUTER_MODE: 'hash' | 'history' | 'abstract' | undefined; VUE_ROUTER_BASE: string | undefined; - URL_ENV: string; } } diff --git a/yarn.lock b/yarn.lock index 5bab075..729435e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1387,6 +1387,11 @@ dot-prop@6.0.1: dependencies: is-obj "^2.0.0" +dotenv@^16.4.5: + version "16.4.5" + resolved "https://registry.npmmirror.com/dotenv/-/dotenv-16.4.5.tgz#cdd3b3b604cb327e286b4762e13502f717cb099f" + integrity sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg== + earcut@^2.2.4: version "2.2.4" resolved "https://registry.npmmirror.com/earcut/-/earcut-2.2.4.tgz#6d02fd4d68160c114825d06890a92ecaae60343a"