diff --git a/ui/src/api/application-overview.ts b/ui/src/api/application-overview.ts index 361990193..940088353 100644 --- a/ui/src/api/application-overview.ts +++ b/ui/src/api/application-overview.ts @@ -1,5 +1,5 @@ import { Result } from '@/request/Result' -import { get, post, postStream, del, put } from '@/request/index' +import { get, post, del, put } from '@/request/index' import { type Ref } from 'vue' diff --git a/ui/src/api/log.ts b/ui/src/api/log.ts index 4c989b619..26f9245fe 100644 --- a/ui/src/api/log.ts +++ b/ui/src/api/log.ts @@ -1,5 +1,5 @@ import { Result } from '@/request/Result' -import { get, post, postStream, del, put } from '@/request/index' +import { get, post, del, put } from '@/request/index' import type { pageRequest } from '@/api/type/common' import { type Ref } from 'vue' diff --git a/ui/src/api/type/user.ts b/ui/src/api/type/user.ts index 6462354f8..04cbd4140 100644 --- a/ui/src/api/type/user.ts +++ b/ui/src/api/type/user.ts @@ -89,11 +89,11 @@ interface ResetPasswordRequest { /** * 邮箱 */ - email: string + email?: string /** * 验证码 */ - code: string + code?: string /** * 密码 */ diff --git a/ui/src/api/user-manage.ts b/ui/src/api/user-manage.ts new file mode 100644 index 000000000..ceed082b6 --- /dev/null +++ b/ui/src/api/user-manage.ts @@ -0,0 +1,77 @@ +import { Result } from '@/request/Result' +import { get, post, del, put } from '@/request/index' +import type { pageRequest } from '@/api/type/common' +import { type Ref } from 'vue' + +const prefix = '/user_manage' +/** + * 用户分页列表 + * @param 参数 + * page { + "current_page": "string", + "page_size": "string", + } + * @query 参数 + email_or_username: string + */ +const getUserManage: ( + page: pageRequest, + email_or_username: string, + loading?: Ref +) => Promise> = (page, email_or_username, loading) => { + return get( + `${prefix}/${page.current_page}/${page.page_size}`, + email_or_username ? { email_or_username } : undefined, + loading + ) +} + +/** + * 删除用户 + * @param 参数 user_id, + */ +const delUserManage: (user_id: string, loading?: Ref) => Promise> = ( + user_id, + loading +) => { + return del(`${prefix}/${user_id}`, undefined, {}, loading) +} + +/** + * 创建用户 + */ +const postUserManage: (data: any, loading?: Ref) => Promise> = ( + data, + loading +) => { + return post(`${prefix}`, data, undefined, loading) +} + +/** + * 编辑用户 + */ +const putUserManage: ( + user_id: string, + data: any, + loading?: Ref +) => Promise> = (user_id, data, loading) => { + return put(`${prefix}/${user_id}`, data, undefined, loading) +} +/** + * 修改用户密码 + */ +const putUserManagePassword: ( + user_id: string, + data: any, + loading?: Ref +) => Promise> = (user_id, data, loading) => { + return put(`${prefix}/${user_id}/re_password`, data, undefined, loading) +} + +export default { + getUserManage, + delUserManage, + postUserManage, + putUserManage, + putUserManagePassword +} diff --git a/ui/src/router/modules/setting.ts b/ui/src/router/modules/setting.ts index 2aa5a92b8..f37dbd491 100644 --- a/ui/src/router/modules/setting.ts +++ b/ui/src/router/modules/setting.ts @@ -3,20 +3,34 @@ const settingRouter = { path: '/setting', name: 'setting', meta: { icon: 'Setting', title: '系统设置', permission: 'SETTING:READ' }, - redirect: '/setting', + redirect: '/user', component: Layout, children: [ { - path: '/setting', - name: 'setting', + path: '/user', + name: 'user', + meta: { + icon: 'User', + iconActive: 'UserFilled', + title: '用户管理', + activeMenu: '/setting', + parentPath: '/setting', + parentName: 'setting' + }, + component: () => import('@/views/user-manage/index.vue') + }, + { + path: '/team', + name: 'team', meta: { icon: 'app-team', iconActive: 'app-team-active', title: '团队管理', + activeMenu: '/setting', parentPath: '/setting', parentName: 'setting' }, - component: () => import('@/views/setting/index.vue') + component: () => import('@/views/team/index.vue') }, { path: '/template', diff --git a/ui/src/views/setting/component/CreateMemberDialog.vue b/ui/src/views/team/component/CreateMemberDialog.vue similarity index 100% rename from ui/src/views/setting/component/CreateMemberDialog.vue rename to ui/src/views/team/component/CreateMemberDialog.vue diff --git a/ui/src/views/setting/component/PermissionSetting.vue b/ui/src/views/team/component/PermissionSetting.vue similarity index 99% rename from ui/src/views/setting/component/PermissionSetting.vue rename to ui/src/views/team/component/PermissionSetting.vue index a234318d6..19886dbe5 100644 --- a/ui/src/views/setting/component/PermissionSetting.vue +++ b/ui/src/views/team/component/PermissionSetting.vue @@ -144,3 +144,4 @@ onMounted(() => { }) +../utils \ No newline at end of file diff --git a/ui/src/views/setting/index.vue b/ui/src/views/team/index.vue similarity index 100% rename from ui/src/views/setting/index.vue rename to ui/src/views/team/index.vue diff --git a/ui/src/views/setting/utils.ts b/ui/src/views/team/utils.ts similarity index 100% rename from ui/src/views/setting/utils.ts rename to ui/src/views/team/utils.ts diff --git a/ui/src/views/user-manage/component/UserDialog.vue b/ui/src/views/user-manage/component/UserDialog.vue new file mode 100644 index 000000000..b39829fd7 --- /dev/null +++ b/ui/src/views/user-manage/component/UserDialog.vue @@ -0,0 +1,143 @@ + + + diff --git a/ui/src/views/user-manage/component/UserPwdDialog.vue b/ui/src/views/user-manage/component/UserPwdDialog.vue new file mode 100644 index 000000000..3be7f5e61 --- /dev/null +++ b/ui/src/views/user-manage/component/UserPwdDialog.vue @@ -0,0 +1,128 @@ + + + diff --git a/ui/src/views/user-manage/index.vue b/ui/src/views/user-manage/index.vue new file mode 100644 index 000000000..165d133e1 --- /dev/null +++ b/ui/src/views/user-manage/index.vue @@ -0,0 +1,155 @@ + + +