From ae0fc9e3e4502eaa9e21b9152d6fd79953eaef5d Mon Sep 17 00:00:00 2001 From: zhangli <2235006734@qq.com> Date: Sat, 7 Oct 2023 16:36:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=BC=80=E5=8F=91=EF=BC=8C=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=EF=BC=8C=E7=94=9F=E4=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 15 --------------- .env.development | 35 ++++++----------------------------- .env.production | 35 ++++++----------------------------- .env.test | 35 ++++++----------------------------- src/api/axios.ts | 2 +- src/views/login/index.vue | 19 ++++++++++--------- 6 files changed, 29 insertions(+), 112 deletions(-) delete mode 100644 .env diff --git a/.env b/.env deleted file mode 100644 index 3af333c..0000000 --- a/.env +++ /dev/null @@ -1,15 +0,0 @@ -# port -VITE_DEV_PORT = '8080' - -# development path -# VITE_DEV_PATH = 'https://demo.mtruning.club' -VITE_DEV_PATH = 'http://127.0.0.1:12080' - -# production path -VITE_PRO_PATH = 'https://demo.mtruning.club' - -# 租户开关 -VITE_APP_TENANT_ENABLE=true - -# 验证码的开关 -# VITE_APP_CAPTCHA_ENABLE=true diff --git a/.env.development b/.env.development index 81a5ed3..ee9c255 100644 --- a/.env.development +++ b/.env.development @@ -1,31 +1,8 @@ -# 开发环境 -NODE_ENV=development +# port +VITE_DEV_PORT = '8080' -VITE_DEV=false +# production path +VITE_BASE_URL = 'http://127.0.0.1:12080' -# 请求路径 -VITE_BASE_URL='http://localhost:12080' - -# 上传路径 -VITE_UPLOAD_URL='http://localhost:12080/admin-api/infra/file/upload' - -# 接口前缀 -VITE_API_BASEPATH=/dev-api - -# 接口地址 -VITE_API_URL=/admin-api - -# 打包路径 -VITE_BASE_PATH=/ - -# 是否删除debugger -VITE_DROP_DEBUGGER=true - -# 是否删除console.log -VITE_DROP_CONSOLE=false - -# 是否sourcemap -VITE_SOURCEMAP=false - -# 输出路径 -VITE_OUT_DIR=dist +# 租户开关 +VITE_APP_TENANT_ENABLE=true diff --git a/.env.production b/.env.production index 9937520..454edb0 100644 --- a/.env.production +++ b/.env.production @@ -1,31 +1,8 @@ -# 生产环境 -NODE_ENV=production +# port +VITE_DEV_PORT = '8080' -VITE_DEV=false +# production path +VITE_BASE_URL = 'http://127.0.0.1:12080' -# 请求路径 -VITE_BASE_URL='http://localhost:12080' - -# 上传路径 -VITE_UPLOAD_URL='http://localhost:12080/admin-api/infra/file/upload' - -# 接口前缀 -VITE_API_BASEPATH= - -# 接口地址 -VITE_API_URL=/admin-api - -# 是否删除debugger -VITE_DROP_DEBUGGER=true - -# 是否删除console.log -VITE_DROP_CONSOLE=true - -# 是否sourcemap -VITE_SOURCEMAP=false - -# 打包路径 -VITE_BASE_PATH=/ - -# 输出路径 -VITE_OUT_DIR=dist-pro +# 租户开关 +VITE_APP_TENANT_ENABLE=true \ No newline at end of file diff --git a/.env.test b/.env.test index b993274..454edb0 100644 --- a/.env.test +++ b/.env.test @@ -1,31 +1,8 @@ -# 生产环境 -NODE_ENV=test +# port +VITE_DEV_PORT = '8080' -VITE_DEV=false +# production path +VITE_BASE_URL = 'http://127.0.0.1:12080' -# 请求路径 -VITE_BASE_URL='http://dev.ccwin-in.com:25100/api' - -# 上传路径 -VITE_UPLOAD_URL='http://dev.ccwin-in.com:25100/api/admin-api/infra/file/upload' - -# 接口前缀 -VITE_API_BASEPATH= - -# 接口地址 -VITE_API_URL=/admin-api - -# 是否删除debugger -VITE_DROP_DEBUGGER=true - -# 是否删除console.log -VITE_DROP_CONSOLE=true - -# 是否sourcemap -VITE_SOURCEMAP=false - -# 打包路径 -VITE_BASE_PATH=/ - -# 输出路径 -VITE_OUT_DIR=dist-test +# 租户开关 +VITE_APP_TENANT_ENABLE=true \ No newline at end of file diff --git a/src/api/axios.ts b/src/api/axios.ts index 58df750..c1ed40d 100644 --- a/src/api/axios.ts +++ b/src/api/axios.ts @@ -19,7 +19,7 @@ export interface MyRequestInstance extends Axios { } const axiosInstance = axios.create({ - baseURL: `${import.meta.env.PROD ? import.meta.env.VITE_PRO_PATH : import.meta.env.VITE_DEV_PATH }${axiosPre}`, + baseURL: `${import.meta.env.VITE_BASE_URL}${axiosPre}`, timeout: ResultEnum.TIMEOUT, }) as unknown as MyRequestInstance diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 8cd185b..4117dfa 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -67,14 +67,15 @@ - - -
- -
+ style="width: 76%;margin-right: 10px;height: 42px;" @keyup.enter="handleSubmit()"> + + +
+ +
@@ -141,7 +142,7 @@ const formInline = reactive({ username: 'admin', password: 'admin123', code: "", - uuid:'' + uuid: '' }) const rules = {