xto-fronted 0.1.1 → 0.1.3

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 (67) hide show
  1. package/.env.development +3 -4
  2. package/.env.production +3 -4
  3. package/bin/cli.js +104 -0
  4. package/dist/{403-MQkNUulz.js → 403-DM5wfQkM.js} +6 -6
  5. package/dist/{404-BOFYLq4X.js → 404-BurAu5LC.js} +7 -7
  6. package/dist/api/auth.d.ts +9 -8
  7. package/dist/api/menu.d.ts +3 -0
  8. package/dist/api/user.d.ts +2 -12
  9. package/dist/composables/index.d.ts +8 -0
  10. package/dist/composables/useApp.d.ts +64 -0
  11. package/dist/composables/useAuth.d.ts +19 -4
  12. package/dist/composables/useMenu.d.ts +34 -0
  13. package/dist/config/index.d.ts +11 -0
  14. package/dist/index-BNiEld34.js +15 -0
  15. package/dist/index-Be9RiEfo.js +98 -0
  16. package/dist/index-BqRv1bdN.js +1185 -0
  17. package/dist/index-CQLVXvNJ.js +15 -0
  18. package/dist/index-CyiE8n2V.js +15 -0
  19. package/dist/index-xauR1bOL.js +15 -0
  20. package/dist/index.d.ts +7 -4
  21. package/dist/index.es.js +50 -66
  22. package/dist/index.umd.js +1 -1
  23. package/dist/stores/auth.d.ts +60 -23
  24. package/dist/stores/menu.d.ts +40 -29
  25. package/dist/stores/user.d.ts +63 -84
  26. package/dist/style.css +1 -1
  27. package/dist/utils/auth.d.ts +15 -7
  28. package/dist/utils/permission.d.ts +1 -6
  29. package/dist/views/system/menu/index.vue.d.ts +1 -3
  30. package/dist/views/system/role/index.vue.d.ts +1 -3
  31. package/dist/views/system/user/index.vue.d.ts +1 -3
  32. package/package.json +27 -19
  33. package/src/api/auth.ts +34 -25
  34. package/src/api/menu.ts +13 -0
  35. package/src/api/user.ts +11 -45
  36. package/src/components/Layout/Header.vue +334 -389
  37. package/src/components/Layout/Sidebar.vue +212 -296
  38. package/src/components/Layout/Tabs.vue +19 -133
  39. package/src/composables/index.ts +9 -0
  40. package/src/composables/useApp.ts +170 -0
  41. package/src/composables/useAuth.ts +69 -44
  42. package/src/composables/useMenu.ts +141 -0
  43. package/src/config/index.ts +19 -0
  44. package/src/directives/permission.ts +40 -37
  45. package/src/index.ts +9 -4
  46. package/src/router/index.ts +70 -80
  47. package/src/stores/auth.ts +44 -31
  48. package/src/stores/menu.ts +157 -79
  49. package/src/stores/user.ts +40 -72
  50. package/src/types/api.d.ts +102 -83
  51. package/src/types/xto.d.ts +148 -148
  52. package/src/utils/auth.ts +85 -61
  53. package/src/utils/permission.ts +29 -41
  54. package/src/utils/request.ts +125 -125
  55. package/src/utils/storage.ts +10 -1
  56. package/src/views/dashboard/index.vue +31 -283
  57. package/src/views/login/index.vue +140 -247
  58. package/src/views/system/menu/index.vue +31 -380
  59. package/src/views/system/role/index.vue +31 -303
  60. package/src/views/system/user/index.vue +31 -326
  61. package/vite.config.ts +3 -3
  62. package/dist/index-BJxYdNPy.js +0 -475
  63. package/dist/index-BvnIIBR1.js +0 -142
  64. package/dist/index-CEvAq6KE.js +0 -372
  65. package/dist/index-DPkqej__.js +0 -345
  66. package/dist/index-pq9Z5K62.js +0 -184
  67. package/dist/index-vVfjShJR.js +0 -1183
package/src/api/user.ts CHANGED
@@ -1,46 +1,12 @@
1
- /**
2
- * 用户 API
3
- */
4
-
5
- import { http, type PageParams, type PageResponse } from '@/utils/request'
6
- import type { UserInfo } from '@/types/api'
7
-
8
- // 获取用户列表
9
- export function getUserList(params: PageParams & { status?: number; keyword?: string }) {
10
- return http.get<PageResponse<UserInfo>>('/user/list', { params })
11
- }
12
-
13
- // 获取用户详情
14
- export function getUserDetail(id: string | number) {
15
- return http.get<UserInfo>(`/user/${id}`)
16
- }
17
-
18
- // 创建用户
19
- export function createUser(data: Partial<UserInfo>) {
20
- return http.post<UserInfo>('/user', data)
21
- }
22
-
23
- // 更新用户
24
- export function updateUser(id: string | number, data: Partial<UserInfo>) {
25
- return http.put<UserInfo>(`/user/${id}`, data)
26
- }
27
-
28
- // 删除用户
29
- export function deleteUser(id: string | number) {
30
- return http.delete(`/user/${id}`)
31
- }
32
-
33
- // 批量删除用户
34
- export function batchDeleteUsers(ids: (string | number)[]) {
35
- return http.post('/user/batch-delete', { ids })
36
- }
37
-
38
- // 更新用户状态
39
- export function updateUserStatus(id: string | number, status: number) {
40
- return http.patch(`/user/${id}/status`, { status })
41
- }
42
-
43
- // 重置密码
44
- export function resetPassword(id: string | number) {
45
- return http.post(`/user/${id}/reset-password`)
1
+ /**
2
+ * 用户 API
3
+ */
4
+
5
+ import { http } from '@/utils/request'
6
+ import type { ApiResponse } from '@/utils/request'
7
+ import type { UserInfo } from '@/types/api'
8
+
9
+ // 获取当前用户信息
10
+ export function getCurrentUser(): Promise<ApiResponse<UserInfo>> {
11
+ return http.get<UserInfo>('/user/v1.0/user/get-me')
46
12
  }