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() {