diff --git a/Yi.Bbs.Vue3/src/views/Auth/index.vue b/Yi.Bbs.Vue3/src/views/Auth/index.vue
index 5235d447..73c664a8 100644
--- a/Yi.Bbs.Vue3/src/views/Auth/index.vue
+++ b/Yi.Bbs.Vue3/src/views/Auth/index.vue
@@ -10,6 +10,7 @@ import { authOtherLogin, authOtherBind } from "@/apis/auth.js";
const route = useRoute();
const code = ref(route.query.code);
+const type = ref(route.query.state);
const message = ref("");
watch(
@@ -20,8 +21,13 @@ watch(
const regex = /\/auth\/([\w-]+)[?]?/;
const result = regex.exec(route.fullPath);
const authParam = result != null ? result[1].toUpperCase() : null;
- const res = await authOtherBind({ code: val }, authParam);
- console.log(res, "res");
+ if (type.value === 0) {
+ const res = await authOtherLogin({ code: val }, authParam);
+ console.log(res, "type.value === 0");
+ } else if (type.value === 1) {
+ const res = await authOtherBind({ code: val }, authParam);
+ console.log(res, "type.value === 1");
+ }
message.value = "授权成功";
// window.close();
}
diff --git a/Yi.Bbs.Vue3/src/views/login/index.vue b/Yi.Bbs.Vue3/src/views/login/index.vue
index 8c422604..09197fe2 100644
--- a/Yi.Bbs.Vue3/src/views/login/index.vue
+++ b/Yi.Bbs.Vue3/src/views/login/index.vue
@@ -140,10 +140,10 @@
@@ -305,7 +305,15 @@ const handleContact = () => {
const handleQQLogin = () => {
window.open(
- "https://graph.qq.com/oauth2.0/authorize?response_type=code&client_id=102087446&redirect_uri=https://ccnetcore.com/auth/qq&state=true&scope=get_user_info",
+ "https://graph.qq.com/oauth2.0/authorize?response_type=code&client_id=102087446&redirect_uri=https://ccnetcore.com/auth/qq&state=0&scope=get_user_info",
+ undefined,
+ "width=500,height=500,left=50,top=50"
+ );
+};
+
+const handleGiteeLogin = () => {
+ window.open(
+ "https://gitee.com/oauth/authorize?client_id=949f3519969adc5cfe82c209b71300e8e0868e8536f3d7f59195c8f1e5b72502&redirect_uri=https%3A%2F%2Fccnetcore.com%2Fauth%2Fgitee&state=0&response_type=code",
undefined,
"width=500,height=500,left=50,top=50"
);
diff --git a/Yi.Bbs.Vue3/src/views/profile/AccountSetting.vue b/Yi.Bbs.Vue3/src/views/profile/AccountSetting.vue
index ddd05a44..181e9e11 100644
--- a/Yi.Bbs.Vue3/src/views/profile/AccountSetting.vue
+++ b/Yi.Bbs.Vue3/src/views/profile/AccountSetting.vue
@@ -92,7 +92,7 @@ onMounted(async () => {
const handleQQLogin = () => {
window.open(
- "https://graph.qq.com/oauth2.0/authorize?response_type=code&client_id=102087446&redirect_uri=https://ccnetcore.com/auth/qq&state=true&scope=get_user_info",
+ "https://graph.qq.com/oauth2.0/authorize?response_type=code&client_id=102087446&redirect_uri=https://ccnetcore.com/auth/qq&state=1&scope=get_user_info",
undefined,
"width=500,height=500,left=50,top=50"
);
@@ -100,7 +100,7 @@ const handleQQLogin = () => {
const handleGiteeLogin = () => {
window.open(
- "https://gitee.com/oauth/authorize?client_id=949f3519969adc5cfe82c209b71300e8e0868e8536f3d7f59195c8f1e5b72502&redirect_uri=https%3A%2F%2Fccnetcore.com%2Fauth%2Fgitee&response_type=code",
+ "https://gitee.com/oauth/authorize?client_id=949f3519969adc5cfe82c209b71300e8e0868e8536f3d7f59195c8f1e5b72502&redirect_uri=https%3A%2F%2Fccnetcore.com%2Fauth%2Fgitee&state=1&response_type=code",
undefined,
"width=500,height=500,left=50,top=50"
);