xto-fronted 0.2.6 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/.env.development +4 -0
  2. package/.env.production +4 -0
  3. package/README.md +94 -196
  4. package/dist/{components/Layout/TopMenu.vue.d.ts → App.vue.d.ts} +1 -1
  5. package/dist/api/auth.d.ts +8 -10
  6. package/dist/api/system.d.ts +11 -12
  7. package/dist/api/user.d.ts +12 -3
  8. package/dist/components/Layout/Footer.vue.d.ts +1 -1
  9. package/dist/components/Layout/Header.vue.d.ts +3 -14
  10. package/dist/components/Layout/Sidebar.vue.d.ts +1 -1
  11. package/dist/components/Layout/Tabs.vue.d.ts +1 -1
  12. package/dist/components/Layout/index.vue.d.ts +1 -1
  13. package/dist/composables/useAuth.d.ts +4 -19
  14. package/dist/directives/permission.d.ts +0 -1
  15. package/dist/index-CWRs4WMN.js +372 -0
  16. package/dist/index-CpxpXTQX.js +1462 -0
  17. package/dist/index-Cu3Z2-PY.js +345 -0
  18. package/dist/index-DPEVEyik.js +475 -0
  19. package/dist/index-DYnXaqYf.js +142 -0
  20. package/dist/index.d.ts +12 -25
  21. package/dist/index.es.js +76 -1521
  22. package/dist/index.umd.js +1 -20
  23. package/dist/main.d.ts +0 -1
  24. package/dist/router/dynamicRoutes.d.ts +33 -17
  25. package/dist/router/index.d.ts +4 -26
  26. package/dist/router/layoutRoute.d.ts +18 -0
  27. package/dist/router/staticRoutes.d.ts +2 -18
  28. package/dist/setup.d.ts +17 -0
  29. package/dist/stores/app.d.ts +15 -9
  30. package/dist/stores/auth.d.ts +48 -62
  31. package/dist/stores/index.d.ts +3 -1
  32. package/dist/stores/menu.d.ts +29 -47
  33. package/dist/stores/user.d.ts +84 -64
  34. package/dist/style.css +1 -1
  35. package/dist/utils/auth.d.ts +10 -10
  36. package/dist/utils/permission.d.ts +10 -1
  37. package/dist/utils/request.d.ts +7 -23
  38. package/dist/{components/Layout/Breadcrumb.vue.d.ts → views/dashboard/index.vue.d.ts} +1 -1
  39. package/dist/{components/Error → views/error}/403.vue.d.ts +1 -1
  40. package/dist/{components/Error → views/error}/404.vue.d.ts +1 -1
  41. package/dist/views/login/index.vue.d.ts +4 -0
  42. package/dist/views/system/menu/index.vue.d.ts +4 -0
  43. package/dist/views/system/role/index.vue.d.ts +4 -0
  44. package/dist/views/system/user/index.vue.d.ts +4 -0
  45. package/dist/vite.svg +9 -9
  46. package/index.html +13 -0
  47. package/package.json +27 -31
  48. package/public/vite.svg +10 -0
  49. package/src/App.vue +20 -0
  50. package/src/api/auth.ts +26 -0
  51. package/src/api/system.ts +65 -0
  52. package/src/api/user.ts +46 -0
  53. package/src/assets/styles/_dark.scss +407 -0
  54. package/src/assets/styles/_reset.scss +126 -0
  55. package/src/assets/styles/_root.scss +140 -0
  56. package/src/assets/styles/_transition.scss +119 -0
  57. package/src/assets/styles/_variables.scss +45 -0
  58. package/src/assets/styles/index.scss +187 -0
  59. package/src/components/Layout/Footer.vue +17 -0
  60. package/src/components/Layout/Header.vue +390 -0
  61. package/src/components/Layout/Sidebar.vue +297 -0
  62. package/src/components/Layout/Tabs.vue +134 -0
  63. package/src/components/Layout/index.vue +62 -0
  64. package/src/composables/useAuth.ts +45 -0
  65. package/src/composables/useForm.ts +79 -0
  66. package/src/composables/useTable.ts +97 -0
  67. package/src/directives/permission.ts +38 -0
  68. package/src/enums/index.ts +63 -0
  69. package/src/env.d.ts +17 -0
  70. package/src/index.ts +48 -0
  71. package/src/main.ts +34 -0
  72. package/src/router/dynamicRoutes.ts +163 -0
  73. package/src/router/index.ts +81 -0
  74. package/src/router/layoutRoute.ts +45 -0
  75. package/src/router/staticRoutes.ts +43 -0
  76. package/src/setup.ts +54 -0
  77. package/src/stores/app.ts +163 -0
  78. package/src/stores/auth.ts +66 -0
  79. package/src/stores/index.ts +15 -0
  80. package/src/stores/menu.ts +80 -0
  81. package/src/stores/user.ts +73 -0
  82. package/src/style.css +11 -0
  83. package/src/types/api.d.ts +84 -0
  84. package/src/types/global.d.ts +45 -0
  85. package/src/types/router.d.ts +48 -0
  86. package/src/types/xto.d.ts +149 -0
  87. package/src/utils/auth.ts +62 -0
  88. package/src/utils/permission.ts +42 -0
  89. package/src/utils/request.ts +124 -0
  90. package/src/utils/storage.ts +63 -0
  91. package/src/views/dashboard/index.vue +284 -0
  92. package/src/views/error/403.vue +57 -0
  93. package/src/views/error/404.vue +57 -0
  94. package/src/views/login/index.vue +248 -0
  95. package/src/views/system/menu/index.vue +381 -0
  96. package/src/views/system/role/index.vue +304 -0
  97. package/src/views/system/user/index.vue +327 -0
  98. package/tsconfig.json +26 -0
  99. package/tsconfig.node.json +11 -0
  100. package/vite.config.ts +140 -0
  101. package/dist/api/menu.d.ts +0 -4
  102. package/dist/components/Login/index.vue.d.ts +0 -25
  103. package/dist/components/SettingDrawer/index.vue.d.ts +0 -19
  104. package/dist/composables/index.d.ts +0 -8
  105. package/dist/composables/useApp.d.ts +0 -65
  106. package/dist/composables/useMenu.d.ts +0 -34
  107. package/dist/config/index.d.ts +0 -31
@@ -0,0 +1,4 @@
1
+ # 开发环境
2
+ VITE_APP_TITLE = Xto Demo - 开发环境
3
+ VITE_API_BASE_URL = /api
4
+ VITE_USE_MOCK = true
@@ -0,0 +1,4 @@
1
+ # 生产环境
2
+ VITE_APP_TITLE = Xto Demo
3
+ VITE_API_BASE_URL = /api
4
+ VITE_USE_MOCK = false
package/README.md CHANGED
@@ -1,197 +1,95 @@
1
- # Xto Demo
2
-
3
- 基于 xto 组件库的后台管理系统脚手架。
4
-
5
- ## 特性
6
-
7
- - 🚀 Vue 3 + TypeScript + Vite 5
8
- - 📦 Pinia 状态管理
9
- - 🛣️ Vue Router 4 动态路由
10
- - 🎨 xto 组件库
11
- - 🔐 权限管理(角色、按钮级别)
12
- - 🌓 亮色/暗色主题切换
13
- - 📱 响应式布局
14
-
15
- ## 安装
16
-
17
- ```bash
18
- # npm
19
- npm install xto-fronted
20
-
21
- # pnpm
22
- pnpm add xto-fronted
23
-
24
- # yarn
25
- yarn add xto-fronted
26
- ```
27
-
28
- ## 快速开始
29
-
30
- ```typescript
31
- // main.ts
32
- import { createApp } from 'vue'
33
- import { createPinia } from 'pinia'
34
- import App from './App.vue'
35
- import router from './router'
36
-
37
- // 初始化 xto-fronted
38
- import { createXtoApp } from 'xto-fronted'
39
-
40
- createXtoApp({
41
- appName: '我的应用',
42
- baseUrl: 'https://api.example.com',
43
- appId: 'MY-APP-ID',
44
- clientId: 'MY-CLIENT-ID',
45
- indexPath: '/dashboard',
46
- loginPath: '/login'
47
- })
48
-
49
- // 样式
50
- import 'xto-fronted/style.css'
51
- import '@xto/base/es/style.css'
52
- import '@xto/form/es/style.css'
53
- import '@xto/feedback/es/style.css'
54
- import '@xto/navigation/es/style.css'
55
-
56
- const app = createApp(App)
57
- app.use(createPinia())
58
- app.use(router)
59
- app.mount('#app')
60
- ```
61
-
62
- ```typescript
63
- // router/index.ts
64
- import { createRouter, createLayoutRoute, Login, NotFound } from 'xto-fronted'
65
-
66
- const businessRoutes = [
67
- {
68
- path: '/dashboard',
69
- name: 'Dashboard',
70
- component: () => import('@/views/dashboard/index.vue'),
71
- meta: { title: '仪表盘', icon: 'dashboard' }
72
- }
73
- ]
74
-
75
- const layoutRoute = createLayoutRoute(businessRoutes, { indexPath: '/dashboard' })
76
-
77
- const routes = [
78
- { path: '/login', name: 'Login', component: Login },
79
- layoutRoute,
80
- { path: '/:pathMatch(.*)*', redirect: '/404' }
81
- ]
82
-
83
- export default createRouter(routes)
84
- ```
85
-
86
- ```vue
87
- <!-- App.vue -->
88
- <script setup>
89
- import { useAppStore } from 'xto-fronted'
90
- const appStore = useAppStore()
91
- </script>
92
-
93
- <template>
94
- <div class="app" :class="{ dark: appStore.isDark }">
95
- <router-view />
96
- </div>
97
- </template>
98
- ```
99
-
100
- ## 示例项目
101
-
102
- 查看 [example](./example) 目录获取完整的示例项目。
103
-
104
- ```bash
105
- # 在根目录安装依赖(包含 example)
106
- pnpm install
107
-
108
- # 运行示例项目
109
- cd example
110
- pnpm dev
111
- ```
112
-
113
- ## 项目结构
114
-
115
- ```
116
- src/
117
- ├── api/ # API 接口
118
- ├── assets/ # 静态资源
119
- │ └── styles/ # 全局样式
120
- ├── components/ # 全局组件
121
- │ └── Layout/ # 布局组件
122
- ├── composables/ # 组合式函数
123
- ├── directives/ # 自定义指令
124
- ├── enums/ # 枚举常量
125
- ├── router/ # 路由配置
126
- ├── stores/ # Pinia 状态
127
- ├── types/ # 类型定义
128
- ├── utils/ # 工具函数
129
- └── views/ # 页面视图
130
- ```
131
-
132
- ## 开发
133
-
134
- ```bash
135
- # 安装依赖
136
- pnpm install
137
-
138
- # 启动开发服务器
139
- pnpm dev
140
-
141
- # 构建
142
- pnpm build
143
- ```
144
-
145
- ## 推送仓库
146
- ```bash
147
- pnpm install
148
-
149
- # 1. 构建(库模式)
150
- pnpm run build:lib
151
-
152
- # 2. 登录 npm(首次需要)
153
- npm login
154
-
155
- # 3. 发布
156
- npm publish
157
- ```
158
- ## 功能模块
159
-
160
- - [x] 登录/登出
161
- - [x] 动态路由
162
- - [x] 侧边栏菜单
163
- - [x] 顶部导航/面包屑
164
- - [x] 标签页缓存
165
- - [x] 仪表盘
166
- - [x] 用户管理 CRUD
167
- - [x] 角色管理
168
- - [x] 菜单管理
169
- - [x] 主题切换
170
- - [x] 权限控制
171
-
172
- ## Mock 数据
173
-
174
- 项目使用本地 Mock 数据,可直接登录测试:
175
-
176
- - 用户名:任意
177
- - 密码:任意
178
-
179
- ## 技术栈
180
-
181
- | 技术 | 版本 |
182
- |------|------|
183
- | Vue | 3.4+ |
184
- | TypeScript | 5.4+ |
185
- | Vite | 5.x |
186
- | Vue Router | 4.x |
187
- | Pinia | 2.x |
188
- | Axios | 1.x |
189
- | xto | npm |
190
-
191
- ## 更新日志
192
-
193
- 查看 [CHANGELOG.md](./CHANGELOG.md) 获取版本更新记录。
194
-
195
- ## License
196
-
1
+ # Xto Demo
2
+
3
+ 基于 xto 组件库的后台管理系统脚手架。
4
+
5
+ ## 特性
6
+
7
+ - 🚀 Vue 3 + TypeScript + Vite 5
8
+ - 📦 Pinia 状态管理
9
+ - 🛣️ Vue Router 4 动态路由
10
+ - 🎨 xto 组件库
11
+ - 🔐 权限管理(角色、按钮级别)
12
+ - 🌓 亮色/暗色主题切换
13
+ - 📱 响应式布局
14
+
15
+ ## 项目结构
16
+
17
+ ```
18
+ src/
19
+ ├── api/ # API 接口
20
+ ├── assets/ # 静态资源
21
+ │ └── styles/ # 全局样式
22
+ ├── components/ # 全局组件
23
+ │ └── Layout/ # 布局组件
24
+ ├── composables/ # 组合式函数
25
+ ├── directives/ # 自定义指令
26
+ ├── enums/ # 枚举常量
27
+ ├── router/ # 路由配置
28
+ ├── stores/ # Pinia 状态
29
+ ├── types/ # 类型定义
30
+ ├── utils/ # 工具函数
31
+ └── views/ # 页面视图
32
+ ```
33
+
34
+ ## 开发
35
+
36
+ ```bash
37
+ # 安装依赖
38
+ pnpm install
39
+
40
+ # 启动开发服务器
41
+ pnpm dev
42
+
43
+ # 构建
44
+ pnpm build
45
+ ```
46
+
47
+ ## 推送仓库
48
+ ```bash
49
+ pnpm install
50
+
51
+ # 1. 构建(库模式)
52
+ pnpm run build:lib
53
+
54
+ # 2. 登录 npm(首次需要)
55
+ npm login
56
+
57
+ # 3. 发布
58
+ npm publish
59
+ ```
60
+ ## 功能模块
61
+
62
+ - [x] 登录/登出
63
+ - [x] 动态路由
64
+ - [x] 侧边栏菜单
65
+ - [x] 顶部导航/面包屑
66
+ - [x] 标签页缓存
67
+ - [x] 仪表盘
68
+ - [x] 用户管理 CRUD
69
+ - [x] 角色管理
70
+ - [x] 菜单管理
71
+ - [x] 主题切换
72
+ - [x] 权限控制
73
+
74
+ ## Mock 数据
75
+
76
+ 项目使用本地 Mock 数据,可直接登录测试:
77
+
78
+ - 用户名:任意
79
+ - 密码:任意
80
+
81
+ ## 技术栈
82
+
83
+ | 技术 | 版本 |
84
+ |------|------|
85
+ | Vue | 3.4+ |
86
+ | TypeScript | 5.4+ |
87
+ | Vite | 5.x |
88
+ | Vue Router | 4.x |
89
+ | Pinia | 2.x |
90
+ | Axios | 1.x |
91
+ | xto | npm |
92
+
93
+ ## License
94
+
197
95
  MIT
@@ -1,2 +1,2 @@
1
- declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
1
+ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
2
2
  export default _default;
@@ -1,10 +1,8 @@
1
- import { ApiResponse } from '../utils/request';
2
- import { LoginResult } from '../types/api';
3
-
4
- export interface LoginParams {
5
- uid: string;
6
- password: string;
7
- }
8
- export declare function login(data: LoginParams): Promise<ApiResponse<LoginResult>>;
9
- export declare function logout(): Promise<ApiResponse<null>>;
10
- export declare function loginByCode(appId: string, code: string): Promise<ApiResponse<LoginResult>>;
1
+ import { LoginParams, LoginResult, UserInfo } from '../types/api';
2
+ export declare function login(data: LoginParams): Promise<LoginResult>;
3
+ export declare function logout(): Promise<unknown>;
4
+ export declare function getUserInfo(): Promise<UserInfo>;
5
+ export declare function refreshToken(refreshToken: string): Promise<{
6
+ token: string;
7
+ expireTime: number;
8
+ }>;
@@ -1,17 +1,16 @@
1
1
  import { PageParams, PageResponse } from '../utils/request';
2
2
  import { RoleInfo, MenuItem } from '../types/api';
3
-
4
3
  export declare function getRoleList(params: PageParams & {
5
4
  status?: number;
6
5
  keyword?: string;
7
- }): Promise<import('../utils/request').ApiResponse<PageResponse<RoleInfo>>>;
8
- export declare function getRoleDetail(id: string | number): Promise<import('../utils/request').ApiResponse<RoleInfo>>;
9
- export declare function createRole(data: Partial<RoleInfo>): Promise<import('../utils/request').ApiResponse<RoleInfo>>;
10
- export declare function updateRole(id: string | number, data: Partial<RoleInfo>): Promise<import('../utils/request').ApiResponse<RoleInfo>>;
11
- export declare function deleteRole(id: string | number): Promise<import('../utils/request').ApiResponse<unknown>>;
12
- export declare function updateRoleStatus(id: string | number, status: number): Promise<import('../utils/request').ApiResponse<unknown>>;
13
- export declare function getMenuList(): Promise<import('../utils/request').ApiResponse<MenuItem[]>>;
14
- export declare function getMenuTree(): Promise<import('../utils/request').ApiResponse<MenuItem[]>>;
15
- export declare function createMenu(data: Partial<MenuItem>): Promise<import('../utils/request').ApiResponse<MenuItem>>;
16
- export declare function updateMenu(id: string | number, data: Partial<MenuItem>): Promise<import('../utils/request').ApiResponse<MenuItem>>;
17
- export declare function deleteMenu(id: string | number): Promise<import('../utils/request').ApiResponse<unknown>>;
6
+ }): Promise<PageResponse<RoleInfo>>;
7
+ export declare function getRoleDetail(id: string | number): Promise<RoleInfo>;
8
+ export declare function createRole(data: Partial<RoleInfo>): Promise<RoleInfo>;
9
+ export declare function updateRole(id: string | number, data: Partial<RoleInfo>): Promise<RoleInfo>;
10
+ export declare function deleteRole(id: string | number): Promise<unknown>;
11
+ export declare function updateRoleStatus(id: string | number, status: number): Promise<unknown>;
12
+ export declare function getMenuList(): Promise<MenuItem[]>;
13
+ export declare function getMenuTree(): Promise<MenuItem[]>;
14
+ export declare function createMenu(data: Partial<MenuItem>): Promise<MenuItem>;
15
+ export declare function updateMenu(id: string | number, data: Partial<MenuItem>): Promise<MenuItem>;
16
+ export declare function deleteMenu(id: string | number): Promise<unknown>;
@@ -1,4 +1,13 @@
1
- import { ApiResponse } from '../utils/request';
1
+ import { PageParams, PageResponse } from '../utils/request';
2
2
  import { UserInfo } from '../types/api';
3
-
4
- export declare function getCurrentUser(): Promise<ApiResponse<UserInfo>>;
3
+ export declare function getUserList(params: PageParams & {
4
+ status?: number;
5
+ keyword?: string;
6
+ }): Promise<PageResponse<UserInfo>>;
7
+ export declare function getUserDetail(id: string | number): Promise<UserInfo>;
8
+ export declare function createUser(data: Partial<UserInfo>): Promise<UserInfo>;
9
+ export declare function updateUser(id: string | number, data: Partial<UserInfo>): Promise<UserInfo>;
10
+ export declare function deleteUser(id: string | number): Promise<unknown>;
11
+ export declare function batchDeleteUsers(ids: (string | number)[]): Promise<unknown>;
12
+ export declare function updateUserStatus(id: string | number, status: number): Promise<unknown>;
13
+ export declare function resetPassword(id: string | number): Promise<unknown>;
@@ -1,2 +1,2 @@
1
- declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
1
+ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
2
2
  export default _default;
@@ -1,15 +1,4 @@
1
- declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
2
- showCollapse?: boolean;
3
- }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
4
- showCollapse?: boolean;
5
- }>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
1
+ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
2
+ dropdownRef: HTMLDivElement;
3
+ }, HTMLDivElement>;
6
4
  export default _default;
7
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
8
- type __VLS_TypePropsToRuntimeProps<T> = {
9
- [K in keyof T]-?: {} extends Pick<T, K> ? {
10
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
11
- } : {
12
- type: import('vue').PropType<T[K]>;
13
- required: true;
14
- };
15
- };
@@ -1,2 +1,2 @@
1
- declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
1
+ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
1
+ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
1
+ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
2
2
  export default _default;
@@ -1,24 +1,9 @@
1
1
  /**
2
- * 权限 Hook
3
- * 封装权限检查、按钮权限等逻辑
2
+ * 权限组合函数
4
3
  */
5
4
  export declare function useAuth(): {
6
- isLoggedIn: import('vue').ComputedRef<boolean>;
7
- userName: import('vue').ComputedRef<string>;
8
- userInfo: import('vue').ComputedRef<{
9
- uId: string;
10
- appId: string;
11
- userId: string;
12
- userName: string;
13
- departmentName?: string | undefined;
14
- email?: string | undefined;
15
- mobilePhone?: string | undefined;
16
- positionName?: string | undefined;
17
- avatar?: string | undefined;
18
- workNo?: string | undefined;
19
- } | null>;
20
5
  hasPermission: (permission: string | string[]) => boolean;
21
- hasAnyPermission: (permissions: string[]) => boolean;
22
- hasAllPermissions: (permissions: string[]) => boolean;
23
- getCurrentPagePermissions: () => string[];
6
+ hasRole: (role: string | string[]) => boolean;
7
+ isAdmin: import('vue').ComputedRef<boolean>;
8
+ isLoggedIn: import('vue').ComputedRef<boolean>;
24
9
  };
@@ -1,5 +1,4 @@
1
1
  import { Directive } from 'vue';
2
-
3
2
  declare const permission: Directive;
4
3
  export default permission;
5
4
  export declare function setupPermissionDirective(app: any): void;