feat:gitee绑定使用postMessage通信

This commit is contained in:
Xwen
2024-01-09 23:00:53 +08:00
parent ec38f939d5
commit 50d381cab9
2 changed files with 19 additions and 5 deletions

View File

@@ -123,11 +123,21 @@ const handleQQLogin = () => {
const handleGiteeLogin = () => {
window.open(
"https://gitee.com/oauth/authorize?client_id=949f3519969adc5cfe82c209b71300e8e0868e8536f3d7f59195c8f1e5b72502&redirect_uri=https%3A%2F%2Fccnetcore.com%2Fauth%2Fgitee&state=1&response_type=code",
"/auth/gitee?code=907b2b59088678ad07d21561c175b0226c031370ab0b4ba1ae9928ea40148d83&state=1",
undefined,
"width=500,height=500,left=50,top=50"
"width=500,height=500,left=50,top=50",
"_black"
);
};
window.addEventListener("message", async (e) => {
const { authData, type } = e.data;
if (e.data) {
console.log(authData, type, "2333");
await checkList();
window.close();
}
});
</script>
<style lang="scss" scoped>