diff --git a/apps/web-antd/src/api/system/social/user/index.ts b/apps/web-antd/src/api/system/social/user/index.ts index f259be46a..d99a6129f 100644 --- a/apps/web-antd/src/api/system/social/user/index.ts +++ b/apps/web-antd/src/api/system/social/user/index.ts @@ -1,6 +1,7 @@ -import { requestClient } from '#/api/request'; import type { PageParam, PageResult } from '@vben/request'; +import { requestClient } from '#/api/request'; + export namespace SystemSocialUserApi { /** 社交用户信息 */ export interface SystemSocialUser { @@ -17,6 +18,19 @@ export namespace SystemSocialUserApi { createTime?: Date; updateTime?: Date; } + + /** 社交绑定请求 */ + export interface SocialUserBindReqVO { + type: number; + code: string; + state: string; + } + + /** 取消社交绑定请求 */ + export interface SocialUserUnbindReqVO { + type: number; + openid: string; + } } /** 查询社交用户列表 */ @@ -30,3 +44,18 @@ export function getSocialUserPage(params: PageParam) { export function getSocialUser(id: number) { return requestClient.get(`/system/social-user/get?id=${id}`); } + +/** 社交绑定,使用 code 授权码 */ +export function socialBind(data: SystemSocialUserApi.SocialUserBindReqVO) { + return requestClient.post('/system/social-user/bind', data); +} + +/** 取消社交绑定 */ +export function socialUnbind(data: SystemSocialUserApi.SocialUserUnbindReqVO) { + return requestClient.delete('/system/social-user/unbind', { data }); +} + +/** 获得绑定社交用户列表 */ +export function getBindSocialUserList() { + return requestClient.get('/system/social-user/get-bind-list'); +} diff --git a/apps/web-antd/src/api/system/user/profile/index.ts b/apps/web-antd/src/api/system/user/profile/index.ts index ae3f77d98..c73a665d5 100644 --- a/apps/web-antd/src/api/system/user/profile/index.ts +++ b/apps/web-antd/src/api/system/user/profile/index.ts @@ -1,12 +1,6 @@ import { requestClient } from '#/api/request'; export namespace SystemUserProfileApi { - /** 社交用户信息 */ - export interface SocialUser { - type: number; - openid: string; - } - /** 用户个人中心信息 */ export interface UserProfileRespVO { id: number; @@ -22,7 +16,6 @@ export namespace SystemUserProfileApi { roles: any[]; dept: any; posts: any[]; - socialUsers: SocialUser[]; } /** 更新密码请求 */ diff --git a/apps/web-antd/src/views/_core/profile/index.vue b/apps/web-antd/src/views/_core/profile/index.vue index 9421eb7ef..7b03a4e14 100644 --- a/apps/web-antd/src/views/_core/profile/index.vue +++ b/apps/web-antd/src/views/_core/profile/index.vue @@ -6,13 +6,15 @@ import { Page } from '@vben/common-ui'; import ProfileUser from './modules/profile-user.vue'; import BaseInfo from './modules/base-info.vue'; import ResetPwd from './modules/reset-pwd.vue'; +import UserSocial from './modules/user-social.vue'; import { onMounted, ref } from 'vue'; import { getUserProfile } from '#/api/system/user/profile'; import { useAuthStore } from '#/store'; const authStore = useAuthStore(); -const activeName = ref('basicInfo'); +// const activeName = ref('basicInfo'); +const activeName = ref('userSocial'); /** 加载个人信息 */ const profile = ref(); @@ -51,7 +53,7 @@ onMounted(loadProfile); - + diff --git a/apps/web-antd/src/views/_core/profile/modules/user-social.vue b/apps/web-antd/src/views/_core/profile/modules/user-social.vue new file mode 100644 index 000000000..b9e892f1d --- /dev/null +++ b/apps/web-antd/src/views/_core/profile/modules/user-social.vue @@ -0,0 +1,153 @@ + + + diff --git a/apps/web-antd/src/views/system/tenant/data.ts b/apps/web-antd/src/views/system/tenant/data.ts index de8fd256e..73288d026 100644 --- a/apps/web-antd/src/views/system/tenant/data.ts +++ b/apps/web-antd/src/views/system/tenant/data.ts @@ -182,7 +182,9 @@ export function useGridFormSchema(): VbenFormSchema[] { /** 列表的字段 */ const tenantPackageList = await getTenantPackageList(); -export function useGridColumns(onActionClick: OnActionClickFn): VxeTableGridOptions['columns'] { +export function useGridColumns( + onActionClick: OnActionClickFn, +): VxeTableGridOptions['columns'] { return [ { field: 'id',