From c6c1876c29999f1da7e716f69232ed6acd579e76 Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Tue, 2 Apr 2024 19:33:54 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=8F=96=E6=B6=88=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E6=B5=8B=E8=AF=95=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/CI_local_test.yaml | 2 -- quasar.config.js | 2 +- rts-sim-testing-message | 2 +- src/configs/UrlManage.ts | 8 ++++---- src/env.d.ts | 1 - 5 files changed, 6 insertions(+), 9 deletions(-) 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/quasar.config.js b/quasar.config.js index 9537ddf..46d1c29 100644 --- a/quasar.config.js +++ b/quasar.config.js @@ -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; } } From f80dcbb2f7390a47533b5a92ab3ff5a2380a0762 Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Tue, 2 Apr 2024 19:37:32 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F?= =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + quasar.config.js | 2 +- yarn.lock | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) 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 46d1c29..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'; 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"