From c8685a9213655d92a494d41bc6b9f99bec47b8ae Mon Sep 17 00:00:00 2001 From: tiger_zhou Date: Tue, 17 Oct 2023 10:30:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E5=8F=82=E6=95=B0=E5=8F=98?= =?UTF-8?q?=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.dev | 4 +++- .env.dev-show | 6 ++++-- .env.local | 4 +++- .env.prod | 6 ++++-- package.json | 2 +- src/configs/UrlManage.ts | 4 ++-- 6 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.env.dev b/.env.dev index 5320843..3030631 100644 --- a/.env.dev +++ b/.env.dev @@ -1,2 +1,4 @@ API=192.168.3.233:9081 -http=https +HTTP=http:// +NS= +WS=ws:// diff --git a/.env.dev-show b/.env.dev-show index 37d276a..32bfd43 100644 --- a/.env.dev-show +++ b/.env.dev-show @@ -1,2 +1,4 @@ -API=test.joylink.club:9081 -http=https +API=test.joylink.club +HTTP=https://test.joylink.club +NS=/ncc +WS=wss://test.joylink.club diff --git a/.env.local b/.env.local index c939416..95d9371 100644 --- a/.env.local +++ b/.env.local @@ -1,2 +1,4 @@ API=localhost:9081 -http=https +HTTP=http://localhost:9081 +NS= +WS=ws://localhost:9081 diff --git a/.env.prod b/.env.prod index c939416..4f23d89 100644 --- a/.env.prod +++ b/.env.prod @@ -1,2 +1,4 @@ -API=localhost:9081 -http=https +API=10.255.6.60:9081 +HTTP=http:// +NS= +WS=ws:// diff --git a/package.json b/package.json index 386b961..c03b263 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "lint": "eslint --ext .js,.ts,.vue ./", "format": "prettier --write \"**/*.{js,ts,vue,scss,html,md,json}\" --ignore-path .gitignore", "test": "echo \"No test specified\" && exit 0", - "dev": "set NODE_ENV=dev&&quasar dev", + "dev": "NODE_ENV=dev&&quasar dev", "local": "set NODE_ENV=local&&quasar dev", "build": "set NODE_ENV=prod&&quasar build", "dev-show": "set NODE_ENV=dev-show&&quasar build", diff --git a/src/configs/UrlManage.ts b/src/configs/UrlManage.ts index 90c8256..7407725 100644 --- a/src/configs/UrlManage.ts +++ b/src/configs/UrlManage.ts @@ -6,11 +6,11 @@ function getHost(): string { } export function getHttpBase() { - return `http://${getHost()}`; + return process.env.HTTP + `${getHost()}` + process.env.NS; } export function getWebsocketUrl() { - return `ws://${getHost()}/ws-default`; + return process.env.WS + `${getHost()}`+ process.env.NS+'/ws-default'; } export function getShowSetAlarmTextButton() {