Commit 0bf3c8de by renyizhao

去掉登录时的租户

parent 86268483
...@@ -16,17 +16,6 @@ ...@@ -16,17 +16,6 @@
<LoginFormTitle style="width: 100%" /> <LoginFormTitle style="width: 100%" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" style="padding-right: 10px; padding-left: 10px">
<el-form-item v-if="resetPasswordData.tenantEnable === 'true'" prop="tenantName">
<el-input
v-model="resetPasswordData.tenantName"
:placeholder="t('login.tenantNamePlaceholder')"
:prefix-icon="iconHouse"
type="primary"
link
/>
</el-form-item>
</el-col>
<!-- 手机号 --> <!-- 手机号 -->
<el-col :span="24" style="padding-right: 10px; padding-left: 10px"> <el-col :span="24" style="padding-right: 10px; padding-left: 10px">
<el-form-item prop="mobile"> <el-form-item prop="mobile">
...@@ -137,7 +126,6 @@ const message = useMessage() ...@@ -137,7 +126,6 @@ const message = useMessage()
const { currentRoute, push } = useRouter() const { currentRoute, push } = useRouter()
const formSmsResetPassword = ref() const formSmsResetPassword = ref()
const loginLoading = ref(false) const loginLoading = ref(false)
const iconHouse = useIcon({ icon: 'ep:house' })
const iconCellphone = useIcon({ icon: 'ep:cellphone' }) const iconCellphone = useIcon({ icon: 'ep:cellphone' })
const iconCircleCheck = useIcon({ icon: 'ep:circle-check' }) const iconCircleCheck = useIcon({ icon: 'ep:circle-check' })
const { validForm } = useFormValid(formSmsResetPassword) const { validForm } = useFormValid(formSmsResetPassword)
...@@ -156,7 +144,6 @@ const validatePass2 = (rule, value, callback) => { ...@@ -156,7 +144,6 @@ const validatePass2 = (rule, value, callback) => {
} }
const rules = { const rules = {
tenantName: [{ required: true, min: 2, max: 20, trigger: 'blur', message: '长度为4到16位' }],
mobile: [{ required: true, min: 11, max: 11, trigger: 'blur', message: '手机号长度为11位' }], mobile: [{ required: true, min: 11, max: 11, trigger: 'blur', message: '手机号长度为11位' }],
password: [ password: [
{ {
...@@ -175,7 +162,6 @@ const rules = { ...@@ -175,7 +162,6 @@ const rules = {
const resetPasswordData = reactive({ const resetPasswordData = reactive({
captchaEnable: import.meta.env.VITE_APP_CAPTCHA_ENABLE, captchaEnable: import.meta.env.VITE_APP_CAPTCHA_ENABLE,
tenantEnable: import.meta.env.VITE_APP_TENANT_ENABLE, tenantEnable: import.meta.env.VITE_APP_TENANT_ENABLE,
tenantName: '',
username: '', username: '',
password: '', password: '',
check_password: '', check_password: '',
...@@ -184,7 +170,7 @@ const resetPasswordData = reactive({ ...@@ -184,7 +170,7 @@ const resetPasswordData = reactive({
}) })
const smsVO = reactive({ const smsVO = reactive({
tenantName: '', tenantName: import.meta.env.VITE_APP_DEFAULT_LOGIN_TENANT || '',
mobile: '', mobile: '',
captchaVerification: '', captchaVerification: '',
scene: 23 scene: 23
...@@ -234,7 +220,8 @@ watch( ...@@ -234,7 +220,8 @@ watch(
const getTenantId = async () => { const getTenantId = async () => {
if (resetPasswordData.tenantEnable === 'true') { if (resetPasswordData.tenantEnable === 'true') {
const res = await LoginApi.getTenantIdByName(resetPasswordData.tenantName) const tenantName = import.meta.env.VITE_APP_DEFAULT_LOGIN_TENANT
const res = await LoginApi.getTenantIdByName(tenantName)
if (res == null) { if (res == null) {
message.error(t('login.invalidTenantName')) message.error(t('login.invalidTenantName'))
throw t('login.invalidTenantName') throw t('login.invalidTenantName')
......
...@@ -19,17 +19,6 @@ ...@@ -19,17 +19,6 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" style="padding-right: 10px; padding-left: 10px"> <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-form-item>
</el-col>
<el-col :span="24" style="padding-right: 10px; padding-left: 10px">
<el-form-item prop="username"> <el-form-item prop="username">
<el-input <el-input
v-model="loginData.loginForm.username" v-model="loginData.loginForm.username"
...@@ -113,7 +102,6 @@ defineOptions({ name: 'LoginForm' }) ...@@ -113,7 +102,6 @@ defineOptions({ name: 'LoginForm' })
const { t } = useI18n() const { t } = useI18n()
const message = useMessage() const message = useMessage()
const iconHouse = useIcon({ icon: 'ep:house' })
const iconAvatar = useIcon({ icon: 'ep:avatar' }) const iconAvatar = useIcon({ icon: 'ep:avatar' })
const iconLock = useIcon({ icon: 'ep:lock' }) const iconLock = useIcon({ icon: 'ep:lock' })
const formLogin = ref() const formLogin = ref()
...@@ -129,7 +117,6 @@ const appStore = useAppStore() ...@@ -129,7 +117,6 @@ const appStore = useAppStore()
const getShow = computed(() => unref(getLoginState) === LoginStateEnum.LOGIN) const getShow = computed(() => unref(getLoginState) === LoginStateEnum.LOGIN)
const LoginRules = { const LoginRules = {
tenantName: [required],
username: [required], username: [required],
password: [required] password: [required]
} }
...@@ -167,7 +154,8 @@ const getCode = async () => { ...@@ -167,7 +154,8 @@ const getCode = async () => {
// 获取租户 ID // 获取租户 ID
const getTenantId = async () => { const getTenantId = async () => {
if (loginData.tenantEnable === 'true') { if (loginData.tenantEnable === 'true') {
const res = await LoginApi.getTenantIdByName(loginData.loginForm.tenantName) const tenantName = import.meta.env.VITE_APP_DEFAULT_LOGIN_TENANT
const res = await LoginApi.getTenantIdByName(tenantName)
authUtil.setTenantId(res) authUtil.setTenantId(res)
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment