liu
2026-09-30 40aa088ad24aa90e59dd15280a9b96e48265a09d
src/views/_core/profile/modules/user-social.vue
@@ -5,10 +5,10 @@
import { computed, onMounted, ref } from 'vue';
import { useRoute } from 'vue-router';
import { confirm } from '../../../../packages/effects/common-ui/src';
import { DICT_TYPE, SystemUserSocialTypeEnum } from '../../../../packages/constants/src';
import { getDictLabel } from '../../../../packages/effects/hooks/src';
import { getUrlValue } from '../../../../packages/utils/src';
import { confirm } from '@vben/common-ui';
import { DICT_TYPE, SystemUserSocialTypeEnum } from '@vben/constants';
import { getDictLabel } from '@vben/hooks';
import { getUrlValue } from '@vben/utils';
import { Button, Card, Image, message } from 'ant-design-vue';
@@ -122,7 +122,9 @@
  try {
    // 计算 redirectUri
    // tricky: type 需要先 encode 一次,否则钉钉回调会丢失。配合 getUrlValue() 使用
    const redirectUri = `${location.origin}/profile?${encodeURIComponent(`type=${type}`)}`;
    // hash 路由(生产构建)下必须带 # 前缀,否则回跳后 vue-router 解析到 /,进不了绑定流程
    const hashPrefix = import.meta.env.VITE_ROUTER_HISTORY === 'hash' ? '/#' : '';
    const redirectUri = `${location.origin}${hashPrefix}/profile?${encodeURIComponent(`type=${type}`)}`;
    // 进行跳转
    window.location.href = await socialAuthRedirect(type, redirectUri);