diff --git a/src/router/index.ts b/src/router/index.ts index 931d223..cbc9955 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 7aaf241..31795cb 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()) {