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; }); }, });