| | |
| | | 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'; |
| | | |
| | |
| | | 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); |