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.
- package/.env.development +3 -4
- package/.env.production +3 -4
- package/bin/cli.js +104 -0
- package/dist/{403-MQkNUulz.js → 403-DM5wfQkM.js} +6 -6
- package/dist/{404-BOFYLq4X.js → 404-BurAu5LC.js} +7 -7
- package/dist/api/auth.d.ts +9 -8
- package/dist/api/menu.d.ts +3 -0
- package/dist/api/user.d.ts +2 -12
- package/dist/composables/index.d.ts +8 -0
- package/dist/composables/useApp.d.ts +64 -0
- package/dist/composables/useAuth.d.ts +19 -4
- package/dist/composables/useMenu.d.ts +34 -0
- package/dist/config/index.d.ts +11 -0
- package/dist/index-BNiEld34.js +15 -0
- package/dist/index-Be9RiEfo.js +98 -0
- package/dist/index-BqRv1bdN.js +1185 -0
- package/dist/index-CQLVXvNJ.js +15 -0
- package/dist/index-CyiE8n2V.js +15 -0
- package/dist/index-xauR1bOL.js +15 -0
- package/dist/index.d.ts +7 -4
- package/dist/index.es.js +50 -66
- package/dist/index.umd.js +1 -1
- package/dist/stores/auth.d.ts +60 -23
- package/dist/stores/menu.d.ts +40 -29
- package/dist/stores/user.d.ts +63 -84
- package/dist/style.css +1 -1
- package/dist/utils/auth.d.ts +15 -7
- package/dist/utils/permission.d.ts +1 -6
- package/dist/views/system/menu/index.vue.d.ts +1 -3
- package/dist/views/system/role/index.vue.d.ts +1 -3
- package/dist/views/system/user/index.vue.d.ts +1 -3
- package/package.json +27 -19
- package/src/api/auth.ts +34 -25
- package/src/api/menu.ts +13 -0
- package/src/api/user.ts +11 -45
- package/src/components/Layout/Header.vue +334 -389
- package/src/components/Layout/Sidebar.vue +212 -296
- package/src/components/Layout/Tabs.vue +19 -133
- package/src/composables/index.ts +9 -0
- package/src/composables/useApp.ts +170 -0
- package/src/composables/useAuth.ts +69 -44
- package/src/composables/useMenu.ts +141 -0
- package/src/config/index.ts +19 -0
- package/src/directives/permission.ts +40 -37
- package/src/index.ts +9 -4
- package/src/router/index.ts +70 -80
- package/src/stores/auth.ts +44 -31
- package/src/stores/menu.ts +157 -79
- package/src/stores/user.ts +40 -72
- package/src/types/api.d.ts +102 -83
- package/src/types/xto.d.ts +148 -148
- package/src/utils/auth.ts +85 -61
- package/src/utils/permission.ts +29 -41
- package/src/utils/request.ts +125 -125
- package/src/utils/storage.ts +10 -1
- package/src/views/dashboard/index.vue +31 -283
- package/src/views/login/index.vue +140 -247
- package/src/views/system/menu/index.vue +31 -380
- package/src/views/system/role/index.vue +31 -303
- package/src/views/system/user/index.vue +31 -326
- package/vite.config.ts +3 -3
- package/dist/index-BJxYdNPy.js +0 -475
- package/dist/index-BvnIIBR1.js +0 -142
- package/dist/index-CEvAq6KE.js +0 -372
- package/dist/index-DPkqej__.js +0 -345
- package/dist/index-pq9Z5K62.js +0 -184
- 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
|
|
6
|
-
import type {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
}
|