diff --git a/src/api/module/pmn.ts b/src/api/module/pmn.ts index 575bf80..59646a3 100644 --- a/src/api/module/pmn.ts +++ b/src/api/module/pmn.ts @@ -18,6 +18,8 @@ export interface MenuItem { children?: MenuItem[]; is_web_page?: boolean; // 是否为网页 web_url?: string; // 嵌入的网页URL + component?: string; // 路由文件地址 + is_new_tab?: boolean; // 是否在新窗口打开 } /** 获取菜单 */ diff --git a/src/api/module/user.ts b/src/api/module/user.ts index 0cd83d7..300b3a4 100644 --- a/src/api/module/user.ts +++ b/src/api/module/user.ts @@ -18,7 +18,7 @@ export const modifyUser = (data: UserItem) => request.post("/rbac2/v1/user/modif /** 删除用户 */ export const deleteUser = (data: { id: UserItem['id'] }) => request.post("/rbac2/v1/user/del", data); /** 获取所有权限【树形】 */ -export const getUserPmnTree = (data: { id: UserItem['id'] }) => request.post("/rbac2/v1/user/pmn_tree", data); +export const getUserPmnTree = (data: { id: UserItem['id'], workspace: string }) => request.post("/rbac2/v1/user/pmn_tree", data); /** 用户-获取所有权限【平面】 */ export const userPmn = (data: { id: UserItem['id'], workspace: string }) => request.post("/rbac2/v1/user/pmn", data, { needWorkspace: true }); @@ -39,3 +39,11 @@ export const resetUserPassword = (data: { /** 手机号 */ phone: string; }) => request.post("/rbac2/v1/reset", data); + +/** 管理员重置用户密码 */ +export const adminResetUserPassword = (data: { + /** 用户ID */ + id: number; + /** 新密码 */ + password: string; +}) => request.post("/rbac2/v1/user/reset_password", data); diff --git a/src/api/types.ts b/src/api/types.ts index ea4bbd0..d9604ed 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -15,12 +15,16 @@ export interface LoginData { /** 用户信息 */ export interface UserItem { id?: number + account?: string + name?: string username?: string nickname?: string email?: string phone?: string avatar?: string status?: number + role_id?: number + role_name?: string created_at?: string updated_at?: string } diff --git a/src/components/menu/index.vue b/src/components/menu/index.vue index ca57b1f..77d97bb 100644 --- a/src/components/menu/index.vue +++ b/src/components/menu/index.vue @@ -34,8 +34,8 @@ export default defineComponent({ const goto = (item: RouteRecordRaw) => { // Open external link - if (regexUrl.test(item.path)) { - openWindow(item.path) + if (regexUrl.test(item.path) || item.meta?.isNewTab) { + openWindow(`${window.location.origin}/#${item.path}`) selectedKey.value = [item.name as string] return } @@ -45,6 +45,7 @@ export default defineComponent({ selectedKey.value = [item.name as string] return } + console.log('item', item) // Trigger router change router.push({ name: item.name, @@ -114,14 +115,14 @@ export default defineComponent({ key={element?.name} v-slots={{ icon, - title: () => h(compile(t(element?.meta?.locale || ''))), + title: () => element?.meta?.locale, }} > {travel(element?.children)} ) : ( goto(element)}> - {t(element?.meta?.locale || '')} + {element?.meta?.locale} ) nodes.push(node as never) diff --git a/src/components/navbar/index.vue b/src/components/navbar/index.vue index d8a7502..42cc185 100644 --- a/src/components/navbar/index.vue +++ b/src/components/navbar/index.vue @@ -19,7 +19,7 @@ --> -
  • +
  • diff --git a/src/layout/default-layout.vue b/src/layout/default-layout.vue index f248751..8ff2405 100644 --- a/src/layout/default-layout.vue +++ b/src/layout/default-layout.vue @@ -1,13 +1,13 @@