From a775b86e2e0973a16e6b9a1945acbd904773b876 Mon Sep 17 00:00:00 2001 From: Charles7c Date: Thu, 6 Jun 2024 21:27:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E7=99=BB=E5=BD=95=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.ts | 5 ++- src/views/login/social/index.vue | 12 ++++-- src/views/setting/profile/Social.vue | 61 +++++++++++++--------------- 3 files changed, 41 insertions(+), 37 deletions(-) diff --git a/src/router/index.ts b/src/router/index.ts index 931d223c..cbc99555 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,4 +1,4 @@ -import { type RouteRecordRaw, createRouter, createWebHashHistory } from 'vue-router' +import { type RouteRecordRaw, createRouter, createWebHistory } from 'vue-router' import { useRouteStore } from '@/stores' /** 默认布局 */ @@ -19,6 +19,7 @@ export const constantRoutes: RouteRecordRaw[] = [ }, { path: '/login', + name: 'Login', component: () => import('@/views/login/index.vue'), meta: { hidden: true } }, @@ -75,7 +76,7 @@ export const constantRoutes: RouteRecordRaw[] = [ ] const router = createRouter({ - history: createWebHashHistory(import.meta.env.BASE_URL), + history: createWebHistory(import.meta.env.BASE_URL), routes: constantRoutes, scrollBehavior: () => ({ left: 0, top: 0 }) }) diff --git a/src/views/login/social/index.vue b/src/views/login/social/index.vue index 7aaf2412..31795cbf 100644 --- a/src/views/login/social/index.vue +++ b/src/views/login/social/index.vue @@ -1,5 +1,5 @@ @@ -8,10 +8,12 @@ import { Message } from '@arco-design/web-vue' import { useRoute, useRouter } from 'vue-router' import { bindSocialAccount } from '@/apis' +import { useUserStore } from '@/stores' import { isLogin } from '@/utils/auth' const route = useRoute() const router = useRouter() +const userStore = useUserStore() const source = route.query.source as string const loading = ref(false) @@ -50,14 +52,14 @@ const handleBindSocial = () => { loading.value = true const { ...othersQuery } = router.currentRoute.value.query bindSocialAccount(source, othersQuery) - .then((res) => { + .then(() => { router.push({ path: '/setting/profile', query: { ...othersQuery } }) - proxy.$message.success(res.msg) + Message.success('绑定成功') }) .catch(() => { router.push({ @@ -80,6 +82,10 @@ if (isLogin()) {