|
@@ -160,12 +160,12 @@
|
|
|
const LOGIN_NAME = PageEnum.BASE_LOGIN_NAME;
|
|
const LOGIN_NAME = PageEnum.BASE_LOGIN_NAME;
|
|
|
|
|
|
|
|
const tenantOptions = ref<{ tenantCode: string; tenantId: number; tenantName: string }[]>([]);
|
|
const tenantOptions = ref<{ tenantCode: string; tenantId: number; tenantName: string }[]>([]);
|
|
|
- const tenantAccounts = [
|
|
|
|
|
- // { username: 'bj', password: '123456' },
|
|
|
|
|
- // { username: 'sz', password: '123456' },
|
|
|
|
|
- // { username: 'gz', password: '123456' },
|
|
|
|
|
- // { username: 'sh', password: '123456' },
|
|
|
|
|
- ];
|
|
|
|
|
|
|
+ // const tenantAccounts = [
|
|
|
|
|
+ // { username: 'bj', password: '123456' },
|
|
|
|
|
+ // { username: 'sz', password: '123456' },
|
|
|
|
|
+ // { username: 'gz', password: '123456' },
|
|
|
|
|
+ // { username: 'sh', password: '123456' },
|
|
|
|
|
+ // ];
|
|
|
|
|
|
|
|
const formInline = reactive({
|
|
const formInline = reactive({
|
|
|
username: '',
|
|
username: '',
|
|
@@ -186,15 +186,15 @@
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
|
const route = useRoute();
|
|
const route = useRoute();
|
|
|
|
|
|
|
|
- function tenantIdChange() {
|
|
|
|
|
- const tenantId = formInline.tenantId;
|
|
|
|
|
- const index = tenantOptions.value.findIndex((item) => item.tenantId === tenantId);
|
|
|
|
|
- if (index >= 0) {
|
|
|
|
|
- const info = tenantAccounts[index];
|
|
|
|
|
- formInline.username = info.username;
|
|
|
|
|
- formInline.password = info.password;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // function tenantIdChange() {
|
|
|
|
|
+ // const tenantId = formInline.tenantId;
|
|
|
|
|
+ // const index = tenantOptions.value.findIndex((item) => item.tenantId === tenantId);
|
|
|
|
|
+ // if (index >= 0) {
|
|
|
|
|
+ // const info = tenantAccounts[index];
|
|
|
|
|
+ // formInline.username = info.username;
|
|
|
|
|
+ // formInline.password = info.password;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
function getTentantList() {
|
|
function getTentantList() {
|
|
|
tentantList().then((res) => {
|
|
tentantList().then((res) => {
|
|
@@ -236,14 +236,22 @@
|
|
|
const { code, msg } = await userStore.login(params);
|
|
const { code, msg } = await userStore.login(params);
|
|
|
if (code == ResultEnum.SUCCESS) {
|
|
if (code == ResultEnum.SUCCESS) {
|
|
|
const toPath = decodeURIComponent((route.query?.redirect || '/') as string);
|
|
const toPath = decodeURIComponent((route.query?.redirect || '/') as string);
|
|
|
- ElMessage.success('登录成功,即将进入系统');
|
|
|
|
|
|
|
+ ElMessage({
|
|
|
|
|
+ message: '登录成功,即将进入系统',
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ offset: 100,
|
|
|
|
|
+ });
|
|
|
if (route.name === LOGIN_NAME) {
|
|
if (route.name === LOGIN_NAME) {
|
|
|
router.replace('/');
|
|
router.replace('/');
|
|
|
} else router.replace(toPath);
|
|
} else router.replace(toPath);
|
|
|
} else {
|
|
} else {
|
|
|
formInline.verCode = '';
|
|
formInline.verCode = '';
|
|
|
getCaptcha();
|
|
getCaptcha();
|
|
|
- ElMessage.error(msg || '登录失败');
|
|
|
|
|
|
|
+ ElMessage({
|
|
|
|
|
+ message: msg || '登录失败',
|
|
|
|
|
+ type: 'error',
|
|
|
|
|
+ offset: 100,
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
} finally {
|
|
} finally {
|
|
|
loading.value = false;
|
|
loading.value = false;
|
|
@@ -252,6 +260,7 @@
|
|
|
ElMessage({
|
|
ElMessage({
|
|
|
message: '请填写完整信息',
|
|
message: '请填写完整信息',
|
|
|
type: 'error',
|
|
type: 'error',
|
|
|
|
|
+ offset: 100,
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -285,9 +294,9 @@
|
|
|
--el-input-border-radius: 20px !important;
|
|
--el-input-border-radius: 20px !important;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- .login-btn {
|
|
|
|
|
- :hover {
|
|
|
|
|
- color: rgb(24, 144, 255);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // .login-btn {
|
|
|
|
|
+ // :hover {
|
|
|
|
|
+ // color: rgb(24, 144, 255);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
</style>
|
|
</style>
|