diff --git a/src/api/common/base/entity/index.ts b/src/api/common/base/entity/index.ts index 9e86231..9fc3edf 100644 --- a/src/api/common/base/entity/index.ts +++ b/src/api/common/base/entity/index.ts @@ -6,8 +6,8 @@ * @create: 2022/4/8 */ -/** 扩展安全框架用户信息 */ -export interface KiccUser { +/** CAS统一认证用户模型 */ +export interface CasUser { username: string; password: string; enabled: boolean; @@ -30,8 +30,14 @@ export interface KiccUser { updateByName: string; updateTime: string; remarks: string; + roleId: string; tenantId: string; exPrincipals: { [key: string]: string }; + [key: string]: any; +} + +/** SSO扩展用户模型 */ +export interface KiccUser extends CasUser { deptId: string; userType: string; exPermissions: string[]; diff --git a/src/api/platform/core/controller/user.ts b/src/api/platform/core/controller/user.ts index 5d26a8b..db306a9 100644 --- a/src/api/platform/core/controller/user.ts +++ b/src/api/platform/core/controller/user.ts @@ -4,8 +4,7 @@ * author wangxiang4 */ -import type { Captcha, User, LoginParams, TokenEnhancer } from '../entity/user'; -import type { RequestOptions } from '/#/axios'; +import type { Captcha, LoginParams, TokenEnhancer, UserVo } from '../entity/user'; import { encryptionLogin } from '/@/utils/cipher'; import { defHttp } from '/@/utils/http/axios'; import qs from 'qs'; @@ -46,7 +45,7 @@ export const login = (params: LoginParams) => { }; /** 获取当前用户信息 */ -export const getUserInfo = () => defHttp.get({ url: Api.getUserInfo }); +export const getUserInfo = () => defHttp.get({ url: Api.getUserInfo }); /** 登出 */ export const logout = () => defHttp.delete({ url: Api.logout }, { errorMessageMode: 'none'}); diff --git a/src/api/platform/core/entity/user.ts b/src/api/platform/core/entity/user.ts index fcbff0a..cf27435 100644 --- a/src/api/platform/core/entity/user.ts +++ b/src/api/platform/core/entity/user.ts @@ -5,9 +5,9 @@ * @author: wangxiang4 * @create: 2022/4/8 */ -import type { CommonEntity } from '/@/api/common/data/entity'; -import type { KiccUser } from '/@/api/common/base/entity'; +import type { CasUser } from '/@/api/common/base/entity'; import type { RequestOptions } from '/#/axios'; +import { SsoUser } from '/@/api/platform/system/entity/ssoUser'; /** 登录参数对象 */ export interface LoginParams { @@ -29,55 +29,35 @@ export interface TokenEnhancer { refresh_token: string; scope: string; token_type: string; - user_info: KiccUser; + user_info: CasUser; } -/** 用户对象 */ -export interface User extends CommonEntity { - // 用户id +/** 用户VO对象 */ +export interface UserVo extends SsoUser { + // 系统用户id id: string; - // 用户名 - userName: string; - // 昵称 - nickName: string; + // CAS用户ID + casUserId: string; // 用户类型 userType: string; - // 头像 - avatar: string; // 所属部门ID deptId: string; // 所属部门名称 deptName: string; - // 邮箱 - email: string; - // 菜单按钮权限 - permissions: string[]; - // 角色ID权限 - roleIds: string[]; - // 手机号 - phone: string; - // 用户密码 - password: string; - // 用户性别 - sex: string; - // 最后登陆IP - loginIp: string; - // 最后登陆时间 - loginTime: string; // 地图标记点位置图片旋转值 mapOrientation: number; // 地图设计器默认中心点位置 mapCenter: string; // 用户状态 status: string; - // 备注信息 - remarks: string; - // 多租户ID - tenantId: string; // 指定登录后首页跳转 homePath?: string; // 前端项目配置多租户选择集合 tenantIds: string[]; + // 角色ID权限 + roleIds: string[]; + // 菜单按钮权限 + permissions: string[]; [key: string]: any; } diff --git a/src/api/platform/system/controller/ssoUser.ts b/src/api/platform/system/controller/ssoUser.ts index 8357762..61f9a7b 100644 --- a/src/api/platform/system/controller/ssoUser.ts +++ b/src/api/platform/system/controller/ssoUser.ts @@ -5,6 +5,7 @@ */ import type { SsoUserParams, SsoUser ,SsoUserResult } from '/@/api/platform/system/entity/ssoUser'; import { defHttp } from '/@/utils/http/axios'; +import { UserVo } from '/@/api/platform/core/entity/user'; enum Api { list = '/system_proxy/system/ssoUser/list', @@ -15,6 +16,7 @@ enum Api { del = '/system_proxy/system/ssoUser/remove', updatePwd = '/system_proxy/system/ssoUser/updatePwd', resetPwd='/system_proxy/system/ssoUser/resetPwd', + updateSsoUserAndExUser = '/system_proxy/system/ssoUser/updateSsoUserAndExUser' } export const listSsoUser = (params?: Partial) => defHttp.get({ url: Api.list, params }, { isReturnResultResponse: true }); @@ -32,3 +34,5 @@ export const delSsoUser = (ids: string) => defHttp.delete({ url: `${Api.del}/${i export const updatePwd = (params: Partial) => defHttp.put({ url: Api.updatePwd, params }); export const resetPwd = (params: Partial) => defHttp.put({ url: Api.resetPwd, data: params }); + +export const updateSsoUserAndExUser = (params: Partial) => defHttp.put({ url: Api.updateSsoUserAndExUser, data: params }); diff --git a/src/api/platform/system/controller/user.ts b/src/api/platform/system/controller/user.ts index 3658e60..33560aa 100644 --- a/src/api/platform/system/controller/user.ts +++ b/src/api/platform/system/controller/user.ts @@ -3,11 +3,10 @@ * Copyright © 2023-2023 海豚生态开源社区 All rights reserved. * author wangxiang4 */ -import type { UserParams, UserResult } from '/@/api/platform/system/entity/user'; -import type { User } from '/@/api/platform/core/entity/user'; +import type { UserParams, User, UserResult } from '/@/api/platform/system/entity/user'; +import type { UserVo } from '/@/api/platform/core/entity/user'; import type { ResultVo } from '/@/api/common/base/entity'; import { defHttp } from '/@/utils/http/axios'; -import { KiccUser } from '/@/api/common/base/entity'; enum Api { list = '/system_proxy/system/user/list', @@ -15,12 +14,9 @@ enum Api { get = '/system_proxy/system/user', edit = '/system_proxy/system/user/update', del = '/system_proxy/system/user/remove', - updatePwd = '/system_proxy/system/user/updatePwd', - resetPwd='/system_proxy/system/user/resetPwd', changeStatus='/system_proxy/system/user/changeStatus', changeTenant='/system_proxy/system/user/changeTenant', resetTenant='/system_proxy/system/user/resetTenant', - synchronousAuthenticationUser = '/system_proxy/system/user/synchronousAuthenticationUser', getCourierUserList= '/system_proxy/system/user/getCourierUserList', getUserTypeList= '/system_proxy/system/user/getUserTypeList', } @@ -40,12 +36,6 @@ export const getUser = (id: string) => defHttp.get({ url: `${Api.get}/ /** 删除用户 */ export const delUser = (ids: string) => defHttp.delete({ url: `${Api.del}/${ids}` }); -/** 更新密码 */ -export const updatePwd = (params: Partial) => defHttp.put({ url: Api.updatePwd, params }); - -/** 重置密码 */ -export const resetPwd = (params: Partial) => defHttp.put({ url: Api.resetPwd, data: params }); - /** 修改用户状态 */ export const changeStatus = (id: string, status: string) => defHttp.put({ url: Api.changeStatus, data: { id: id, status: status } }); @@ -55,11 +45,8 @@ export const changeTenant = (tenantIds: string[]) => defHttp.get({ url: `${Api.c /** 还原用户多租户 */ export const resetTenant = () => defHttp.get({ url: Api.resetTenant }); -/** 同步身份验证用户 */ -export const synchronousAuthenticationUser = () => defHttp.get({ url: Api.synchronousAuthenticationUser }); - /** 获取全部快递员集合 */ -export const getCourierUserList = () => defHttp.get({ url: Api.getCourierUserList }); +export const getCourierUserList = () => defHttp.get({ url: Api.getCourierUserList }); /** 获取用户类型集合 */ export const getUserTypeList = () => defHttp.get({ url: Api.getUserTypeList }); diff --git a/src/api/platform/system/entity/ssoUser.ts b/src/api/platform/system/entity/ssoUser.ts index b6f5a37..1e9b5e1 100644 --- a/src/api/platform/system/entity/ssoUser.ts +++ b/src/api/platform/system/entity/ssoUser.ts @@ -8,8 +8,11 @@ import type { R } from '/#/axios'; import type { Page } from '/@/api/common/data/entity'; import { CommonEntity } from '/@/api/common/data/entity'; + +/** SSO用户查询参数 */ export type SsoUserParams = Page & SsoUser; +/** SSO用户对象 */ export interface SsoUser extends CommonEntity { // 用户id id: string; @@ -17,16 +20,16 @@ export interface SsoUser extends CommonEntity { userName: string; // 昵称 nickName: string; - // 头像 - avatar: string; + // 用户密码 + password: string; // 邮箱 email: string; // 手机号 phone: string; - // 用户密码 - password: string; // 用户性别 sex: string; + // 头像 + avatar: string; // 最后登陆IP loginIp: string; // 最后登陆时间 @@ -34,4 +37,5 @@ export interface SsoUser extends CommonEntity { [key: string]: any; } +/** SSO用户对象 */ export type SsoUserResult = R; diff --git a/src/api/platform/system/entity/user.ts b/src/api/platform/system/entity/user.ts index 7f3f005..03987f6 100644 --- a/src/api/platform/system/entity/user.ts +++ b/src/api/platform/system/entity/user.ts @@ -6,11 +6,34 @@ * @create: 2022/4/8 */ import type { R } from '/#/axios'; -import type { Page } from '/@/api/common/data/entity'; -import type { User } from '/@/api/platform/core/entity/user'; +import type { CommonEntity, Page } from '/@/api/common/data/entity'; +import { UserVo } from '/@/api/platform/core/entity/user'; /** 用户查询参数 */ export type UserParams = Page & User; +/** 用户对象 */ +export interface User extends CommonEntity { + // 系统用户id + id: string; + // CAS用户ID + casUserId: string; + // 用户类型 + userType: string; + // 所属部门ID + deptId: string; + // 所属部门名称 + deptName: string; + // 地图标记点位置图片旋转值 + mapOrientation: number; + // 地图设计器默认中心点位置 + mapCenter: string; + // 用户状态 + status: string; + // 指定登录后首页跳转 + homePath?: string; + [key: string]: any; +} + /** 用户响应对象 */ -export type UserResult = R; +export type UserResult = R; diff --git a/src/hooks/web/useTenant.ts b/src/hooks/web/useTenant.ts index f48da92..d5bd960 100644 --- a/src/hooks/web/useTenant.ts +++ b/src/hooks/web/useTenant.ts @@ -11,25 +11,20 @@ export function useTenant() { const userStore = useUserStore(); // 切换多租户会改变当前系统中的数据环境 - async function changeTenantEnv(tenantIds: string[], reload = true) { + async function changeTenantEnv(tenantIds: string[]) { // 更改当前后端系统中的全局多租户数据 await changeTenant(tenantIds); // 更改当前前端系统中的全局多租户数据 - const userInfo = userStore.getUserInfo; - userInfo.tenantIds = tenantIds; - userInfo.tenantId = tenantIds.join(','); - userStore.setUserInfo(userInfo); - reload && location.reload(); + document.location.reload(); return tenantIds; } // 重置多租户信息 - async function resetTenantEnv(reload = true) { + async function resetTenantEnv() { // 更改当前后端系统中的全局多租户数据 await resetTenant(); // 更改当前前端系统中的全局多租户数据 - await userStore.getUserInfoAction(); - reload && location.reload(); + document.location.reload(); } return { diff --git a/src/layouts/default/header/components/user-dropdown/index.vue b/src/layouts/default/header/components/user-dropdown/index.vue index 2ab5c17..46bb816 100644 --- a/src/layouts/default/header/components/user-dropdown/index.vue +++ b/src/layouts/default/header/components/user-dropdown/index.vue @@ -50,7 +50,7 @@ import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent'; import { useRouter } from 'vue-router'; type MenuEvent = 'logout' | 'doc' | 'lock' | 'accountSettings' | 'userCenter'; - import type { User } from '/@/api/platform/core/entity/user'; + import type { UserVo } from '/@/api/platform/core/entity/user'; import DropMenuItem from './DropMenuItem.vue'; export default defineComponent({ @@ -71,7 +71,7 @@ const { getUseLockPage } = useHeaderSetting(); const userStore = useUserStore(); - const getUserInfo = computed((): User => userStore.getUserInfo || {}); + const getUserInfo = computed((): UserVo => userStore.getUserInfo || {}); const { push } = useRouter(); const [register, { openModal }] = useModal(); diff --git a/src/locales/lang/en/routes/demo.ts b/src/locales/lang/en/routes/demo.ts index ffa9ca1..6f4ae39 100644 --- a/src/locales/lang/en/routes/demo.ts +++ b/src/locales/lang/en/routes/demo.ts @@ -150,6 +150,19 @@ export default { listBasic: 'Basic list', listSearch: 'Search list', }, + permission: { + permission: 'Permission', + + front: 'front-end', + frontPage: 'Page', + frontBtn: 'Button', + frontTestA: 'Test page A', + frontTestB: 'Test page B', + + back: 'background', + backPage: 'Page', + backBtn: 'Button', + }, setup: { page: 'Intro page', }, diff --git a/src/locales/lang/zh-CN/routes/demo.ts b/src/locales/lang/zh-CN/routes/demo.ts index 2e30821..f6229de 100644 --- a/src/locales/lang/zh-CN/routes/demo.ts +++ b/src/locales/lang/zh-CN/routes/demo.ts @@ -145,6 +145,19 @@ export default { listBasic: '标准列表', listSearch: '搜索列表', }, + permission: { + permission: '权限管理', + + front: '基于前端权限', + frontPage: '页面权限', + frontBtn: '按钮权限', + frontTestA: '权限测试页A', + frontTestB: '权限测试页B', + + back: '基于后台权限', + backPage: '页面权限', + backBtn: '按钮权限', + }, setup: { page: '引导页', }, diff --git a/src/router/guard/permissionGuard.ts b/src/router/guard/permissionGuard.ts index 663f966..775ad3c 100644 --- a/src/router/guard/permissionGuard.ts +++ b/src/router/guard/permissionGuard.ts @@ -91,7 +91,7 @@ export function createPermissionGuard(router: Router) { next(userStore.getUserInfo.homePath || PageEnum.BASE_HOME); return; } - // 页面刷新重新拉取用户信息数据 + // 页面刷新重新拉取用户信息数据(修改redis内多租户或切换用户角色会改变当前用户数据) if (userStore.getLastUpdateTime === 0) { try { await userStore.getUserInfoAction(); diff --git a/src/router/routes/demo/permission.ts b/src/router/routes/demo/permission.ts new file mode 100644 index 0000000..055ed64 --- /dev/null +++ b/src/router/routes/demo/permission.ts @@ -0,0 +1,35 @@ +import type { AppRouteModule } from '/@/router/types'; + +import { getParentLayout, LAYOUT } from '/@/router/constant'; +import { t } from '/@/hooks/web/useI18n'; + +const permission: AppRouteModule = { + path: '/permission', + name: 'Permission', + component: LAYOUT, + redirect: '/permission/front/page', + meta: { + icon: 'ion:key-outline', + title: t('routes.demo.permission.permission'), + }, + children: [ + { + path: 'page', + name: 'BackAuthPage', + component: () => import('/@/views/demo/permission/index.vue'), + meta: { + title: t('routes.demo.permission.backPage'), + }, + }, + { + path: 'btn', + name: 'BackAuthBtn', + component: () => import('/@/views/demo/permission/Btn.vue'), + meta: { + title: t('routes.demo.permission.backBtn'), + }, + }, + ], +}; + +export default permission; diff --git a/src/router/routes/modules/demoFeat.ts b/src/router/routes/modules/demoFeat.ts index 3df08a4..e89fe44 100644 --- a/src/router/routes/modules/demoFeat.ts +++ b/src/router/routes/modules/demoFeat.ts @@ -6,6 +6,7 @@ import feat from '../demo/feat'; import iframe from '../demo/iframe'; import level from '../demo/level'; import page from '../demo/page'; +import permission from '../demo/permission'; import setup from '../demo/setup'; import { isProdMode } from '/@/utils/env'; @@ -27,6 +28,7 @@ const demoFeat: AppRouteModule = { iframe, level, page, + permission, ], }; diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index bee6ce5..02ab444 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -10,7 +10,7 @@ import { store } from '/@/store'; import { PageEnum } from '/@/enums/pageEnum'; import { ACCESS_TOKEN_KEY, PERMISSIONS_KEY, REFRESH_TOKEN_KEY, ROLE_IDS_KEY, USER_INFO_KEY } from '/@/enums/cacheEnum'; import { getAuthCache, setAuthCache } from '/@/utils/auth'; -import { User, LoginParams } from '/@/api/platform/core/entity/user'; +import { UserVo, LoginParams } from '/@/api/platform/core/entity/user'; import { logout, getUserInfo, login } from '/@/api/platform/core/controller/user'; import { useI18n } from '/@/hooks/web/useI18n'; import { useMessage } from '/@/hooks/web/useMessage'; @@ -27,7 +27,7 @@ import { merge } from 'lodash-es'; import { RequestOptions } from '/#/axios'; interface UserState { - userInfo: Nullable; + userInfo: Nullable; sessionTimeout?: boolean; lastUpdateTime: number; roleIds: string[]; @@ -40,10 +40,10 @@ export const useUserStore = defineStore({ id: 'app-user', state: (): UserState => ({ // 用户信息 - userInfo: getAuthCache(USER_INFO_KEY), + userInfo: getAuthCache(USER_INFO_KEY), // 登录是否过期记录(确保下次登陆不刷新路由直接还原) sessionTimeout: false, - // 最后一次性更新用户信息时间 + // 最后一次性更新用户信息时间(用于页面刷新更新用户数据) lastUpdateTime: 0, // 角色ID用于权限校验 roleIds: getAuthCache(ROLE_IDS_KEY), @@ -55,7 +55,7 @@ export const useUserStore = defineStore({ refresh_token: getAuthCache(REFRESH_TOKEN_KEY), }), getters: { - getUserInfo(): User { + getUserInfo(): UserVo { return this.userInfo || {}; }, getAccessToken(): string { @@ -94,7 +94,7 @@ export const useUserStore = defineStore({ this.refresh_token = refreshToken; setAuthCache(REFRESH_TOKEN_KEY, refreshToken); }, - setUserInfo(userInfo: Nullable) { + setUserInfo(userInfo: Nullable) { this.userInfo = userInfo; this.lastUpdateTime = new Date().getTime(); setAuthCache(USER_INFO_KEY, userInfo); @@ -111,7 +111,7 @@ export const useUserStore = defineStore({ this.setPermissions([]); }, /** 登录 */ - async login(params: LoginParams): Promise { + async login(params: LoginParams): Promise { try { const { goHome = true, clientId = '', ...loginParams } = params; // 处理自定义授权客户端 @@ -134,7 +134,7 @@ export const useUserStore = defineStore({ } }, /** 登录成功后动作 */ - async afterLoginAction(goHome?: boolean): Promise { + async afterLoginAction(goHome?: boolean): Promise { if (!this.getAccessToken) return null; // 获取用户信息 const userInfo = await this.getUserInfoAction(); @@ -157,7 +157,7 @@ export const useUserStore = defineStore({ return userInfo; }, /** 获取用户信息 */ - async getUserInfoAction(): Promise { + async getUserInfoAction(): Promise { const { apiUrl } = useGlobSetting(); const { t } = useI18n(); try { @@ -167,7 +167,6 @@ export const useUserStore = defineStore({ ? userInfo.avatar : apiUrl + userInfo.avatar : await urlToBase64(defaultAvatar); - userInfo.tenantIds = String(userInfo.tenantId).split(','); // 存储用户扩展信息,便于鉴权 this.setUserInfo(userInfo); this.setRoleIds(userInfo.roleIds); diff --git a/src/utils/cache/persistent.ts b/src/utils/cache/persistent.ts index da58213..3a8ddb6 100644 --- a/src/utils/cache/persistent.ts +++ b/src/utils/cache/persistent.ts @@ -8,7 +8,7 @@ */ import type { LockInfo } from '/#/store'; -import type { User } from '/@/api/platform/core/entity/user'; +import type { UserVo } from '/@/api/platform/core/entity/user'; import type { ProjectConfig } from '/#/config'; import type { RouteLocationNormalized } from 'vue-router'; import { createLocalStorage, createSessionStorage } from '/@/utils/cache'; @@ -34,7 +34,7 @@ interface BasicStore { [REFRESH_TOKEN_KEY]: string | number | null | undefined; [ROLE_IDS_KEY]: string[]; [PERMISSIONS_KEY]: string[]; - [USER_INFO_KEY]: User; + [USER_INFO_KEY]: UserVo; [LOCK_INFO_KEY]: LockInfo; [PROJ_CFG_KEY]: ProjectConfig; [MULTIPLE_TABS_KEY]: RouteLocationNormalized[]; diff --git a/src/views/core/lock/LockPage.vue b/src/views/core/lock/LockPage.vue index e842dcd..04e31fe 100644 --- a/src/views/core/lock/LockPage.vue +++ b/src/views/core/lock/LockPage.vue @@ -88,7 +88,7 @@ import { useNow } from './useNow'; import { useDesign } from '/@/hooks/web/useDesign'; import { LockOutlined } from '@ant-design/icons-vue'; - import { User } from '/@/api/platform/core/entity/user'; + import { UserVo } from '/@/api/platform/core/entity/user'; import defaultAvatar from '/@/assets/images/defaultAvatar.svg'; const InputPassword = Input.Password; @@ -101,7 +101,7 @@ const userStore = useUserStore(); const { hour, month, minute, meridiem, year, day, week } = useNow(true); const { t } = useI18n(); - const userInfo = computed(() => { + const userInfo = computed(() => { return userStore.getUserInfo || {}; }); diff --git a/src/views/demo/permission/Btn.vue b/src/views/demo/permission/Btn.vue new file mode 100644 index 0000000..bab4fb8 --- /dev/null +++ b/src/views/demo/permission/Btn.vue @@ -0,0 +1,95 @@ + + + diff --git a/src/views/demo/permission/index.vue b/src/views/demo/permission/index.vue new file mode 100644 index 0000000..55fe6a1 --- /dev/null +++ b/src/views/demo/permission/index.vue @@ -0,0 +1,61 @@ + + + diff --git a/src/views/system/user/ResetPwdModal.vue b/src/views/system/user/ResetPwdModal.vue deleted file mode 100644 index 7b7630e..0000000 --- a/src/views/system/user/ResetPwdModal.vue +++ /dev/null @@ -1,96 +0,0 @@ - - - diff --git a/src/views/system/user/account/setting/UserInfo.vue b/src/views/system/user/account/setting/UserInfo.vue index 1b6be77..e794f4c 100644 --- a/src/views/system/user/account/setting/UserInfo.vue +++ b/src/views/system/user/account/setting/UserInfo.vue @@ -29,17 +29,18 @@ import { BasicForm, useForm } from '/@/components/Form/index'; import { CropperAvatar } from '/@/components/Cropper'; import { useMessage } from '/@/hooks/web/useMessage'; - import { editUser, getUser } from '/@/api/platform/system/controller/user'; + import { getUser } from '/@/api/platform/system/controller/user'; + import { updateSsoUserAndExUser } from '/@/api/platform/system/controller/ssoUser'; import { userFormSchema } from './data'; import { useUserStore } from '/@/store/modules/user'; import { commonUpload } from '/@/api/platform/core/controller/upload'; import { useContentHeight } from '/@/hooks/web/useContentHeight'; - import { User } from '/@/api/platform/core/entity/user'; + import { UserVo } from '/@/api/platform/core/entity/user'; import { isBase64image } from '/@/utils/is'; interface State { baseInfoBtnLoading: boolean; - userInfo: User | any; + userInfo: UserVo | any; } export default defineComponent({ components: { @@ -96,7 +97,7 @@ !isBase64image(state.userInfo.avatar) && (formData.avatar = state.userInfo.avatar); state.baseInfoBtnLoading = true; - await editUser(formData); + await updateSsoUserAndExUser(formData); createMessage.success('保存成功!'); await userStore.getUserInfoAction(); } finally { diff --git a/src/views/system/user/account/setting/data.ts b/src/views/system/user/account/setting/data.ts index 9a950d9..610dd86 100644 --- a/src/views/system/user/account/setting/data.ts +++ b/src/views/system/user/account/setting/data.ts @@ -34,6 +34,12 @@ export const userFormSchema: FormSchema[] = [ component: 'Input', show: false }, + { + field: 'casUserId', + label: 'cas用户ID', + component: 'Input', + show: false + }, { field: 'nickName', label: '用户昵称', diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index 7a4e22a..471806d 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -47,20 +47,12 @@ auth: ['user_del'], onClick: handleDel.bind(null, record) }]" - :dropDownActions="[ - { - label: '重置密码', - icon: 'fa6-brands:battle-net', - auth: ['user_reset'], - onClick: handleResetPassword.bind(null, record), - }]" /> - @@ -74,7 +66,6 @@ import { defineComponent, reactive, toRaw } from 'vue'; import { BasicTable, useTable, TableAction } from '/@/components/Table'; import { listUser, delUser } from '/@/api/platform/system/controller/user'; - import ResetPwdModal from './ResetPwdModal.vue'; import { PageWrapper } from '/@/components/Page'; import DeptTree from './DeptTree.vue'; import { useModal } from '/@/components/Modal'; @@ -98,7 +89,6 @@ DeptTree, TableAction, UserModal, - ResetPwdModal, }, setup() { @@ -115,7 +105,6 @@ }); const { createConfirm, createMessage } = useMessage(); const [registerModal, { openModal }] = useModal(); - const [registerResetPwdModal, { openModal: openResetPwdModal }] = useModal(); const [registerTable, { reload, clearSelectedRowKeys }] = useTable({ title: '用户列表', api: listUser, @@ -166,12 +155,6 @@ openModal(true, { _tag: 'edit', record }); } - /** 处理重置用户密码 */ - function handleResetPassword(record: Recordable) { - record = record || { id: toRaw(state.ids) }; - openResetPwdModal(true, { record }); - } - /** 删除按钮操作,行内删除 */ async function handleDel(record?: Recordable) { const ids = record?.id || toRaw(state.ids); @@ -203,14 +186,12 @@ state, registerTable, registerModal, - registerResetPwdModal, handleAdd, handleEdit, handleDel, handleSelectionChange, handleRefreshTable, handleSelect, - handleResetPassword, }; } }); diff --git a/src/views/system/user/sso/sso.data.ts b/src/views/system/user/sso/sso.data.ts index de2be52..9e98af4 100644 --- a/src/views/system/user/sso/sso.data.ts +++ b/src/views/system/user/sso/sso.data.ts @@ -160,10 +160,6 @@ export const userFormSchema: FormSchema[] = [ label: '邮箱', component: 'Input', rules: [ - { - required: true, - message: '请输入邮箱!', - }, { type: 'email', message: '请输入正确的邮箱地址!',