From 6f5c35ea77b1e3880bca477ec027d074915341e8 Mon Sep 17 00:00:00 2001 From: Charles7c Date: Wed, 6 Mar 2024 22:53:06 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E9=80=82=E9=85=8D=E9=83=A8=E5=88=86?= =?UTF-8?q?=20API=20=E5=93=8D=E5=BA=94=E6=A0=BC=E5=BC=8F=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E4=B8=BA=20kv=20=E6=A0=BC=E5=BC=8F=E7=9A=84=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/auth/index.ts | 6 +++++- src/views/login/index.vue | 2 +- src/views/system/config/components/basic-setting.vue | 4 ++-- .../center/components/security-settings/bind-social.vue | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/api/auth/index.ts b/src/api/auth/index.ts index 10bba29..6ab15b3 100644 --- a/src/api/auth/index.ts +++ b/src/api/auth/index.ts @@ -49,8 +49,12 @@ export function listRoute() { return axios.get(`${BASE_URL}/route`); } +export interface SocialAuthAuthorizeResp { + authorizeUrl: string; +} + export function socialAuth(source: string) { - return axios.get(`/oauth/${source}`); + return axios.get(`/oauth/${source}`); } export function socialLogin(source: string, req: any) { diff --git a/src/views/login/index.vue b/src/views/login/index.vue index abc9746..69b7b09 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -17,7 +17,7 @@ */ const handleSocialAuth = async (source: string) => { const { data } = await socialAuth(source); - window.location.href = data; + window.location.href = data.authorizeUrl; }; const toggleLoginMode = () => { diff --git a/src/views/system/config/components/basic-setting.vue b/src/views/system/config/components/basic-setting.vue index 1f1e160..eb05165 100644 --- a/src/views/system/config/components/basic-setting.vue +++ b/src/views/system/config/components/basic-setting.vue @@ -121,7 +121,7 @@ upload(formData) .then((res) => { onSuccess(res); - form.value.site_logo = res.data; + form.value.site_logo = res.data.url; proxy.$message.success(res.msg); }) .catch((error) => { @@ -156,7 +156,7 @@ upload(formData) .then((res) => { onSuccess(res); - form.value.site_favicon = res.data; + form.value.site_favicon = res.data.url; proxy.$message.success(res.msg); }) .catch((error) => { diff --git a/src/views/system/user/center/components/security-settings/bind-social.vue b/src/views/system/user/center/components/security-settings/bind-social.vue index 40cae52..3b8f461 100644 --- a/src/views/system/user/center/components/security-settings/bind-social.vue +++ b/src/views/system/user/center/components/security-settings/bind-social.vue @@ -57,7 +57,7 @@ hideCancel: false, onOk: () => { socialAuth(source).then((res) => { - window.location.href = res.data; + window.location.href = res.data.authorizeUrl; }); }, });