Browse Source

修改属性

master_hella_20240701
liuchen864 5 months ago
parent
commit
a318a76b1f
  1. 4
      public/systemConfig.js
  2. 9
      src/utils/systemParam.ts
  3. 7
      src/views/login/components/LoginForm.vue
  4. 3
      src/views/login/components/MobileForm.vue

4
public/systemConfig.js

@ -8,5 +8,7 @@ let systemConfig = {
// 积木报表请求路径
jmreportBaseUrl: 'http://172.22.32.8:90',
// 查看质检报告环境
reportUrl: 'https://scp.faway-hella.com'
reportUrl: 'https://scp.faway-hella.com',
// 租户配置
tenant: '["成都"]'
}

9
src/utils/systemParam.ts

@ -3,6 +3,7 @@ const uploadUrl = ref(import.meta.env.VITE_UPLOAD_URL)
const interfaceUrl = ref(import.meta.env.VITE_INTERFACE_URL)
const jmreportBaseUrl = ref(import.meta.env.VITE_JMREPORT_BASE_URL)
const reportUrl = ref(import.meta.env.VITE_REPORT_URL)
const tenant = ref(import.meta.env.VITE_TENANT)
const mode = ref(import.meta.env.MODE)
// 获取baseUrl
export const getBaseUrl = () => {
@ -44,3 +45,11 @@ export const getReportUrl = () => {
return reportUrl.value
}
}
// 获取tenant
export const getTenant = () => {
if(mode.value === 'prod') {
return systemConfig.tenant
} else {
return tenant.value
}
}

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

@ -95,6 +95,7 @@
import router from "@/router";
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import * as DeptApi from '@/api/system/dept'
import { getTenant } from '@/utils/systemParam'
defineOptions({ name: 'LoginForm' })
@ -116,9 +117,9 @@
const getShow = computed(() => unref(getLoginState) === LoginStateEnum.LOGIN)
//
const captchaEnabled = ref(true);
const codeUrl = ref("");
const tenantArray = JSON.parse(import.meta.env.VITE_TENANT);
const captchaEnabled = ref(true)
const codeUrl = ref("")
const tenantArray = JSON.parse(getTenant())
const LoginRules = {
tenantName: [required],

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

@ -110,6 +110,7 @@ import { usePermissionStore } from '@/store/modules/permission'
import { getTenantIdByName, sendSmsCode, smsLogin } from '@/api/login'
import LoginFormTitle from './LoginFormTitle.vue'
import { LoginStateEnum, useFormValid, useLoginState } from './useLogin'
import { getTenant } from '@/utils/systemParam'
defineOptions({ name: 'MobileForm' })
@ -125,7 +126,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 tenantArray = JSON.parse(getTenant())
const rules = {
tenantName: [required],

Loading…
Cancel
Save