|
@@ -70,7 +70,12 @@ const postFile = (url: string, data: Record<string, any>) => {
|
|
|
);
|
|
|
};
|
|
|
|
|
|
+let isLoging = false
|
|
|
const login = (isBack = true) => {
|
|
|
+ if (isLoging) {
|
|
|
+ throw '登录中'
|
|
|
+ }
|
|
|
+ isLoging = true
|
|
|
if (import.meta.env.DEV && params.value.caseId) {
|
|
|
post("/service/manage/login", {
|
|
|
password: "JwiuK95dExMjM0NTY=7nHGf5ySQWSuC4G1An",
|
|
@@ -78,8 +83,10 @@ const login = (isBack = true) => {
|
|
|
userName: "super-admin",
|
|
|
}).then((res) => {
|
|
|
params.value.token = res.token;
|
|
|
+ console.error(res.token)
|
|
|
// console.log(res.token, {...params.value})
|
|
|
- // setTimeout(() => location.reload(), 1000)
|
|
|
+ setTimeout(() => location.reload(), 1000)
|
|
|
+ isLoging = false
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
@@ -106,7 +113,8 @@ const login = (isBack = true) => {
|
|
|
delete query["redirect"];
|
|
|
link = urlUpdateQuery(url.toString(), query, true);
|
|
|
}
|
|
|
- location.replace(link);
|
|
|
+ // location.replace(link);
|
|
|
+ isLoging = false
|
|
|
}
|
|
|
};
|
|
|
|