create-pubinfo-pr 0.1.1

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 (215) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +20 -0
  3. package/dist/cli-BgCjzF7D.d.ts +2 -0
  4. package/dist/cli.js +258 -0
  5. package/dist/helper-Cwc2jDwQ.js +229 -0
  6. package/dist/index-DCf5j10Q.d.ts +122 -0
  7. package/dist/index.js +3 -0
  8. package/package.json +52 -0
  9. package/templates/pubinfo-app/.browserslistrc +5 -0
  10. package/templates/pubinfo-app/.editorconfig +10 -0
  11. package/templates/pubinfo-app/.env +2 -0
  12. package/templates/pubinfo-app/.env.development +4 -0
  13. package/templates/pubinfo-app/.env.production +10 -0
  14. package/templates/pubinfo-app/.vscode/settings.json +50 -0
  15. package/templates/pubinfo-app/_gitignore +38 -0
  16. package/templates/pubinfo-app/_npmrc +5 -0
  17. package/templates/pubinfo-app/eslint.config.ts +3 -0
  18. package/templates/pubinfo-app/index.html +47 -0
  19. package/templates/pubinfo-app/openapi.config.ts.hbs +33 -0
  20. package/templates/pubinfo-app/package.json.hbs +59 -0
  21. package/templates/pubinfo-app/pubinfo.config.ts +9 -0
  22. package/templates/pubinfo-app/public/browser_upgrade/chrome.png +0 -0
  23. package/templates/pubinfo-app/public/browser_upgrade/edge.png +0 -0
  24. package/templates/pubinfo-app/public/browser_upgrade/index.css +49 -0
  25. package/templates/pubinfo-app/public/loading.css +92 -0
  26. package/templates/pubinfo-app/src/App.vue +7 -0
  27. package/templates/pubinfo-app/src/api/modules/auth/index.ts +3 -0
  28. package/templates/pubinfo-app/src/api/modules/auth/renzhengfuwu.ts +145 -0
  29. package/templates/pubinfo-app/src/api/modules/auth/typings.d.ts +97 -0
  30. package/templates/pubinfo-app/src/api/request.ts +125 -0
  31. package/templates/pubinfo-app/src/assets/icons/logo.svg +1 -0
  32. package/templates/pubinfo-app/src/assets/icons/process-management.svg +1 -0
  33. package/templates/pubinfo-app/src/assets/icons/workbench.svg +1 -0
  34. package/templates/pubinfo-app/src/assets/images/login-bg.webp +0 -0
  35. package/templates/pubinfo-app/src/assets/images/login-bg_dark.webp +0 -0
  36. package/templates/pubinfo-app/src/assets/images/login-small.png +0 -0
  37. package/templates/pubinfo-app/src/assets/images/login-small_dark.webp +0 -0
  38. package/templates/pubinfo-app/src/components/UIProvider/index.vue +51 -0
  39. package/templates/pubinfo-app/src/layouts/index.vue +48 -0
  40. package/templates/pubinfo-app/src/main.ts.hbs +26 -0
  41. package/templates/pubinfo-app/src/modules/captcha.ts +8 -0
  42. package/templates/pubinfo-app/src/modules/rbac.ts +10 -0
  43. package/templates/pubinfo-app/src/routes/index.ts +71 -0
  44. package/templates/pubinfo-app/src/routes/modules/demo/breadcrumb.example.ts +62 -0
  45. package/templates/pubinfo-app/src/routes/modules/demo/link.ts +15 -0
  46. package/templates/pubinfo-app/src/routes/modules/demo/multilevel.menu.example.ts +68 -0
  47. package/templates/pubinfo-app/src/routes/modules/demo/other.page.ts +37 -0
  48. package/templates/pubinfo-app/src/routes/modules/demo/single.ts +14 -0
  49. package/templates/pubinfo-app/src/settings.ts.hbs +8 -0
  50. package/templates/pubinfo-app/src/stores/index.ts +2 -0
  51. package/templates/pubinfo-app/src/stores/modules/conter.ts +16 -0
  52. package/templates/pubinfo-app/src/views/demo/breadcrumb_example/detail1.vue +11 -0
  53. package/templates/pubinfo-app/src/views/demo/breadcrumb_example/detail2.vue +11 -0
  54. package/templates/pubinfo-app/src/views/demo/breadcrumb_example/list1.vue +11 -0
  55. package/templates/pubinfo-app/src/views/demo/breadcrumb_example/list2.vue +11 -0
  56. package/templates/pubinfo-app/src/views/demo/multilevel_menu_example/level2/level3/page1.vue +11 -0
  57. package/templates/pubinfo-app/src/views/demo/multilevel_menu_example/level2/level3/page2.vue +11 -0
  58. package/templates/pubinfo-app/src/views/demo/multilevel_menu_example/level2/page.vue +11 -0
  59. package/templates/pubinfo-app/src/views/demo/multilevel_menu_example/page.vue +11 -0
  60. package/templates/pubinfo-app/src/views/demo/other_page/des.vue +13 -0
  61. package/templates/pubinfo-app/src/views/demo/other_page/index.vue +25 -0
  62. package/templates/pubinfo-app/src/views/demo/preview-empty/index.vue +17 -0
  63. package/templates/pubinfo-app/src/views/demo/single/index.vue +13 -0
  64. package/templates/pubinfo-app/src/views/system/index.vue +5 -0
  65. package/templates/pubinfo-app/src/views/system/login/components/LoginForm.vue +29 -0
  66. package/templates/pubinfo-app/src/views/system/login/components/LoginWithPhone.vue +213 -0
  67. package/templates/pubinfo-app/src/views/system/login/components/PasswordLogin.vue +178 -0
  68. package/templates/pubinfo-app/src/views/system/login/components/Savephone.vue +17 -0
  69. package/templates/pubinfo-app/src/views/system/login/components/Useragreement.vue +26 -0
  70. package/templates/pubinfo-app/src/views/system/login/composables.ts +63 -0
  71. package/templates/pubinfo-app/src/views/system/login/index.vue +142 -0
  72. package/templates/pubinfo-app/stylelint.config.js +3 -0
  73. package/templates/pubinfo-app/tsconfig.json +3 -0
  74. package/templates/pubinfo-app/uno.config.ts +17 -0
  75. package/templates/pubinfo-module/.editorconfig +10 -0
  76. package/templates/pubinfo-module/.vscode/settings.json +50 -0
  77. package/templates/pubinfo-module/README.md.hbs +27 -0
  78. package/templates/pubinfo-module/_gitignore +38 -0
  79. package/templates/pubinfo-module/_npmrc +5 -0
  80. package/templates/pubinfo-module/eslint.config.ts +3 -0
  81. package/templates/pubinfo-module/package.json.hbs +67 -0
  82. package/templates/pubinfo-module/playground/.env +2 -0
  83. package/templates/pubinfo-module/playground/.env.development +4 -0
  84. package/templates/pubinfo-module/playground/.env.production +10 -0
  85. package/templates/pubinfo-module/playground/index.html +47 -0
  86. package/templates/pubinfo-module/playground/openapi.config.ts.hbs +33 -0
  87. package/templates/pubinfo-module/playground/package.json.hbs +21 -0
  88. package/templates/pubinfo-module/playground/pubinfo.config.ts +9 -0
  89. package/templates/pubinfo-module/playground/public/browser_upgrade/chrome.png +0 -0
  90. package/templates/pubinfo-module/playground/public/browser_upgrade/edge.png +0 -0
  91. package/templates/pubinfo-module/playground/public/browser_upgrade/index.css +49 -0
  92. package/templates/pubinfo-module/playground/public/loading.css +92 -0
  93. package/templates/pubinfo-module/playground/src/App.vue +7 -0
  94. package/templates/pubinfo-module/playground/src/api/modules/auth/index.ts +3 -0
  95. package/templates/pubinfo-module/playground/src/api/modules/auth/renzhengfuwu.ts +145 -0
  96. package/templates/pubinfo-module/playground/src/api/modules/auth/typings.d.ts +97 -0
  97. package/templates/pubinfo-module/playground/src/api/request.ts +125 -0
  98. package/templates/pubinfo-module/playground/src/assets/icons/logo.svg +1 -0
  99. package/templates/pubinfo-module/playground/src/assets/icons/process-management.svg +1 -0
  100. package/templates/pubinfo-module/playground/src/assets/icons/workbench.svg +1 -0
  101. package/templates/pubinfo-module/playground/src/assets/images/login-bg.webp +0 -0
  102. package/templates/pubinfo-module/playground/src/assets/images/login-bg_dark.webp +0 -0
  103. package/templates/pubinfo-module/playground/src/assets/images/login-small.png +0 -0
  104. package/templates/pubinfo-module/playground/src/assets/images/login-small_dark.webp +0 -0
  105. package/templates/pubinfo-module/playground/src/components/UIProvider/index.vue +51 -0
  106. package/templates/pubinfo-module/playground/src/layouts/index.vue +44 -0
  107. package/templates/pubinfo-module/playground/src/main.ts.hbs +22 -0
  108. package/templates/pubinfo-module/playground/src/modules/rbac.ts +10 -0
  109. package/templates/pubinfo-module/playground/src/routes/index.ts +71 -0
  110. package/templates/pubinfo-module/playground/src/routes/modules/demo/breadcrumb.example.ts +62 -0
  111. package/templates/pubinfo-module/playground/src/routes/modules/demo/link.ts +15 -0
  112. package/templates/pubinfo-module/playground/src/routes/modules/demo/multilevel.menu.example.ts +68 -0
  113. package/templates/pubinfo-module/playground/src/routes/modules/demo/other.page.ts +37 -0
  114. package/templates/pubinfo-module/playground/src/routes/modules/demo/single.ts +14 -0
  115. package/templates/pubinfo-module/playground/src/settings.ts +8 -0
  116. package/templates/pubinfo-module/playground/src/stores/index.ts +2 -0
  117. package/templates/pubinfo-module/playground/src/stores/modules/conter.ts +16 -0
  118. package/templates/pubinfo-module/playground/src/views/demo/breadcrumb_example/detail1.vue +11 -0
  119. package/templates/pubinfo-module/playground/src/views/demo/breadcrumb_example/detail2.vue +11 -0
  120. package/templates/pubinfo-module/playground/src/views/demo/breadcrumb_example/list1.vue +11 -0
  121. package/templates/pubinfo-module/playground/src/views/demo/breadcrumb_example/list2.vue +11 -0
  122. package/templates/pubinfo-module/playground/src/views/demo/multilevel_menu_example/level2/level3/page1.vue +11 -0
  123. package/templates/pubinfo-module/playground/src/views/demo/multilevel_menu_example/level2/level3/page2.vue +11 -0
  124. package/templates/pubinfo-module/playground/src/views/demo/multilevel_menu_example/level2/page.vue +11 -0
  125. package/templates/pubinfo-module/playground/src/views/demo/multilevel_menu_example/page.vue +11 -0
  126. package/templates/pubinfo-module/playground/src/views/demo/other_page/des.vue +13 -0
  127. package/templates/pubinfo-module/playground/src/views/demo/other_page/index.vue +25 -0
  128. package/templates/pubinfo-module/playground/src/views/demo/preview-empty/index.vue +17 -0
  129. package/templates/pubinfo-module/playground/src/views/demo/single/index.vue +13 -0
  130. package/templates/pubinfo-module/playground/src/views/system/index.vue +5 -0
  131. package/templates/pubinfo-module/playground/src/views/system/login/components/LoginForm.vue +29 -0
  132. package/templates/pubinfo-module/playground/src/views/system/login/components/LoginWithPhone.vue +213 -0
  133. package/templates/pubinfo-module/playground/src/views/system/login/components/PasswordLogin.vue +194 -0
  134. package/templates/pubinfo-module/playground/src/views/system/login/components/Savephone.vue +17 -0
  135. package/templates/pubinfo-module/playground/src/views/system/login/components/Useragreement.vue +26 -0
  136. package/templates/pubinfo-module/playground/src/views/system/login/composables.ts +84 -0
  137. package/templates/pubinfo-module/playground/src/views/system/login/index.vue +142 -0
  138. package/templates/pubinfo-module/playground/tsconfig.json +3 -0
  139. package/templates/pubinfo-module/playground/uno.config.ts +17 -0
  140. package/templates/pubinfo-module/pnpm-workspace.yaml +2 -0
  141. package/templates/pubinfo-module/pubinfo.config.ts.hbs +36 -0
  142. package/templates/pubinfo-module/src/index.ts.hbs +9 -0
  143. package/templates/pubinfo-module/src/pages/demo.vue +11 -0
  144. package/templates/pubinfo-module/stylelint.config.js +3 -0
  145. package/templates/pubinfo-module/tsconfig.json +16 -0
  146. package/templates/pubinfo-module/uno.config.ts +8 -0
  147. package/templates/pubinfo-monorepo/.browserslistrc +5 -0
  148. package/templates/pubinfo-monorepo/.editorconfig +10 -0
  149. package/templates/pubinfo-monorepo/.vscode/settings.json +50 -0
  150. package/templates/pubinfo-monorepo/_gitignore +38 -0
  151. package/templates/pubinfo-monorepo/_npmrc +5 -0
  152. package/templates/pubinfo-monorepo/apps/basic/.env +2 -0
  153. package/templates/pubinfo-monorepo/apps/basic/.env.development +4 -0
  154. package/templates/pubinfo-monorepo/apps/basic/.env.production +10 -0
  155. package/templates/pubinfo-monorepo/apps/basic/index.html +47 -0
  156. package/templates/pubinfo-monorepo/apps/basic/openapi.config.ts.hbs +33 -0
  157. package/templates/pubinfo-monorepo/apps/basic/package.json.hbs +26 -0
  158. package/templates/pubinfo-monorepo/apps/basic/pubinfo.config.ts +9 -0
  159. package/templates/pubinfo-monorepo/apps/basic/public/browser_upgrade/chrome.png +0 -0
  160. package/templates/pubinfo-monorepo/apps/basic/public/browser_upgrade/edge.png +0 -0
  161. package/templates/pubinfo-monorepo/apps/basic/public/browser_upgrade/index.css +49 -0
  162. package/templates/pubinfo-monorepo/apps/basic/public/loading.css +92 -0
  163. package/templates/pubinfo-monorepo/apps/basic/src/App.vue +7 -0
  164. package/templates/pubinfo-monorepo/apps/basic/src/api/modules/auth/index.ts +3 -0
  165. package/templates/pubinfo-monorepo/apps/basic/src/api/modules/auth/renzhengfuwu.ts +145 -0
  166. package/templates/pubinfo-monorepo/apps/basic/src/api/modules/auth/typings.d.ts +97 -0
  167. package/templates/pubinfo-monorepo/apps/basic/src/api/request.ts +125 -0
  168. package/templates/pubinfo-monorepo/apps/basic/src/assets/icons/logo.svg +1 -0
  169. package/templates/pubinfo-monorepo/apps/basic/src/assets/icons/process-management.svg +1 -0
  170. package/templates/pubinfo-monorepo/apps/basic/src/assets/icons/workbench.svg +1 -0
  171. package/templates/pubinfo-monorepo/apps/basic/src/assets/images/login-bg.webp +0 -0
  172. package/templates/pubinfo-monorepo/apps/basic/src/assets/images/login-bg_dark.webp +0 -0
  173. package/templates/pubinfo-monorepo/apps/basic/src/assets/images/login-small.png +0 -0
  174. package/templates/pubinfo-monorepo/apps/basic/src/assets/images/login-small_dark.webp +0 -0
  175. package/templates/pubinfo-monorepo/apps/basic/src/components/UIProvider/index.vue +51 -0
  176. package/templates/pubinfo-monorepo/apps/basic/src/layouts/index.vue +48 -0
  177. package/templates/pubinfo-monorepo/apps/basic/src/main.ts.hbs +26 -0
  178. package/templates/pubinfo-monorepo/apps/basic/src/modules/captcha.ts +8 -0
  179. package/templates/pubinfo-monorepo/apps/basic/src/modules/rbac.ts +10 -0
  180. package/templates/pubinfo-monorepo/apps/basic/src/routes/index.ts +71 -0
  181. package/templates/pubinfo-monorepo/apps/basic/src/routes/modules/demo/breadcrumb.example.ts +62 -0
  182. package/templates/pubinfo-monorepo/apps/basic/src/routes/modules/demo/link.ts +15 -0
  183. package/templates/pubinfo-monorepo/apps/basic/src/routes/modules/demo/multilevel.menu.example.ts +68 -0
  184. package/templates/pubinfo-monorepo/apps/basic/src/routes/modules/demo/other.page.ts +37 -0
  185. package/templates/pubinfo-monorepo/apps/basic/src/routes/modules/demo/single.ts +14 -0
  186. package/templates/pubinfo-monorepo/apps/basic/src/settings.ts.hbs +8 -0
  187. package/templates/pubinfo-monorepo/apps/basic/src/stores/index.ts +2 -0
  188. package/templates/pubinfo-monorepo/apps/basic/src/stores/modules/conter.ts +16 -0
  189. package/templates/pubinfo-monorepo/apps/basic/src/views/demo/breadcrumb_example/detail1.vue +11 -0
  190. package/templates/pubinfo-monorepo/apps/basic/src/views/demo/breadcrumb_example/detail2.vue +11 -0
  191. package/templates/pubinfo-monorepo/apps/basic/src/views/demo/breadcrumb_example/list1.vue +11 -0
  192. package/templates/pubinfo-monorepo/apps/basic/src/views/demo/breadcrumb_example/list2.vue +11 -0
  193. package/templates/pubinfo-monorepo/apps/basic/src/views/demo/multilevel_menu_example/level2/level3/page1.vue +11 -0
  194. package/templates/pubinfo-monorepo/apps/basic/src/views/demo/multilevel_menu_example/level2/level3/page2.vue +11 -0
  195. package/templates/pubinfo-monorepo/apps/basic/src/views/demo/multilevel_menu_example/level2/page.vue +11 -0
  196. package/templates/pubinfo-monorepo/apps/basic/src/views/demo/multilevel_menu_example/page.vue +11 -0
  197. package/templates/pubinfo-monorepo/apps/basic/src/views/demo/other_page/des.vue +13 -0
  198. package/templates/pubinfo-monorepo/apps/basic/src/views/demo/other_page/index.vue +25 -0
  199. package/templates/pubinfo-monorepo/apps/basic/src/views/demo/preview-empty/index.vue +17 -0
  200. package/templates/pubinfo-monorepo/apps/basic/src/views/demo/single/index.vue +13 -0
  201. package/templates/pubinfo-monorepo/apps/basic/src/views/system/index.vue +5 -0
  202. package/templates/pubinfo-monorepo/apps/basic/src/views/system/login/components/LoginForm.vue +29 -0
  203. package/templates/pubinfo-monorepo/apps/basic/src/views/system/login/components/LoginWithPhone.vue +213 -0
  204. package/templates/pubinfo-monorepo/apps/basic/src/views/system/login/components/PasswordLogin.vue +178 -0
  205. package/templates/pubinfo-monorepo/apps/basic/src/views/system/login/components/Savephone.vue +17 -0
  206. package/templates/pubinfo-monorepo/apps/basic/src/views/system/login/components/Useragreement.vue +26 -0
  207. package/templates/pubinfo-monorepo/apps/basic/src/views/system/login/composables.ts +63 -0
  208. package/templates/pubinfo-monorepo/apps/basic/src/views/system/login/index.vue +142 -0
  209. package/templates/pubinfo-monorepo/apps/basic/tsconfig.json +3 -0
  210. package/templates/pubinfo-monorepo/apps/basic/uno.config.ts +17 -0
  211. package/templates/pubinfo-monorepo/eslint.config.ts +3 -0
  212. package/templates/pubinfo-monorepo/package.json.hbs +45 -0
  213. package/templates/pubinfo-monorepo/pnpm-lock.yaml +12686 -0
  214. package/templates/pubinfo-monorepo/pnpm-workspace.yaml +11 -0
  215. package/templates/pubinfo-monorepo/stylelint.config.js +3 -0
@@ -0,0 +1,97 @@
1
+ /* eslint-disable */
2
+ // @ts-nocheck
3
+ declare namespace API {
4
+ type getAuthCheckCacheTokenParams = {
5
+ accessToken: string;
6
+ userId: string;
7
+ };
8
+
9
+ type getAuthLoginValidCodeParams = {
10
+ /** 尺寸(长x宽),例:150x50表示长为150宽为50,不填默认150x50 */
11
+ size?: string;
12
+ /** 验证码长度,不填默认4位 */
13
+ length?: number;
14
+ };
15
+
16
+ type IResponseCode = {
17
+ code?: number;
18
+ msg?: string;
19
+ hint?: string;
20
+ };
21
+
22
+ type LoginByPwdDto = {
23
+ /** 登录类型 */
24
+ loginType: string;
25
+ /** 登录名 */
26
+ loginName: string;
27
+ /** 密码 */
28
+ loginPwd: string;
29
+ /** 验证码hash */
30
+ codeHash: string;
31
+ /** 验证码 */
32
+ code: string;
33
+ };
34
+
35
+ type LoginTokenVo = {
36
+ /** 刷新令牌 */
37
+ refreshToken?: string;
38
+ /** 访问令牌 */
39
+ accessToken?: string;
40
+ loginResponse?: IResponseCode;
41
+ };
42
+
43
+ type postAuthChangeLoginOrgParams = {
44
+ /** 新组织id */
45
+ orgId: string;
46
+ };
47
+
48
+ type postAuthTokenRefreshParams = {
49
+ /** 刷新令牌 */
50
+ refreshToken: string;
51
+ };
52
+
53
+ type ResponseDataBoolean = {
54
+ code?: number;
55
+ msg?: string;
56
+ hint?: string;
57
+ data?: boolean;
58
+ success?: boolean;
59
+ };
60
+
61
+ type ResponseDataLoginTokenVo = {
62
+ code?: number;
63
+ msg?: string;
64
+ hint?: string;
65
+ data?: LoginTokenVo;
66
+ success?: boolean;
67
+ };
68
+
69
+ type ResponseDataString = {
70
+ code?: number;
71
+ msg?: string;
72
+ hint?: string;
73
+ data?: string;
74
+ success?: boolean;
75
+ };
76
+
77
+ type ResponseDataValidCodeVo = {
78
+ code?: number;
79
+ msg?: string;
80
+ hint?: string;
81
+ data?: ValidCodeVo;
82
+ success?: boolean;
83
+ };
84
+
85
+ type ResponseDataVoid = {
86
+ code?: number;
87
+ msg?: string;
88
+ hint?: string;
89
+ data?: Record<string, any>;
90
+ success?: boolean;
91
+ };
92
+
93
+ type ValidCodeVo = {
94
+ key?: string;
95
+ plaintext?: string;
96
+ };
97
+ }
@@ -0,0 +1,125 @@
1
+ import { message } from 'ant-design-vue';
2
+ import { createRequest, RESPONSE_CODE } from 'pubinfo';
3
+ import { useUserStore } from '@/stores';
4
+
5
+ /**
6
+ * @description
7
+ * 创建 API 请求的基础 URL。
8
+ * 如果环境是开发环境,并且 VITE_OPEN_PROXY 标志设置为 'true',
9
+ * 则返回 '/proxy/'。否则,返回 VITE_APP_API_BASEURL 的值。
10
+ * @returns API 请求的基础 URL。
11
+ */
12
+ function createBaseURL(baseUrl: string) {
13
+ let requestBaseUrl;
14
+ if (import.meta.env.DEV && import.meta.env.VITE_OPEN_PROXY === 'true') {
15
+ const url = new URL(baseUrl);
16
+ const pathname = url.pathname;
17
+ requestBaseUrl = `${pathname}/proxy/`;
18
+ }
19
+ else {
20
+ requestBaseUrl = baseUrl;
21
+ }
22
+
23
+ return requestBaseUrl;
24
+ }
25
+
26
+ function createErrorMsg(msg: string) {
27
+ message.error(msg);
28
+ }
29
+
30
+ const timeout = 60 * 1000;
31
+
32
+ function createInstance(url: string) {
33
+ return createRequest({
34
+ baseURL: createBaseURL(url),
35
+ timeout: 60 * 1000,
36
+ responded: {
37
+ /**
38
+ * @description
39
+ * 网络成功的响应
40
+ */
41
+ async onSuccess(response) {
42
+ const isBlob = response.config?.responseType === 'blob';
43
+ if (isBlob) {
44
+ return Promise.resolve(response);
45
+ }
46
+
47
+ const data = response.data;
48
+ // 基于code判断逻辑
49
+ const { code } = data;
50
+ // code 都是number类型
51
+ switch (code) {
52
+ /**
53
+ * @description
54
+ * 成功的code
55
+ */
56
+ case RESPONSE_CODE.SUCCESS:
57
+ return Promise.resolve(data);
58
+
59
+ /**
60
+ * @description
61
+ * 用于判断refreshToken是否过期
62
+ * 如果refreshToken也过期了,需要重新登录
63
+ * 不需要msg提示信息
64
+ */
65
+ case RESPONSE_CODE.LOGIN_TOKEN_INVALID:
66
+ useUserStore().logout();
67
+ return Promise.reject(data);
68
+
69
+ /**
70
+ * @description
71
+ * 账户未启用,请联系管理员
72
+ * 账户锁定,请联系管理员
73
+ */
74
+ case RESPONSE_CODE.ACCOUT_NOT_ENABLE:
75
+ case RESPONSE_CODE.ACCOUNT_LOCKED:
76
+ createErrorMsg(response.data.msg);
77
+ useUserStore().logout();
78
+ return Promise.reject(data);
79
+
80
+ /**
81
+ * @description
82
+ * 密码过期或者首次登录,需要修改密码
83
+ * 需要跳转到修改密码页面
84
+ * 目前貌似不需要单独判读code在此处处理
85
+ */
86
+ case RESPONSE_CODE.CHANGE_INIT_PASSWORD:
87
+ case RESPONSE_CODE.PASSWORD_EXPIRED:
88
+ return Promise.reject(data);
89
+
90
+ /**
91
+ * @description
92
+ * RESPONSE_CODE 中其他的错误信息
93
+ */
94
+ default:
95
+ createErrorMsg(response.data.msg);
96
+ return Promise.reject(data);
97
+ }
98
+ },
99
+ /**
100
+ * @description
101
+ * 网络失败的响应
102
+ */
103
+ onError(error) {
104
+ const message = error.message;
105
+ let msg = '';
106
+ switch (message) {
107
+ case 'Network Error':
108
+ msg = '网络故障';
109
+ break;
110
+ case `timeout of ${timeout}ms exceeded`:
111
+ msg = '接口请求超时';
112
+ break;
113
+ default:
114
+ msg = `接口${message.substr(message.length - 3)}异常`;
115
+ break;
116
+ }
117
+ createErrorMsg(msg);
118
+ return Promise.reject(error);
119
+ },
120
+ },
121
+ });
122
+ }
123
+
124
+ export const basic = createInstance(import.meta.env.VITE_APP_API_BASEURL);
125
+ export const auth = createInstance(import.meta.env.VITE_APP_API_BASEURL);
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 144 125" preserveAspectRatio="xMidYMid meet"><path fill="url(#a)" stroke="url(#b)" d="M142.858 58.054c0 1.922-.524 3.845-1.572 5.418l-14.68 23.068-16.078 25.165c-1.398 2.097-3.67 3.496-6.292 3.496h-65.71L55.13 86.54h34.952l14.855-25.515c.699-1.398-.175-2.97-1.748-2.97H71.731l16.602-28.661h34.428c2.272 0 4.369 1.223 5.592 3.145l12.758 20.098c1.223 1.572 1.747 3.495 1.747 5.417Z"/><path fill="url(#c)" stroke="url(#d)" d="M38.702 54.909c-.7 1.398.174 2.97 1.747 2.97h31.457L55.304 86.54H20.876c-2.272 0-4.369-1.223-5.592-3.146L2.352 63.473C1.303 61.724.779 59.977.779 58.054s.524-3.844 1.573-5.417l14.68-23.068 16.077-25.34C34.507 2.13 36.954.732 39.401.732h65.535l-16.603 28.66H53.382z"/><path fill="url(#e)" d="M142.858 57.88v9.087c0 1.922-.524 3.844-1.572 5.417l-30.758 48.409c-1.398 2.097-3.845 3.495-6.292 3.495h-65.71V115.2h65.536c2.621 0 4.893-1.398 6.291-3.495l16.253-25.34 14.68-23.068c1.048-1.748 1.572-3.67 1.572-5.418" opacity=".8"/><path fill="url(#f)" d="m104.935 61.025-3.495 6.117H71.731l-11.36 19.573H55.13l16.602-28.66h31.457c1.573 0 2.621 1.572 1.747 2.97" opacity=".8"/><path fill="url(#g)" d="m101.44 67.142 3.495-6.117c.874-1.398-.174-2.97-1.747-2.97H71.731v9.087z" opacity=".8"/><path fill="url(#h)" d="M104.936.733v9.088l-11.36 19.573h-5.242z" opacity=".8"/><path fill="url(#i)" d="m88.508 29.394-5.243 9.087h-29.71L42.197 58.054H40.45c-1.573 0-2.622-1.748-1.748-2.97l14.855-25.516h34.951z" opacity=".8"/><path fill="url(#j)" d="m55.13 86.54-5.244 9.087h-29.01c-2.272 0-4.369-1.223-5.592-3.145L2.352 72.559C1.303 70.986.779 69.064.779 67.142v-9.088c0 1.923.524 3.845 1.573 5.418l12.757 20.097c1.223 1.922 3.32 3.146 5.592 3.146H55.13z" opacity=".8"/><defs><linearGradient id="a" x1="90.693" x2="90.693" y1="29.394" y2="115.201" gradientUnits="userSpaceOnUse"><stop stop-color="#AEFFD3"/><stop offset="1" stop-color="#13C966"/></linearGradient><linearGradient id="b" x1="132.493" x2="90.803" y1="35.066" y2="115.258" gradientUnits="userSpaceOnUse"><stop stop-color="#fff" stop-opacity="0"/><stop offset="1" stop-color="#fff" stop-opacity=".82"/></linearGradient><linearGradient id="c" x1="52.857" x2="52.857" y1=".733" y2="86.54" gradientUnits="userSpaceOnUse"><stop stop-color="#A3C6FF"/><stop offset="1" stop-color="#2275FF"/></linearGradient><linearGradient id="d" x1="94.587" x2="52.857" y1="6.405" y2="86.54" gradientUnits="userSpaceOnUse"><stop stop-color="#fff" stop-opacity="0"/><stop offset="1" stop-color="#fff" stop-opacity=".55"/></linearGradient><linearGradient id="e" x1="90.693" x2="90.693" y1="57.879" y2="124.288" gradientUnits="userSpaceOnUse"><stop stop-color="#AEFFD3"/><stop offset="1" stop-color="#0FE270"/></linearGradient><linearGradient id="f" x1="80.191" x2="80.191" y1="58.054" y2="86.715" gradientUnits="userSpaceOnUse"><stop stop-color="#A3C6FF"/><stop offset="1" stop-color="#2275FF"/></linearGradient><linearGradient id="g" x1="72.889" x2="100.968" y1="67.142" y2="67.142" gradientUnits="userSpaceOnUse"><stop stop-color="#AEFFD3"/><stop offset="1" stop-color="#0FE270"/></linearGradient><linearGradient id="h" x1="105.825" x2="89.13" y1=".733" y2="27.995" gradientUnits="userSpaceOnUse"><stop stop-color="#A3C6FF"/><stop offset="1" stop-color="#2275FF"/></linearGradient><linearGradient id="i" x1="63.446" x2="63.446" y1="29.394" y2="58.054" gradientUnits="userSpaceOnUse"><stop stop-color="#A3C6FF"/><stop offset="1" stop-color="#2275FF"/></linearGradient><linearGradient id="j" x1="27.954" x2="27.954" y1="58.054" y2="95.627" gradientUnits="userSpaceOnUse"><stop stop-color="#A3C6FF"/><stop offset="1" stop-color="#2275FF"/></linearGradient></defs></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24" viewBox="0 0 24 24" preserveAspectRatio="xMidYMid meet"><defs><linearGradient id="a" x1="0%" x2="85.607%" y1="0%" y2="88.541%"><stop offset="0%" stop-color="#05E0CF"/><stop offset="100%" stop-color="#02BDA1"/></linearGradient><linearGradient id="d" x1="56.555%" x2="56.555%" y1="95.676%" y2="0%"><stop offset="0%" stop-color="#FFF"/><stop offset="100%" stop-color="#FFF" stop-opacity=".8"/></linearGradient><linearGradient id="e" x1="56.555%" x2="56.555%" y1="95.676%" y2="0%"><stop offset="0%" stop-color="#FFF"/><stop offset="100%" stop-color="#FFF" stop-opacity=".8"/></linearGradient><path id="b" d="M0 0h16v16H0z"/></defs><g fill="none" fill-rule="evenodd"><rect width="24" height="24" fill="url(#a)" rx="8"/><g transform="translate(5 4)"><mask id="c" fill="#fff"><use xlink:href="#b"/></mask><g mask="url(#c)"><path fill="url(#d)" d="M8 0a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V1a1 1 0 0 1 1-1zm0 8a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1z" transform="translate(1 1.5)"/><path fill="url(#e)" d="M10.12 1.872a5.59 5.59 0 0 1 2.413 4.027l.915.001a.6.6 0 1 1 0 1.2h-.916a5.59 5.59 0 0 1-2.426 4.03.6.6 0 0 1-.674-.994 4.39 4.39 0 0 0 1.932-3.64 4.39 4.39 0 0 0-1.92-3.633.6.6 0 1 1 .676-.991" transform="translate(1 1.5)"/></g></g></g></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24" viewBox="0 0 24 24" preserveAspectRatio="xMidYMid meet"><defs><linearGradient id="b" x1="24.065%" x2="100%" y1="0%" y2="100%"><stop offset="0%" stop-color="#FFC758"/><stop offset="100%" stop-color="#FFB92B"/></linearGradient><rect id="a" width="24" height="24" x="0" y="0" rx="8"/></defs><g fill="none" fill-rule="evenodd"><use xlink:href="#a" fill="url(#b)"/><path fill="#FFF" d="M17 6a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2h-4.4v1.801H14a.6.6 0 0 1 .097 1.193L14 19h-4a.6.6 0 0 1-.097-1.192L10 17.8h1.4V16H7a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2zm-5.5 5.65h-2l-.097.008A.6.6 0 0 0 9.5 12.85h2l.097-.008a.6.6 0 0 0-.097-1.192m3-2.5h-5l-.097.008A.6.6 0 0 0 9.5 10.35h5l.097-.008A.6.6 0 0 0 14.5 9.15"/></g></svg>
@@ -0,0 +1,51 @@
1
+ <script setup lang="ts">
2
+ import { legacyLogicalPropertiesTransformer, theme } from 'ant-design-vue';
3
+ import zhCN from 'ant-design-vue/es/locale/zh_CN';
4
+ import dayjs from 'dayjs';
5
+ import { useTheme } from 'pubinfo';
6
+ import 'dayjs/locale/zh-cn';
7
+
8
+ defineOptions({
9
+ name: 'UIProvider',
10
+ });
11
+
12
+ dayjs.locale('zh-cn');
13
+
14
+ function getContainer() {
15
+ return document.body;
16
+ }
17
+
18
+ const { isDark } = useTheme();
19
+
20
+ const UILocales = computed(() => {
21
+ return zhCN;
22
+ });
23
+
24
+ const themeMode = computed(() => {
25
+ return isDark.value
26
+ ? { algorithm: [theme.darkAlgorithm] }
27
+ : {};
28
+ });
29
+
30
+ const themeConfig = computed(() => {
31
+ return Object.assign(
32
+ { token: { wireframe: true } },
33
+ themeMode.value,
34
+ );
35
+ });
36
+ </script>
37
+
38
+ <template>
39
+ <a-config-provider
40
+ :locale="UILocales"
41
+ :theme="themeConfig"
42
+ :get-popup-container="getContainer"
43
+ >
44
+ <a-style-provider hash-priority="high" :transformers="[legacyLogicalPropertiesTransformer]">
45
+ <a-app class="w-full h-full">
46
+ <slot />
47
+ <a-modal />
48
+ </a-app>
49
+ </a-style-provider>
50
+ </a-config-provider>
51
+ </template>
@@ -0,0 +1,48 @@
1
+ <script lang="ts" setup>
2
+ import {
3
+ Copyright,
4
+ Layout,
5
+ Logo,
6
+ Tool,
7
+ Tools,
8
+ } from 'pubinfo';
9
+
10
+ const title = import.meta.env.VITE_APP_TITLE;
11
+ const dev = import.meta.env.DEV;
12
+ </script>
13
+
14
+ <template>
15
+ <Layout.Provider :app-title="title" :is-dev="dev">
16
+ <Layout>
17
+ <template #header>
18
+ <Layout.Header>
19
+ <template #logo>
20
+ <Logo name="logo" />
21
+ </template>
22
+
23
+ <template #tools>
24
+ <Tools>
25
+ <Tool.Fullscreen />
26
+ <Tool.PageReload />
27
+ <Tool.DarkModeToggle />
28
+ </Tools>
29
+ </template>
30
+ </Layout.Header>
31
+ </template>
32
+
33
+ <template #topbar>
34
+ <Layout.Topbar />
35
+ </template>
36
+
37
+ <template #sidebar>
38
+ <Layout.Sidebar />
39
+ </template>
40
+
41
+ <Layout.Content />
42
+
43
+ <template #footer>
44
+ <Copyright />
45
+ </template>
46
+ </Layout>
47
+ </Layout.Provider>
48
+ </template>
@@ -0,0 +1,26 @@
1
+ import { createPubinfo } from 'pubinfo';
2
+ import { auth, basic } from './api/request';
3
+ import App from './App.vue';
4
+ import { setupCaptcha } from './modules/captcha';
5
+ {{#if rbac}}
6
+ import { setupRbac } from './modules/rbac';
7
+ {{/if}}
8
+ import { constantRoutes } from './routes';
9
+ import './settings';
10
+ import 'uno.css';
11
+
12
+ createPubinfo({
13
+ app: App,
14
+ router: { routes: constantRoutes },
15
+ setup(ctx) {},
16
+ request: {
17
+ auth,
18
+ basic,
19
+ },
20
+ modules: [
21
+ setupCaptcha(),
22
+ {{#if rbac}}
23
+ setupRbac(),
24
+ {{/if}}
25
+ ],
26
+ });
@@ -0,0 +1,8 @@
1
+ import { captcha } from '@pubinfo/module-captcha';
2
+ import { auth } from '../api/request';
3
+
4
+ export function setupCaptcha() {
5
+ return captcha({
6
+ request: auth,
7
+ });
8
+ }
@@ -0,0 +1,10 @@
1
+ import { rbac } from '@pubinfo/module-rbac';
2
+ import { basic } from '../api/request';
3
+
4
+ export function setupRbac() {
5
+ return rbac({
6
+ id: 'RBAC',
7
+ pages: 'dynamic',
8
+ request: basic,
9
+ });
10
+ }
@@ -0,0 +1,71 @@
1
+ import { defineAsyncRoutes, defineSystemRoutes } from 'pubinfo';
2
+ import Login from '@/views/system/login/index.vue';
3
+
4
+ import Breadcrumb from './modules/demo/breadcrumb.example';
5
+ import Link from './modules/demo/link';
6
+ import MultilevelMenuExample from './modules/demo/multilevel.menu.example';
7
+ import OtherPage from './modules/demo/other.page';
8
+ import Single from './modules/demo/single';
9
+
10
+ /**
11
+ * ========================================================================
12
+ * 本地路由(资源管理的类型配置成"应用")
13
+ *========================================================================*
14
+ */
15
+ defineAsyncRoutes([
16
+ {
17
+ meta: {
18
+ title: '演示管理系统',
19
+ icon: 'workbench',
20
+ },
21
+ children: [
22
+ Single,
23
+ MultilevelMenuExample,
24
+ OtherPage,
25
+ Link,
26
+ Breadcrumb,
27
+ ],
28
+ },
29
+ {
30
+ meta: {
31
+ title: '演示系统1',
32
+ icon: 'process-management',
33
+ isDev: true,
34
+ },
35
+ },
36
+ ]);
37
+
38
+ /**
39
+ * ========================================================================
40
+ * 系统路由(包含布局)
41
+ *========================================================================*
42
+ */
43
+ defineSystemRoutes([
44
+ {
45
+ path: '/',
46
+ name: 'Home',
47
+ component: () => import('@/views/system/index.vue'),
48
+ meta: {
49
+ title: '首页',
50
+ icon: 'i-ant-design:home-twotone',
51
+ breadcrumb: false,
52
+ },
53
+ },
54
+ ]);
55
+
56
+ /**
57
+ * ========================================================================
58
+ * 固定路由(默认路由)
59
+ *========================================================================*
60
+ */
61
+ export const constantRoutes = [
62
+ {
63
+ path: '/login',
64
+ name: 'Login',
65
+ component: Login,
66
+ meta: {
67
+ whiteList: true,
68
+ title: '登录',
69
+ },
70
+ },
71
+ ];
@@ -0,0 +1,62 @@
1
+ import type { RouteRecordRaw } from 'vue-router';
2
+
3
+ const routes: RouteRecordRaw = {
4
+ path: '/breadcrumb_example',
5
+ redirect: '/breadcrumb_example/list1',
6
+ name: 'breadcrumbExample',
7
+ meta: {
8
+ title: '面包屑导航',
9
+ icon: 'i-solar-confetti-minimalistic-bold',
10
+ },
11
+ children: [
12
+ {
13
+ path: 'list1',
14
+ name: 'breadcrumbExampleList1',
15
+ component: () => import('@/views/demo/breadcrumb_example/list1.vue'),
16
+ meta: {
17
+ title: '列表1(平级模式)',
18
+ },
19
+ },
20
+ {
21
+ path: 'detail1',
22
+ name: 'breadcrumbExampleDetail1',
23
+ component: () => import('@/views/demo/breadcrumb_example/detail1.vue'),
24
+ meta: {
25
+ title: '详情1',
26
+ sidebar: false,
27
+ activeMenu: '/breadcrumb_example/list1',
28
+ },
29
+ },
30
+ {
31
+ path: 'list2',
32
+ name: 'breadcrumbExampleList2',
33
+ redirect: '/breadcrumb_example/demo/list2',
34
+ meta: {
35
+ title: '列表2(层级模式)',
36
+ },
37
+ children: [
38
+ {
39
+ path: '',
40
+ component: () => import('@/views/demo/breadcrumb_example/list2.vue'),
41
+ meta: {
42
+ title: '列表2(层级模式)',
43
+ sidebar: false,
44
+ breadcrumb: false,
45
+ },
46
+ },
47
+ {
48
+ path: 'detail2',
49
+ name: 'breadcrumbExampleDetail2',
50
+ component: () => import('@/views/demo/breadcrumb_example/detail2.vue'),
51
+ meta: {
52
+ title: '详情2',
53
+ sidebar: false,
54
+ activeMenu: '/breadcrumb_example/list2',
55
+ },
56
+ },
57
+ ],
58
+ },
59
+ ],
60
+ };
61
+
62
+ export default routes;
@@ -0,0 +1,15 @@
1
+ import type { RouteRecordRaw } from 'vue-router';
2
+
3
+ const routes: RouteRecordRaw = {
4
+ path: '/link',
5
+ name: 'Link',
6
+ redirect: '',
7
+ meta: {
8
+ title: '跳转路由',
9
+ singleMenu: true,
10
+ icon: 'i-solar-confetti-minimalistic-bold',
11
+ link: 'http://124.223.184.245:10000/docs/',
12
+ },
13
+ };
14
+
15
+ export default routes;
@@ -0,0 +1,68 @@
1
+ import type { RouteRecordRaw } from 'vue-router';
2
+
3
+ const routes: RouteRecordRaw = {
4
+ path: '/multilevel_menu_example',
5
+ redirect: '/multilevel_menu_example/page',
6
+ name: 'multilevelMenuExample',
7
+ meta: {
8
+ title: '多级导航',
9
+ icon: 'i-heroicons-solid:menu-alt-3',
10
+ },
11
+ children: [
12
+ {
13
+ path: 'page',
14
+ name: 'multilevelMenuExample1',
15
+ component: () => import('@/views/demo/multilevel_menu_example/page.vue'),
16
+ meta: {
17
+ title: '导航1',
18
+ icon: 'i-heroicons-solid:menu-alt-3',
19
+ },
20
+ },
21
+ {
22
+ path: 'level2',
23
+ name: 'multilevelMenuExample2',
24
+ redirect: '/multilevel_menu_example/level2/page',
25
+ meta: {
26
+ title: '导航2',
27
+ },
28
+ children: [
29
+ {
30
+ path: 'page',
31
+ name: 'multilevelMenuExample2-1',
32
+ component: () => import('@/views/demo/multilevel_menu_example/level2/page.vue'),
33
+ meta: {
34
+ title: '导航2-1',
35
+ },
36
+ },
37
+ {
38
+ path: 'level3',
39
+ name: 'multilevelMenuExample2-2',
40
+ redirect: '/multilevel_menu_example/level2/level3/page1',
41
+ meta: {
42
+ title: '导航2-2',
43
+ },
44
+ children: [
45
+ {
46
+ path: 'page1',
47
+ name: 'multilevelMenuExample2-2-1',
48
+ component: () => import('@/views/demo/multilevel_menu_example/level2/level3/page1.vue'),
49
+ meta: {
50
+ title: '导航2-2-1',
51
+ },
52
+ },
53
+ {
54
+ path: 'page2',
55
+ name: 'multilevelMenuExample2-2-2',
56
+ component: () => import('@/views/demo/multilevel_menu_example/level2/level3/page2.vue'),
57
+ meta: {
58
+ title: '导航2-2-2',
59
+ },
60
+ },
61
+ ],
62
+ },
63
+ ],
64
+ },
65
+ ],
66
+ };
67
+
68
+ export default routes;
@@ -0,0 +1,37 @@
1
+ import type { RouteRecordRaw } from 'vue-router';
2
+
3
+ const routes: RouteRecordRaw = {
4
+ path: '/other-page',
5
+ redirect: '/other-page/list',
6
+ name: 'OtherPage',
7
+ meta: {
8
+ title: '下探页面',
9
+ icon: 'i-solar-confetti-minimalistic-bold',
10
+ },
11
+ children: [
12
+ {
13
+ path: 'list',
14
+ name: 'OtherPageList',
15
+ component: () => import('@/views/demo/other_page/index.vue'),
16
+ meta: {
17
+ title: '列表页',
18
+ sidebar: false,
19
+ breadcrumb: false,
20
+ activeMenu: '/other-page',
21
+ },
22
+ },
23
+ {
24
+ path: 'detail',
25
+ name: 'OtherPageDetail',
26
+ component: () => import('@/views/demo/other_page/des.vue'),
27
+ meta: {
28
+ title: '详情页',
29
+ sidebar: false,
30
+ breadcrumb: true,
31
+ activeMenu: '/other-page',
32
+ },
33
+ },
34
+ ],
35
+ };
36
+
37
+ export default routes;
@@ -0,0 +1,14 @@
1
+ import type { RouteRecordRaw } from 'vue-router';
2
+
3
+ const routes: RouteRecordRaw = {
4
+ path: '/single',
5
+ component: () => import('@/views/demo/single/index.vue'),
6
+ name: 'Single',
7
+ meta: {
8
+ title: '单页面路由',
9
+ singleMenu: true,
10
+ icon: 'i-solar-confetti-minimalistic-bold',
11
+ },
12
+ };
13
+
14
+ export default routes;
@@ -0,0 +1,8 @@
1
+ import { defineSettings } from 'pubinfo';
2
+
3
+ export default defineSettings({
4
+ // 请在此处编写或粘贴配置代码
5
+ app: {
6
+ storagePrefix: '{{key}}',
7
+ },
8
+ });