|
@@ -37,7 +37,7 @@ import { sha256 } from "js-sha256";
|
|
import { setLocalStorage } from "@/utils";
|
|
import { setLocalStorage } from "@/utils";
|
|
|
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
-const username = ref("admin");
|
|
|
|
|
|
+const username = ref("cus_user01");
|
|
const password = ref("123456");
|
|
const password = ref("123456");
|
|
const isRemember = ref(true);
|
|
const isRemember = ref(true);
|
|
|
|
|
|
@@ -47,8 +47,9 @@ const onLogin = async () => {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
const data = {
|
|
const data = {
|
|
- username: "admin",
|
|
|
|
- password: sha256("123456"),
|
|
|
|
|
|
+ username: username.value,
|
|
|
|
+ password: sha256(password.value),
|
|
|
|
+ clientType: "user",
|
|
};
|
|
};
|
|
const res = (await postLogin(data)) as unknown as any;
|
|
const res = (await postLogin(data)) as unknown as any;
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
@@ -56,6 +57,9 @@ const onLogin = async () => {
|
|
setLocalStorage("avatar", res.data.avatar);
|
|
setLocalStorage("avatar", res.data.avatar);
|
|
setLocalStorage("tokenName", res.data.tokenName);
|
|
setLocalStorage("tokenName", res.data.tokenName);
|
|
setLocalStorage("tokenValue", res.data.tokenValue);
|
|
setLocalStorage("tokenValue", res.data.tokenValue);
|
|
|
|
+ setLocalStorage("phone", res.data.phone);
|
|
|
|
+ setLocalStorage("name", res.data.name);
|
|
|
|
+ setLocalStorage("avatar", res.data.avatar);
|
|
router.push({
|
|
router.push({
|
|
path: "/dashboard",
|
|
path: "/dashboard",
|
|
});
|
|
});
|