|
|
|
@ -152,7 +152,6 @@ const rules = {
|
|
|
|
|
|
|
|
|
|
function handleSubmit(e) {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
console.log(formRef.value,'formRef')
|
|
|
|
|
loginSuccess.value = true;
|
|
|
|
|
formRef.value.validate(async (errors) => {
|
|
|
|
|
if (!errors) {
|
|
|
|
@ -165,7 +164,6 @@ function handleSubmit(e) {
|
|
|
|
|
codetoken: userStore.getCapToken,
|
|
|
|
|
agentcode: enterprisecode,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
const { code, message: msg } = await userStore.login(params);
|
|
|
|
|
loginRejectMessge.value = msg;
|
|
|
|
@ -177,11 +175,11 @@ function handleSubmit(e) {
|
|
|
|
|
localStorage.removeItem("LOGIN_FORM_PASS");
|
|
|
|
|
}
|
|
|
|
|
loginSuccess.value = true;
|
|
|
|
|
await userStore.getInformation();
|
|
|
|
|
const userInfo = await userStore.getInformation();
|
|
|
|
|
message.destroyAll();
|
|
|
|
|
const toPath = decodeURIComponent((route.query?.redirect || "/") as string);
|
|
|
|
|
message.success("登录成功,即将进入系统");
|
|
|
|
|
if (route.name === LOGIN_NAME) router.replace("/");
|
|
|
|
|
if (route.name === LOGIN_NAME) router.replace(userInfo.frontmenuTList[0]['resUrl']);
|
|
|
|
|
else router.replace(toPath);
|
|
|
|
|
} else {
|
|
|
|
|
loginSuccess.value = false;
|
|
|
|
@ -245,11 +243,11 @@ function handleSmsSubmit(e) {
|
|
|
|
|
loginSuccess.value = true;
|
|
|
|
|
// const { code, message: msg } = await userStore.login(params)
|
|
|
|
|
await userStore.setStorageToken(res.data);
|
|
|
|
|
await userStore.getInformation();
|
|
|
|
|
const userInfo = await userStore.getInformation();
|
|
|
|
|
message.destroyAll();
|
|
|
|
|
const toPath = decodeURIComponent((route.query?.redirect || "/") as string);
|
|
|
|
|
message.success("登录成功,即将进入系统");
|
|
|
|
|
if (route.name === LOGIN_NAME) router.replace("/");
|
|
|
|
|
if (route.name === LOGIN_NAME) router.replace(userInfo.frontmenuTList[0]['resUrl']);
|
|
|
|
|
else router.replace(toPath);
|
|
|
|
|
} else {
|
|
|
|
|
message.destroyAll();
|
|
|
|
|