Browse Source

fix: 开发,测试,生产

master
zhangli 1 year ago
parent
commit
ae0fc9e3e4
  1. 15
      .env
  2. 35
      .env.development
  3. 35
      .env.production
  4. 35
      .env.test
  5. 2
      src/api/axios.ts
  6. 7
      src/views/login/index.vue

15
.env

@ -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

35
.env.development

@ -1,31 +1,8 @@
# 开发环境 # port
NODE_ENV=development 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_APP_TENANT_ENABLE=true
# 上传路径
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

35
.env.production

@ -1,31 +1,8 @@
# 生产环境 # port
NODE_ENV=production 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_APP_TENANT_ENABLE=true
# 上传路径
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

35
.env.test

@ -1,31 +1,8 @@
# 生产环境 # port
NODE_ENV=test 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_APP_TENANT_ENABLE=true
# 上传路径
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

2
src/api/axios.ts

@ -19,7 +19,7 @@ export interface MyRequestInstance extends Axios {
} }
const axiosInstance = axios.create({ 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, timeout: ResultEnum.TIMEOUT,
}) as unknown as MyRequestInstance }) as unknown as MyRequestInstance

7
src/views/login/index.vue

@ -67,9 +67,10 @@
</n-form-item> </n-form-item>
<n-form-item path="password"> <n-form-item path="password">
<n-input v-model:value="formInline.code" placeholder="请输入验证码" <n-input v-model:value="formInline.code" placeholder="请输入验证码"
style="width: 76%;margin-right: 10px;height: 42px;"> style="width: 76%;margin-right: 10px;height: 42px;" @keyup.enter="handleSubmit()">
<template #prefix> <template #prefix>
<img src="../../assets/images/login/code.png" alt="" style="width: 18px;height: 18px;opacity: 0.38;"> <img src="../../assets/images/login/code.png" alt=""
style="width: 18px;height: 18px;opacity: 0.38;">
</template> </template>
</n-input> </n-input>
<div class="login-code flex-1"> <div class="login-code flex-1">
@ -141,7 +142,7 @@ const formInline = reactive({
username: 'admin', username: 'admin',
password: 'admin123', password: 'admin123',
code: "", code: "",
uuid:'' uuid: ''
}) })
const rules = { const rules = {

Loading…
Cancel
Save