xto-fronted 0.4.7 → 0.4.8

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 (75) hide show
  1. package/.env.development +7 -7
  2. package/.env.production +7 -7
  3. package/dist/assets/403-AFBQifUI.js +1 -0
  4. package/dist/assets/403-BHEXXbt2.css +1 -0
  5. package/dist/assets/404-Ct_A1n7S.css +1 -0
  6. package/dist/assets/404-WFvpcD2_.js +1 -0
  7. package/dist/assets/_plugin-vue_export-helper-DlAUqK2U.js +1 -0
  8. package/dist/assets/index-1juADvYN.js +2 -0
  9. package/dist/assets/index-B-sX4Ru0.js +1 -0
  10. package/dist/assets/index-BMcziU5a.css +1 -0
  11. package/dist/assets/index-BRR97dc6.js +1 -0
  12. package/dist/assets/index-BZA0ksjx.css +1 -0
  13. package/dist/assets/index-BpV_8nl0.js +1 -0
  14. package/dist/assets/index-BvzhR4zp.js +1 -0
  15. package/dist/assets/index-CUh_s55Z.css +1 -0
  16. package/dist/assets/index-CVjdnIgR.css +1 -0
  17. package/dist/assets/index-CYq57-zj.js +1 -0
  18. package/dist/assets/index-CkL3sVAQ.js +2 -0
  19. package/dist/assets/index-CtrKVYJb.css +1 -0
  20. package/dist/assets/index-Cz2P_bsS.js +1 -0
  21. package/dist/assets/index-D9wlAuR_.js +1 -0
  22. package/dist/assets/index-DawJb02s.css +1 -0
  23. package/dist/assets/index-DfFR6NLf.js +1 -0
  24. package/dist/assets/index-DwVgMO8e.js +1 -0
  25. package/dist/assets/index-GDP-IkXE.css +1 -0
  26. package/dist/assets/index-Iaz1ZzPC.js +2 -0
  27. package/dist/assets/index-PfV8pzQz.css +1 -0
  28. package/dist/assets/index-Swfu6yvD.css +1 -0
  29. package/dist/assets/index-Te8_PRgJ.js +1 -0
  30. package/dist/assets/index-WyZ91RLx.css +1 -0
  31. package/dist/assets/index-tFYRoFdE.js +1 -0
  32. package/dist/assets/vendor-42ANG6Sg.js +6 -0
  33. package/dist/assets/vite-Dw-pgLOX.js +1 -0
  34. package/dist/assets/vue-vendor-Br-l7wbK.js +29 -0
  35. package/dist/assets/xto-base-C-IBqjVs.js +1 -0
  36. package/dist/assets/xto-base-C6eqMPdO.css +1 -0
  37. package/dist/assets/xto-business--V1F5Gwb.css +1 -0
  38. package/dist/assets/xto-core-DZK7Cyg0.js +1 -0
  39. package/dist/assets/xto-data-BFpiDgJi.js +1 -0
  40. package/dist/assets/xto-data-CnAQAQH2.css +1 -0
  41. package/dist/assets/xto-feedback-B7ipsTfz.js +1 -0
  42. package/dist/assets/xto-feedback-DBwJzoTj.css +1 -0
  43. package/dist/assets/xto-form-CrsyAjyr.css +1 -0
  44. package/dist/assets/xto-form-NRjKKNcY.js +1 -0
  45. package/dist/assets/xto-layout-BqU8RuWL.css +1 -0
  46. package/dist/assets/xto-navigation-BiSaXPfr.js +1 -0
  47. package/dist/assets/xto-navigation-C1cnSL2E.css +1 -0
  48. package/dist/assets/xto-navigation-CBPg4dCc.css +1 -0
  49. package/dist/assets/xto-navigation-CKabFu9d.js +1 -0
  50. package/dist/index.html +28 -0
  51. package/package.json +85 -85
  52. package/src/api/auth.ts +25 -25
  53. package/src/api/system.ts +66 -66
  54. package/src/assets/styles/_dark.scss +406 -406
  55. package/src/components/Layout/Header.vue +973 -973
  56. package/src/components/Layout/Sidebar.vue +273 -273
  57. package/src/components/Layout/index.vue +443 -63
  58. package/src/composables/useApp.ts +61 -61
  59. package/src/composables/useAuth.ts +16 -16
  60. package/src/directives/permission.ts +27 -27
  61. package/src/env.d.ts +18 -18
  62. package/src/index.ts +47 -47
  63. package/src/router/dynamicRoutes.ts +162 -162
  64. package/src/router/guards.ts +128 -128
  65. package/src/router/index.ts +79 -79
  66. package/src/stores/auth.ts +65 -65
  67. package/src/stores/menu.ts +48 -48
  68. package/src/stores/user.ts +50 -50
  69. package/src/types/api.d.ts +80 -80
  70. package/src/utils/auth.ts +99 -99
  71. package/src/utils/config.ts +80 -80
  72. package/src/utils/permission.ts +32 -32
  73. package/src/utils/request.ts +124 -124
  74. package/src/views/login/index.vue +194 -194
  75. package/vite.config.ts +135 -135
@@ -0,0 +1,28 @@
1
+ <!DOCTYPE html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Xto Demo - 后台管理系统</title>
8
+ <script type="module" crossorigin src="/assets/index-1juADvYN.js"></script>
9
+ <link rel="modulepreload" crossorigin href="/assets/vue-vendor-Br-l7wbK.js">
10
+ <link rel="modulepreload" crossorigin href="/assets/xto-core-DZK7Cyg0.js">
11
+ <link rel="modulepreload" crossorigin href="/assets/xto-base-C-IBqjVs.js">
12
+ <link rel="modulepreload" crossorigin href="/assets/xto-form-NRjKKNcY.js">
13
+ <link rel="modulepreload" crossorigin href="/assets/xto-data-BFpiDgJi.js">
14
+ <link rel="modulepreload" crossorigin href="/assets/xto-feedback-B7ipsTfz.js">
15
+ <link rel="modulepreload" crossorigin href="/assets/xto-navigation-BiSaXPfr.js">
16
+ <link rel="stylesheet" crossorigin href="/assets/xto-base-C6eqMPdO.css">
17
+ <link rel="stylesheet" crossorigin href="/assets/xto-form-CrsyAjyr.css">
18
+ <link rel="stylesheet" crossorigin href="/assets/xto-data-CnAQAQH2.css">
19
+ <link rel="stylesheet" crossorigin href="/assets/xto-feedback-DBwJzoTj.css">
20
+ <link rel="stylesheet" crossorigin href="/assets/xto-navigation-C1cnSL2E.css">
21
+ <link rel="stylesheet" crossorigin href="/assets/index-BZA0ksjx.css">
22
+ <link rel="stylesheet" crossorigin href="/assets/xto-layout-BqU8RuWL.css">
23
+ <link rel="stylesheet" crossorigin href="/assets/xto-business--V1F5Gwb.css">
24
+ </head>
25
+ <body>
26
+ <div id="app"></div>
27
+ </body>
28
+ </html>
package/package.json CHANGED
@@ -1,85 +1,85 @@
1
- {
2
- "name": "xto-fronted",
3
- "version": "0.4.7",
4
- "private": false,
5
- "type": "module",
6
- "description": "XTO 前端应用框架",
7
- "main": "dist/index.umd.js",
8
- "module": "dist/index.es.js",
9
- "types": "dist/index.d.ts",
10
- "exports": {
11
- ".": {
12
- "import": "./dist/index.es.js",
13
- "require": "./dist/index.umd.js",
14
- "types": "./dist/index.d.ts"
15
- },
16
- "./style.css": "./dist/style.css"
17
- },
18
- "files": [
19
- "dist",
20
- "src",
21
- "public",
22
- "index.html",
23
- "vite.config.ts",
24
- "tsconfig.json",
25
- "tsconfig.node.json",
26
- ".env.development",
27
- ".env.production"
28
- ],
29
- "scripts": {
30
- "dev": "vite",
31
- "build": "vue-tsc && vite build",
32
- "build:lib": "vue-tsc && vite build --mode lib",
33
- "preview": "vite preview",
34
- "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix"
35
- },
36
- "peerDependencies": {
37
- "@xto/base": "^1.3.0",
38
- "@xto/business": "^1.1.0",
39
- "@xto/core": "^1.0.2",
40
- "@xto/data": "^1.1.1",
41
- "@xto/feedback": "^1.1.3",
42
- "@xto/form": "^1.1.2",
43
- "@xto/layout": "^1.0.5",
44
- "@xto/navigation": "^1.2.1",
45
- "axios": "^1.6.0",
46
- "pinia": "^2.1.0",
47
- "vue": "^3.4.0",
48
- "vue-router": "^4.3.0"
49
- },
50
- "devDependencies": {
51
- "@types/node": "^20.11.30",
52
- "@vitejs/plugin-vue": "^5.0.4",
53
- "@xto/base": "^1.3.2",
54
- "@xto/business": "^1.1.0",
55
- "@xto/core": "^1.0.2",
56
- "@xto/data": "^1.1.1",
57
- "@xto/feedback": "^1.1.3",
58
- "@xto/form": "^1.1.2",
59
- "@xto/layout": "^1.0.5",
60
- "@xto/navigation": "^1.2.1",
61
- "axios": "^1.6.8",
62
- "pinia": "^2.1.7",
63
- "sass": "^1.72.0",
64
- "sass-embedded": "^1.72.0",
65
- "typescript": "^5.4.2",
66
- "vite": "^5.2.0",
67
- "vite-plugin-dts": "^4.5.4",
68
- "vue": "^3.4.21",
69
- "vue-router": "^4.3.0",
70
- "vue-tsc": "^2.0.6"
71
- },
72
- "keywords": [
73
- "vue",
74
- "vue3",
75
- "admin",
76
- "template",
77
- "xto"
78
- ],
79
- "author": "",
80
- "license": "MIT",
81
- "repository": {
82
- "type": "git",
83
- "url": ""
84
- }
85
- }
1
+ {
2
+ "name": "xto-fronted",
3
+ "version": "0.4.8",
4
+ "private": false,
5
+ "type": "module",
6
+ "description": "XTO 前端应用框架",
7
+ "main": "dist/index.umd.js",
8
+ "module": "dist/index.es.js",
9
+ "types": "dist/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "import": "./dist/index.es.js",
13
+ "require": "./dist/index.umd.js",
14
+ "types": "./dist/index.d.ts"
15
+ },
16
+ "./style.css": "./dist/style.css"
17
+ },
18
+ "files": [
19
+ "dist",
20
+ "src",
21
+ "public",
22
+ "index.html",
23
+ "vite.config.ts",
24
+ "tsconfig.json",
25
+ "tsconfig.node.json",
26
+ ".env.development",
27
+ ".env.production"
28
+ ],
29
+ "scripts": {
30
+ "dev": "vite",
31
+ "build": "vue-tsc && vite build",
32
+ "build:lib": "vue-tsc && vite build --mode lib",
33
+ "preview": "vite preview",
34
+ "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix"
35
+ },
36
+ "peerDependencies": {
37
+ "@xto/base": "^1.3.0",
38
+ "@xto/business": "^1.1.0",
39
+ "@xto/core": "^1.0.2",
40
+ "@xto/data": "^1.1.1",
41
+ "@xto/feedback": "^1.1.3",
42
+ "@xto/form": "^1.1.2",
43
+ "@xto/layout": "^1.0.5",
44
+ "@xto/navigation": "^1.2.1",
45
+ "axios": "^1.6.0",
46
+ "pinia": "^2.1.0",
47
+ "vue": "^3.4.0",
48
+ "vue-router": "^4.3.0"
49
+ },
50
+ "devDependencies": {
51
+ "@types/node": "^20.11.30",
52
+ "@vitejs/plugin-vue": "^5.0.4",
53
+ "@xto/base": "^1.3.2",
54
+ "@xto/business": "^1.1.0",
55
+ "@xto/core": "^1.0.2",
56
+ "@xto/data": "^1.1.1",
57
+ "@xto/feedback": "^1.1.3",
58
+ "@xto/form": "^1.1.2",
59
+ "@xto/layout": "^1.0.5",
60
+ "@xto/navigation": "^1.2.1",
61
+ "axios": "^1.6.8",
62
+ "pinia": "^2.1.7",
63
+ "sass": "^1.72.0",
64
+ "sass-embedded": "^1.72.0",
65
+ "typescript": "^5.4.2",
66
+ "vite": "^5.2.0",
67
+ "vite-plugin-dts": "^4.5.4",
68
+ "vue": "^3.4.21",
69
+ "vue-router": "^4.3.0",
70
+ "vue-tsc": "^2.0.6"
71
+ },
72
+ "keywords": [
73
+ "vue",
74
+ "vue3",
75
+ "admin",
76
+ "template",
77
+ "xto"
78
+ ],
79
+ "author": "",
80
+ "license": "MIT",
81
+ "repository": {
82
+ "type": "git",
83
+ "url": ""
84
+ }
85
+ }
package/src/api/auth.ts CHANGED
@@ -1,26 +1,26 @@
1
- /**
2
- * 认证 API
3
- */
4
-
5
- import { http } from '@/utils/request'
6
- import type { LoginParams, LoginResult, UserInfo } from '@/types/api'
7
-
8
- // 登录
9
- export function login(data: LoginParams) {
10
- return http.post<LoginResult>('/user/v1.0/login/by-domain', data)
11
- }
12
-
13
- // 登出
14
- export function logout() {
15
- return http.put('/user/v1.0/user/logout')
16
- }
17
-
18
- // 获取用户信息
19
- export function getUserInfo() {
20
- return http.get<UserInfo>('/user/v1.0/user/get-me')
21
- }
22
-
23
- // 刷新 Token
24
- export function refreshToken(refreshToken: string) {
25
- return http.post<{ token: string; expireTime: number }>('/user/v1.0/refresh', { refreshToken })
1
+ /**
2
+ * 认证 API
3
+ */
4
+
5
+ import { http } from '@/utils/request'
6
+ import type { LoginParams, LoginResult, UserInfo } from '@/types/api'
7
+
8
+ // 登录
9
+ export function login(data: LoginParams) {
10
+ return http.post<LoginResult>('/user/v1.0/login/by-domain', data)
11
+ }
12
+
13
+ // 登出
14
+ export function logout() {
15
+ return http.put('/user/v1.0/user/logout')
16
+ }
17
+
18
+ // 获取用户信息
19
+ export function getUserInfo() {
20
+ return http.get<UserInfo>('/user/v1.0/user/get-me')
21
+ }
22
+
23
+ // 刷新 Token
24
+ export function refreshToken(refreshToken: string) {
25
+ return http.post<{ token: string; expireTime: number }>('/user/v1.0/refresh', { refreshToken })
26
26
  }
package/src/api/system.ts CHANGED
@@ -1,67 +1,67 @@
1
- /**
2
- * 系统管理 API
3
- */
4
-
5
- import { http, type PageParams, type PageResponse } from '@/utils/request'
6
- import type { RoleInfo, MenuItem } from '@/types/api'
7
- import { getAppId } from '@/utils/config'
8
-
9
- // ========== 角色管理 ==========
10
-
11
- // 获取角色列表
12
- export function getRoleList(params: PageParams & { status?: number; keyword?: string }) {
13
- return http.get<PageResponse<RoleInfo>>('/role/list', { params })
14
- }
15
-
16
- // 获取角色详情
17
- export function getRoleDetail(id: string | number) {
18
- return http.get<RoleInfo>(`/role/${id}`)
19
- }
20
-
21
- // 创建角色
22
- export function createRole(data: Partial<RoleInfo>) {
23
- return http.post<RoleInfo>('/role', data)
24
- }
25
-
26
- // 更新角色
27
- export function updateRole(id: string | number, data: Partial<RoleInfo>) {
28
- return http.put<RoleInfo>(`/role/${id}`, data)
29
- }
30
-
31
- // 删除角色
32
- export function deleteRole(id: string | number) {
33
- return http.delete(`/role/${id}`)
34
- }
35
-
36
- // 更新角色状态
37
- export function updateRoleStatus(id: string | number, status: number) {
38
- return http.patch(`/role/${id}/status`, { status })
39
- }
40
-
41
- // ========== 菜单管理 ==========
42
-
43
- // 获取菜单列表
44
- export function getMenuList() {
45
- return http.get<MenuItem[]>('/user/v1.0/menu/list')
46
- }
47
-
48
- // 获取用户菜单(根据 appId)
49
- export function getMenuTree(appId?: string) {
50
- const id = appId || getAppId()
51
- return http.get<MenuItem[]>(`/user/v1.0/menu/get-menu?appId=${id}`)
52
- }
53
-
54
- // 创建菜单
55
- export function createMenu(data: Partial<MenuItem>) {
56
- return http.post<MenuItem>('/menu', data)
57
- }
58
-
59
- // 更新菜单
60
- export function updateMenu(id: string | number, data: Partial<MenuItem>) {
61
- return http.put<MenuItem>(`/menu/${id}`, data)
62
- }
63
-
64
- // 删除菜单
65
- export function deleteMenu(id: string | number) {
66
- return http.delete(`/menu/${id}`)
1
+ /**
2
+ * 系统管理 API
3
+ */
4
+
5
+ import { http, type PageParams, type PageResponse } from '@/utils/request'
6
+ import type { RoleInfo, MenuItem } from '@/types/api'
7
+ import { getAppId } from '@/utils/config'
8
+
9
+ // ========== 角色管理 ==========
10
+
11
+ // 获取角色列表
12
+ export function getRoleList(params: PageParams & { status?: number; keyword?: string }) {
13
+ return http.get<PageResponse<RoleInfo>>('/role/list', { params })
14
+ }
15
+
16
+ // 获取角色详情
17
+ export function getRoleDetail(id: string | number) {
18
+ return http.get<RoleInfo>(`/role/${id}`)
19
+ }
20
+
21
+ // 创建角色
22
+ export function createRole(data: Partial<RoleInfo>) {
23
+ return http.post<RoleInfo>('/role', data)
24
+ }
25
+
26
+ // 更新角色
27
+ export function updateRole(id: string | number, data: Partial<RoleInfo>) {
28
+ return http.put<RoleInfo>(`/role/${id}`, data)
29
+ }
30
+
31
+ // 删除角色
32
+ export function deleteRole(id: string | number) {
33
+ return http.delete(`/role/${id}`)
34
+ }
35
+
36
+ // 更新角色状态
37
+ export function updateRoleStatus(id: string | number, status: number) {
38
+ return http.patch(`/role/${id}/status`, { status })
39
+ }
40
+
41
+ // ========== 菜单管理 ==========
42
+
43
+ // 获取菜单列表
44
+ export function getMenuList() {
45
+ return http.get<MenuItem[]>('/user/v1.0/menu/list')
46
+ }
47
+
48
+ // 获取用户菜单(根据 appId)
49
+ export function getMenuTree(appId?: string) {
50
+ const id = appId || getAppId()
51
+ return http.get<MenuItem[]>(`/user/v1.0/menu/get-menu?appId=${id}`)
52
+ }
53
+
54
+ // 创建菜单
55
+ export function createMenu(data: Partial<MenuItem>) {
56
+ return http.post<MenuItem>('/menu', data)
57
+ }
58
+
59
+ // 更新菜单
60
+ export function updateMenu(id: string | number, data: Partial<MenuItem>) {
61
+ return http.put<MenuItem>(`/menu/${id}`, data)
62
+ }
63
+
64
+ // 删除菜单
65
+ export function deleteMenu(id: string | number) {
66
+ return http.delete(`/menu/${id}`)
67
67
  }