feat:登录接窗口返回的token
This commit is contained in:
@@ -166,7 +166,7 @@ import useUserStore from "@/stores/user";
|
|||||||
import useConfigStore from "@/stores/config";
|
import useConfigStore from "@/stores/config";
|
||||||
|
|
||||||
const configStore = useConfigStore();
|
const configStore = useConfigStore();
|
||||||
const { loginFun, registerFun } = useAuths();
|
const { loginFun, registerFun, setToken } = useAuths();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const loginFormRef = ref();
|
const loginFormRef = ref();
|
||||||
@@ -321,10 +321,8 @@ const handleGiteeLogin = () => {
|
|||||||
|
|
||||||
window.addEventListener("message", async (e) => {
|
window.addEventListener("message", async (e) => {
|
||||||
const { authData, type } = e.data;
|
const { authData, type } = e.data;
|
||||||
console.log("我是登录页", authData);
|
setToken(authData);
|
||||||
console.log("我是登录页", type);
|
|
||||||
if (e.data) {
|
if (e.data) {
|
||||||
await checkList();
|
|
||||||
window.close();
|
window.close();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user