Browse Source

登录租户

master_hella_20240701
yufei0306 6 months ago
parent
commit
ca25af5a95
  1. 3
      .env.development
  2. 3
      .env.test
  3. 4
      .env.test-scp
  4. 7
      .env.wyf
  5. 15
      src/views/login/components/LoginForm.vue
  6. 13
      src/views/login/components/MobileForm.vue

3
.env.development

@ -35,3 +35,6 @@ VITE_INTERFACE_URL='http://localhost:12080/magic/web/index.html'
# 积木报表请求路径
VITE_JMREPORT_BASE_URL='http://localhost:12080'
# 租户配置
VITE_TENANT='["长春","成都"]'

3
.env.test

@ -35,3 +35,6 @@ VITE_INTERFACE_URL='http://dev.ccwin-in.com:25310/magic/web/index.html'
# 积木报表请求路径
VITE_JMREPORT_BASE_URL='http://dev.ccwin-in.com:25310'
# 租户配置
VITE_TENANT='["长春","成都"]'

4
.env.test-scp

@ -35,3 +35,7 @@ VITE_INTERFACE_URL='http://dev.ccwin-in.com:25311/magic/web/index.html'
# 积木报表请求路径
VITE_JMREPORT_BASE_URL='http://dev.ccwin-in.com:25311'
# 租户配置
VITE_TENANT='["长春","成都"]'

7
.env.wyf

@ -4,9 +4,9 @@ NODE_ENV=test
VITE_DEV=false
# 请求路径
VITE_BASE_URL='http://192.168.0.113:12080'
VITE_BASE_URL='http://192.168.0.108:12080'
# 上传路径
VITE_UPLOAD_URL='http://192.168.0.113:12080/admin-api/infra/file/upload'
VITE_UPLOAD_URL='http://192.168.0.108:12080/admin-api/infra/file/upload'
# # 请求路径
# VITE_BASE_URL='http://dev.ccwin-in.com:25300/api'
@ -46,3 +46,6 @@ VITE_JMREPORT_BASE_URL='http://192.168.0.108:12080'
# # 积木报表请求路径
# VITE_JMREPORT_BASE_URL='http://dev.ccwin-in.com:25310'
# 租户配置
VITE_TENANT='["长春","成都"]'

15
src/views/login/components/LoginForm.vue

@ -9,8 +9,16 @@
</el-col>
<el-col :span="24" style="padding-right: 10px; padding-left: 10px">
<el-form-item v-if="loginData.tenantEnable === 'true'" prop="tenantName">
<el-input v-model="loginData.loginForm.tenantName" :placeholder="t('login.tenantNamePlaceholder')"
:prefix-icon="iconHouse" link type="primary" />
<!-- <el-input v-model="loginData.loginForm.tenantName" :placeholder="t('login.tenantNamePlaceholder')"
:prefix-icon="iconHouse" link type="primary" /> -->
<el-select v-model="loginData.loginForm.tenantName" :placeholder="t('login.tenantNamePlaceholder')" :prefix-icon="iconHouse">
<el-option
v-for="item in tenantArray"
:key="item"
:label="item"
:value="item"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24" style="padding-right: 10px; padding-left: 10px">
@ -110,6 +118,7 @@
//
const captchaEnabled = ref(true);
const codeUrl = ref("");
const tenantArray = JSON.parse(import.meta.env.VITE_TENANT);
const LoginRules = {
tenantName: [required],
@ -121,7 +130,7 @@
captchaEnable: import.meta.env.VITE_APP_CAPTCHA_ENABLE,
tenantEnable: import.meta.env.VITE_APP_TENANT_ENABLE,
loginForm: {
tenantName: '闻荫源码',
tenantName: tenantArray[0],
username: 'admin',
password: '123456',
captchaVerification: '',

13
src/views/login/components/MobileForm.vue

@ -18,13 +18,21 @@
</el-col>
<el-col :span="24" style="padding-right: 10px; padding-left: 10px">
<el-form-item v-if="loginData.tenantEnable === 'true'" prop="tenantName">
<el-input
<!-- <el-input
v-model="loginData.loginForm.tenantName"
:placeholder="t('login.tenantNamePlaceholder')"
:prefix-icon="iconHouse"
type="primary"
link
/> -->
<el-select v-model="loginData.loginForm.tenantName" :placeholder="t('login.tenantNamePlaceholder')" :prefix-icon="iconHouse">
<el-option
v-for="item in tenantArray"
:key="item"
:label="item"
:value="item"
/>
</el-select>
</el-form-item>
</el-col>
<!-- 手机号 -->
@ -117,6 +125,7 @@ const iconCircleCheck = useIcon({ icon: 'ep:circle-check' })
const { validForm } = useFormValid(formSmsLogin)
const { handleBackLogin, getLoginState } = useLoginState()
const getShow = computed(() => unref(getLoginState) === LoginStateEnum.MOBILE)
const tenantArray = JSON.parse(import.meta.env.VITE_TENANT);
const rules = {
tenantName: [required],
@ -132,7 +141,7 @@ const loginData = reactive({
},
loginForm: {
uuid: '',
tenantName: '闻荫源码',
tenantName: tenantArray[0],
mobileNumber: '',
code: ''
}

Loading…
Cancel
Save