多租户前端修改提交

This commit is contained in:
yaoyn
2024-07-19 17:47:11 +08:00
parent d85c09bd83
commit 8034e9b090
23 changed files with 958 additions and 43 deletions

View File

@ -18,6 +18,20 @@
</InputPassword>
</FormItem>
<FormItem v-if="getAppEnvConfig().VITE_TENANT_ENABLED" name="tenantCode" class="enter-x">
<label class="form-title"> {{ t('租户码') }}</label>
<Input
size="large"
visibilityToggle
v-model:value="formData.tenantCode"
:placeholder="t('租户码')"
style="height: 58px"
>
<template #prefix>
<IconFontSymbol icon="zuzhiguanli" class="user-icon" />
</template>
</Input>
</FormItem>
<ARow class="enter-x">
<ACol :span="12">
<FormItem>
@ -59,6 +73,7 @@
import IconFontSymbol from '/@/components/IconFontSymbol/Index.vue';
import { useRouter } from 'vue-router';
import { getAppEnvConfig } from '/@/utils/env';
const ACol = Col;
const ARow = Row;
@ -81,7 +96,8 @@
const formData = reactive({
account: 'admin',
password: '123456'
password: 'YUdean@2024',
tenantCode: 'system'
});
onMounted(async () => {
@ -122,6 +138,7 @@
if (loginInfo) {
formData.account = Base64.decode(JSON.parse(loginInfo).account);
formData.password = Base64.decode(JSON.parse(loginInfo).password);
formData.tenantCode = Base64.decode(JSON.parse(loginInfo).tenantCode);
}
});
@ -139,6 +156,7 @@
const userInfo = await userStore.login({
password: data.password,
userName: data.account,
tenantCode: data.tenantCode,
deviceType: 0, //pc-0,app-1
mode: 'none' //不要默认的错误提示
});
@ -151,7 +169,8 @@
if (rememberMe.value) {
const info = {
account: Base64.encode(data.account),
password: Base64.encode(data.password)
password: Base64.encode(data.password),
tenantCode: Base64.encode(data.tenantCode)
};
window.localStorage.setItem('USER__LOGIN__INFO__', JSON.stringify(info));
} else {