create-young-proj 0.8.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (401) hide show
  1. package/LICENSE +0 -0
  2. package/README.md +0 -0
  3. package/dist/index.mjs +0 -0
  4. package/package.json +34 -23
  5. package/template-admin-server/.editorconfig +0 -0
  6. package/template-admin-server/.nvmrc +0 -0
  7. package/template-admin-server/.vscode/extensions.json +0 -0
  8. package/template-admin-server/.vscode/settings.json +0 -0
  9. package/template-admin-server/README.md +0 -0
  10. package/template-admin-server/_gitignore +0 -0
  11. package/template-admin-server/boot.mjs +0 -0
  12. package/template-admin-server/package.json +0 -0
  13. package/template-admin-server/rome.json +0 -0
  14. package/template-admin-server/src/config/config.default.ts +0 -0
  15. package/template-admin-server/src/configuration.ts +0 -0
  16. package/template-admin-server/src/controller/admin.controller.ts +0 -0
  17. package/template-admin-server/src/controller/api.controller.ts +0 -0
  18. package/template-admin-server/src/controller/base.controller.ts +0 -0
  19. package/template-admin-server/src/controller/dto/api.ts +0 -0
  20. package/template-admin-server/src/controller/dto/index.ts +0 -0
  21. package/template-admin-server/src/controller/dto/menu.ts +0 -0
  22. package/template-admin-server/src/controller/dto/role.ts +0 -0
  23. package/template-admin-server/src/controller/dto/user.ts +0 -0
  24. package/template-admin-server/src/controller/menu.controller.ts +0 -0
  25. package/template-admin-server/src/controller/role.controller.ts +0 -0
  26. package/template-admin-server/src/controller/user.controller.ts +0 -0
  27. package/template-admin-server/src/entities/Api.ts +0 -0
  28. package/template-admin-server/src/entities/BaseCreate.ts +0 -0
  29. package/template-admin-server/src/entities/Menu.ts +0 -0
  30. package/template-admin-server/src/entities/Role.ts +0 -0
  31. package/template-admin-server/src/entities/User.ts +0 -0
  32. package/template-admin-server/src/entities/index.ts +0 -0
  33. package/template-admin-server/src/filter/default.filter.ts +0 -0
  34. package/template-admin-server/src/filter/notfound.filter.ts +0 -0
  35. package/template-admin-server/src/middleware/helper.middleware.ts +0 -0
  36. package/template-admin-server/src/middleware/index.ts +0 -0
  37. package/template-admin-server/src/middleware/jwt.middleware.ts +0 -0
  38. package/template-admin-server/src/middleware/report.middleware.ts +0 -0
  39. package/template-admin-server/src/service/api.service.ts +0 -0
  40. package/template-admin-server/src/service/basic.ts +0 -0
  41. package/template-admin-server/src/service/index.ts +0 -0
  42. package/template-admin-server/src/service/menu.service.ts +0 -0
  43. package/template-admin-server/src/service/role.service.ts +0 -0
  44. package/template-admin-server/src/service/user.service.ts +0 -0
  45. package/template-admin-server/src/strategy/jwt.strategy.ts +0 -0
  46. package/template-admin-server/src/types/index.ts +0 -0
  47. package/template-admin-server/src/types/types.d.ts +0 -0
  48. package/template-admin-server/tsconfig.json +0 -0
  49. package/template-nuxt-admin/.eslintrc +14 -0
  50. package/template-nuxt-admin/.vscode/extensions.json +12 -0
  51. package/template-nuxt-admin/.vscode/settings.json +25 -0
  52. package/template-nuxt-admin/Dockerfile +0 -0
  53. package/template-nuxt-admin/README.md +8 -2
  54. package/template-nuxt-admin/_gitignore +0 -0
  55. package/template-nuxt-admin/_npmrc +0 -0
  56. package/template-nuxt-admin/app.vue +12 -12
  57. package/template-nuxt-admin/boot.mjs +0 -0
  58. package/template-nuxt-admin/components/ScreenFull.vue +5 -4
  59. package/template-nuxt-admin/components/TopSearch.vue +35 -31
  60. package/template-nuxt-admin/components/TopUser.vue +12 -9
  61. package/template-nuxt-admin/components/YoungChangePassword.vue +51 -41
  62. package/template-nuxt-admin/components/YoungCodeInput.vue +31 -25
  63. package/template-nuxt-admin/components/YoungLink.vue +3 -2
  64. package/template-nuxt-admin/components/YoungLoading.vue +1 -1
  65. package/template-nuxt-admin/components/layout/Footer.vue +1 -1
  66. package/template-nuxt-admin/components/layout/Logo.vue +7 -5
  67. package/template-nuxt-admin/components/layout/Main.vue +2 -2
  68. package/template-nuxt-admin/components/layout/NavBar.vue +12 -9
  69. package/template-nuxt-admin/components/layout/SideBar.vue +6 -4
  70. package/template-nuxt-admin/components/layout/SubMenu.vue +12 -13
  71. package/template-nuxt-admin/components/layout/TabsBar.vue +45 -43
  72. package/template-nuxt-admin/composables/api.ts +39 -37
  73. package/template-nuxt-admin/composables/apis/delete.ts +7 -7
  74. package/template-nuxt-admin/composables/apis/get.ts +13 -13
  75. package/template-nuxt-admin/composables/apis/index.ts +4 -4
  76. package/template-nuxt-admin/composables/apis/patch.ts +11 -11
  77. package/template-nuxt-admin/composables/apis/post.ts +17 -17
  78. package/template-nuxt-admin/composables/config.ts +1 -1
  79. package/template-nuxt-admin/composables/icon.ts +4 -4
  80. package/template-nuxt-admin/composables/nav.ts +19 -21
  81. package/template-nuxt-admin/composables/tags.ts +41 -47
  82. package/template-nuxt-admin/composables/user.ts +10 -11
  83. package/template-nuxt-admin/config/.devrc +0 -0
  84. package/template-nuxt-admin/config/.onlinerc +0 -0
  85. package/template-nuxt-admin/config/.testrc +0 -0
  86. package/template-nuxt-admin/env.d.ts +0 -0
  87. package/template-nuxt-admin/error.vue +37 -29
  88. package/template-nuxt-admin/layouts/blank.vue +0 -0
  89. package/template-nuxt-admin/layouts/default.vue +18 -17
  90. package/template-nuxt-admin/middleware/auth.global.ts +27 -27
  91. package/template-nuxt-admin/nuxt.config.ts +8 -7
  92. package/template-nuxt-admin/package.json +36 -16
  93. package/template-nuxt-admin/pages/home/[id].vue +6 -6
  94. package/template-nuxt-admin/pages/index.vue +4 -4
  95. package/template-nuxt-admin/pages/login.vue +70 -52
  96. package/template-nuxt-admin/pages/system/api.vue +73 -60
  97. package/template-nuxt-admin/pages/system/hooks/useRole.ts +127 -128
  98. package/template-nuxt-admin/pages/system/menuList.vue +166 -141
  99. package/template-nuxt-admin/pages/system/role.vue +62 -34
  100. package/template-nuxt-admin/pages/system/user.vue +80 -69
  101. package/template-nuxt-admin/plugins/directive.ts +9 -9
  102. package/template-nuxt-admin/public/default_avatar.svg +0 -0
  103. package/template-nuxt-admin/public/favicon.ico +0 -0
  104. package/template-nuxt-admin/public/image_placeholder.svg +0 -0
  105. package/template-nuxt-admin/public/tabbar_bg.png +0 -0
  106. package/template-nuxt-admin/server/api/[...all].ts +3 -3
  107. package/template-nuxt-admin/server/plugins/env.ts +19 -20
  108. package/template-nuxt-admin/server/routes/get/env.ts +3 -3
  109. package/template-nuxt-admin/server/tsconfig.json +0 -0
  110. package/template-nuxt-admin/server/utils/index.ts +15 -14
  111. package/template-nuxt-admin/styles/element.scss +0 -0
  112. package/template-nuxt-admin/styles/index.scss +0 -0
  113. package/template-nuxt-admin/styles/variable.scss +0 -0
  114. package/template-nuxt-admin/tsconfig.json +0 -0
  115. package/template-nuxt-admin/typings/global.d.ts +0 -0
  116. package/template-nuxt-admin/typings/system.d.ts +0 -0
  117. package/template-nuxt-admin/typings/user.d.ts +0 -0
  118. package/template-nuxt-admin/uno.config.ts +1 -1
  119. package/template-nuxt-admin/utils/tool.ts +65 -65
  120. package/template-nuxt-admin/yarn.lock +2969 -1437
  121. package/template-uni-app/.eslintignore +1 -0
  122. package/template-uni-app/.eslintrc +16 -0
  123. package/template-uni-app/.vscode/.server-controller-port.log +5 -0
  124. package/template-uni-app/.vscode/css.code-snippets +0 -0
  125. package/template-uni-app/.vscode/extensions.json +5 -2
  126. package/template-uni-app/.vscode/js.code-snippets +0 -0
  127. package/template-uni-app/.vscode/settings.json +24 -6
  128. package/template-uni-app/.vscode/vue-html.code-snippets +0 -0
  129. package/template-uni-app/README.md +0 -0
  130. package/template-uni-app/_env +0 -0
  131. package/template-uni-app/_env.development +0 -0
  132. package/template-uni-app/_env.production +0 -0
  133. package/template-uni-app/_env.test +0 -0
  134. package/template-uni-app/_gitignore +0 -0
  135. package/template-uni-app/_npmrc +0 -0
  136. package/template-uni-app/auto-imports.d.ts +0 -0
  137. package/template-uni-app/components.d.ts +0 -0
  138. package/template-uni-app/custom-plugins/index.ts +2 -2
  139. package/template-uni-app/custom-plugins/multiconf.ts +17 -19
  140. package/template-uni-app/custom-plugins/polyfill.ts +9 -9
  141. package/template-uni-app/dist/dev/mp-weixin/apis/index.js +0 -0
  142. package/template-uni-app/dist/dev/mp-weixin/apis/lib/index.js +0 -0
  143. package/template-uni-app/dist/dev/mp-weixin/apis/requests/get.js +0 -0
  144. package/template-uni-app/dist/dev/mp-weixin/apis/requests/index.js +0 -0
  145. package/template-uni-app/dist/dev/mp-weixin/apis/requests/post.js +0 -0
  146. package/template-uni-app/dist/dev/mp-weixin/app.js +0 -0
  147. package/template-uni-app/dist/dev/mp-weixin/app.json +0 -0
  148. package/template-uni-app/dist/dev/mp-weixin/app.wxss +0 -0
  149. package/template-uni-app/dist/dev/mp-weixin/common/assets.js +0 -0
  150. package/template-uni-app/dist/dev/mp-weixin/common/vendor.js +0 -0
  151. package/template-uni-app/dist/dev/mp-weixin/components/young-loading/young-loading.js +0 -0
  152. package/template-uni-app/dist/dev/mp-weixin/components/young-loading/young-loading.json +0 -0
  153. package/template-uni-app/dist/dev/mp-weixin/components/young-loading/young-loading.wxml +0 -0
  154. package/template-uni-app/dist/dev/mp-weixin/components/young-loading/young-loading.wxss +0 -0
  155. package/template-uni-app/dist/dev/mp-weixin/components/young-loading-mini/young-loading-mini.js +0 -0
  156. package/template-uni-app/dist/dev/mp-weixin/components/young-loading-mini/young-loading-mini.json +0 -0
  157. package/template-uni-app/dist/dev/mp-weixin/components/young-loading-mini/young-loading-mini.wxml +0 -0
  158. package/template-uni-app/dist/dev/mp-weixin/components/young-loading-mini/young-loading-mini.wxss +0 -0
  159. package/template-uni-app/dist/dev/mp-weixin/components/young-navbar/young-navbar.js +0 -0
  160. package/template-uni-app/dist/dev/mp-weixin/components/young-navbar/young-navbar.json +0 -0
  161. package/template-uni-app/dist/dev/mp-weixin/components/young-navbar/young-navbar.wxml +0 -0
  162. package/template-uni-app/dist/dev/mp-weixin/components/young-navbar/young-navbar.wxss +0 -0
  163. package/template-uni-app/dist/dev/mp-weixin/components/young-tabbar/young-tabbar.js +0 -0
  164. package/template-uni-app/dist/dev/mp-weixin/components/young-tabbar/young-tabbar.json +0 -0
  165. package/template-uni-app/dist/dev/mp-weixin/components/young-tabbar/young-tabbar.wxml +0 -0
  166. package/template-uni-app/dist/dev/mp-weixin/components/young-tabbar/young-tabbar.wxss +0 -0
  167. package/template-uni-app/dist/dev/mp-weixin/config/enum.js +0 -0
  168. package/template-uni-app/dist/dev/mp-weixin/config/index.js +0 -0
  169. package/template-uni-app/dist/dev/mp-weixin/config/map.js +0 -0
  170. package/template-uni-app/dist/dev/mp-weixin/layouts/default.js +0 -0
  171. package/template-uni-app/dist/dev/mp-weixin/layouts/default.json +0 -0
  172. package/template-uni-app/dist/dev/mp-weixin/layouts/default.wxml +0 -0
  173. package/template-uni-app/dist/dev/mp-weixin/layouts/default.wxss +0 -0
  174. package/template-uni-app/dist/dev/mp-weixin/layouts/tabbar.js +0 -0
  175. package/template-uni-app/dist/dev/mp-weixin/layouts/tabbar.json +0 -0
  176. package/template-uni-app/dist/dev/mp-weixin/layouts/tabbar.wxml +0 -0
  177. package/template-uni-app/dist/dev/mp-weixin/layouts/tabbar.wxss +0 -0
  178. package/template-uni-app/dist/dev/mp-weixin/node-modules/@dcloudio/uni-ui/lib/uni-card/uni-card.js +0 -0
  179. package/template-uni-app/dist/dev/mp-weixin/node-modules/@dcloudio/uni-ui/lib/uni-card/uni-card.json +0 -0
  180. package/template-uni-app/dist/dev/mp-weixin/node-modules/@dcloudio/uni-ui/lib/uni-card/uni-card.wxml +0 -0
  181. package/template-uni-app/dist/dev/mp-weixin/node-modules/@dcloudio/uni-ui/lib/uni-card/uni-card.wxss +0 -0
  182. package/template-uni-app/dist/dev/mp-weixin/pages/demo/index.js +0 -0
  183. package/template-uni-app/dist/dev/mp-weixin/pages/demo/index.json +0 -0
  184. package/template-uni-app/dist/dev/mp-weixin/pages/demo/index.wxml +0 -0
  185. package/template-uni-app/dist/dev/mp-weixin/pages/demo/index.wxss +0 -0
  186. package/template-uni-app/dist/dev/mp-weixin/pages/index.js +0 -0
  187. package/template-uni-app/dist/dev/mp-weixin/pages/index.json +0 -0
  188. package/template-uni-app/dist/dev/mp-weixin/pages/index.wxml +0 -0
  189. package/template-uni-app/dist/dev/mp-weixin/pages/index.wxss +0 -0
  190. package/template-uni-app/dist/dev/mp-weixin/pages/my.js +0 -0
  191. package/template-uni-app/dist/dev/mp-weixin/pages/my.json +0 -0
  192. package/template-uni-app/dist/dev/mp-weixin/pages/my.wxml +0 -0
  193. package/template-uni-app/dist/dev/mp-weixin/pages/my.wxss +0 -0
  194. package/template-uni-app/dist/dev/mp-weixin/project.config.json +0 -0
  195. package/template-uni-app/dist/dev/mp-weixin/static/back.png +0 -0
  196. package/template-uni-app/dist/dev/mp-weixin/static/h.png +0 -0
  197. package/template-uni-app/dist/dev/mp-weixin/static/home.png +0 -0
  198. package/template-uni-app/dist/dev/mp-weixin/static/home_active.png +0 -0
  199. package/template-uni-app/dist/dev/mp-weixin/static/more.png +0 -0
  200. package/template-uni-app/dist/dev/mp-weixin/static/my.png +0 -0
  201. package/template-uni-app/dist/dev/mp-weixin/static/my_active.png +0 -0
  202. package/template-uni-app/dist/dev/mp-weixin/static/network.png +0 -0
  203. package/template-uni-app/dist/dev/mp-weixin/store/index.js +0 -0
  204. package/template-uni-app/dist/dev/mp-weixin/store/local/index.js +0 -0
  205. package/template-uni-app/dist/dev/mp-weixin/store/system.js +0 -0
  206. package/template-uni-app/dist/dev/mp-weixin/utils/modal.js +0 -0
  207. package/template-uni-app/dist/dev/mp-weixin/utils/route.js +0 -0
  208. package/template-uni-app/dist/dev/mp-weixin/utils/system.js +0 -0
  209. package/template-uni-app/index.html +0 -0
  210. package/template-uni-app/manifest.config.ts +11 -11
  211. package/template-uni-app/package.json +24 -6
  212. package/template-uni-app/pages.config.ts +11 -11
  213. package/template-uni-app/pnpm-lock.yaml +2677 -500
  214. package/template-uni-app/src/App.vue +24 -26
  215. package/template-uni-app/src/apis/index.ts +15 -14
  216. package/template-uni-app/src/apis/lib/index.ts +77 -78
  217. package/template-uni-app/src/apis/requests/get.ts +38 -38
  218. package/template-uni-app/src/apis/requests/index.ts +2 -2
  219. package/template-uni-app/src/apis/requests/post.ts +8 -8
  220. package/template-uni-app/src/components/young-loading/young-loading.vue +14 -9
  221. package/template-uni-app/src/components/young-loading-mini/young-loading-mini.vue +13 -9
  222. package/template-uni-app/src/components/young-navbar/young-navbar.vue +43 -44
  223. package/template-uni-app/src/components/young-tabbar/young-tabbar.vue +39 -35
  224. package/template-uni-app/src/config/enum.ts +1 -1
  225. package/template-uni-app/src/config/index.ts +2 -2
  226. package/template-uni-app/src/config/map.ts +4 -4
  227. package/template-uni-app/src/env.d.ts +0 -0
  228. package/template-uni-app/src/layouts/default.vue +6 -7
  229. package/template-uni-app/src/layouts/tabbar.vue +15 -12
  230. package/template-uni-app/src/main.ts +7 -7
  231. package/template-uni-app/src/manifest.json +1 -1
  232. package/template-uni-app/src/pages/demo/index.vue +16 -10
  233. package/template-uni-app/src/pages/index.vue +36 -20
  234. package/template-uni-app/src/pages/my.vue +7 -5
  235. package/template-uni-app/src/pages.json +1 -1
  236. package/template-uni-app/src/static/back.png +0 -0
  237. package/template-uni-app/src/static/h.png +0 -0
  238. package/template-uni-app/src/static/home.png +0 -0
  239. package/template-uni-app/src/static/home_active.png +0 -0
  240. package/template-uni-app/src/static/more.png +0 -0
  241. package/template-uni-app/src/static/my.png +0 -0
  242. package/template-uni-app/src/static/my_active.png +0 -0
  243. package/template-uni-app/src/static/network.png +0 -0
  244. package/template-uni-app/src/store/index.ts +6 -6
  245. package/template-uni-app/src/store/local/index.ts +23 -21
  246. package/template-uni-app/src/store/system.ts +10 -10
  247. package/template-uni-app/src/typings/global.d.ts +0 -0
  248. package/template-uni-app/src/uni.scss +0 -0
  249. package/template-uni-app/src/utils/auth.ts +93 -84
  250. package/template-uni-app/src/utils/index.ts +5 -5
  251. package/template-uni-app/src/utils/map.ts +45 -45
  252. package/template-uni-app/src/utils/modal.ts +49 -50
  253. package/template-uni-app/src/utils/route.ts +40 -38
  254. package/template-uni-app/src/utils/system.ts +25 -24
  255. package/template-uni-app/tsconfig.json +11 -11
  256. package/template-uni-app/unocss.config.ts +4 -4
  257. package/template-uni-app/vite.config.ts +15 -15
  258. package/template-uni-app/volar.config.js +2 -2
  259. package/template-vue-admin/.vscode/extensions.json +0 -0
  260. package/template-vue-admin/.vscode/list-add.code-snippets +0 -0
  261. package/template-vue-admin/.vscode/list-export.code-snippets +0 -0
  262. package/template-vue-admin/.vscode/list.code-snippets +0 -0
  263. package/template-vue-admin/.vscode/settings.json +0 -0
  264. package/template-vue-admin/Dockerfile +0 -0
  265. package/template-vue-admin/README.md +0 -0
  266. package/template-vue-admin/_env +0 -0
  267. package/template-vue-admin/_gitignore +0 -0
  268. package/template-vue-admin/boot.mjs +0 -0
  269. package/template-vue-admin/build/custom-plugin.ts +0 -0
  270. package/template-vue-admin/build/index.ts +0 -0
  271. package/template-vue-admin/build/plugins.ts +0 -0
  272. package/template-vue-admin/config/.devrc +0 -0
  273. package/template-vue-admin/config/.onlinerc +0 -0
  274. package/template-vue-admin/config/.testrc +0 -0
  275. package/template-vue-admin/index.html +0 -0
  276. package/template-vue-admin/nitro.config.ts +0 -0
  277. package/template-vue-admin/package.json +0 -0
  278. package/template-vue-admin/plugins/init.ts +0 -0
  279. package/template-vue-admin/public/vite.svg +0 -0
  280. package/template-vue-admin/rome.json +0 -0
  281. package/template-vue-admin/routes/api/[...all].ts +0 -0
  282. package/template-vue-admin/routes/get/env.ts +0 -0
  283. package/template-vue-admin/src/App.vue +0 -0
  284. package/template-vue-admin/src/apis/delete.ts +0 -0
  285. package/template-vue-admin/src/apis/get.ts +0 -0
  286. package/template-vue-admin/src/apis/index.ts +0 -0
  287. package/template-vue-admin/src/apis/patch.ts +0 -0
  288. package/template-vue-admin/src/apis/post.ts +0 -0
  289. package/template-vue-admin/src/assets/img/login_background.jpg +0 -0
  290. package/template-vue-admin/src/auto-components.d.ts +0 -0
  291. package/template-vue-admin/src/auto-imports.d.ts +0 -0
  292. package/template-vue-admin/src/layouts/blank.vue +0 -0
  293. package/template-vue-admin/src/layouts/default/components/Link.vue +0 -0
  294. package/template-vue-admin/src/layouts/default/components/Logo.vue +0 -0
  295. package/template-vue-admin/src/layouts/default/components/Menu.vue +0 -0
  296. package/template-vue-admin/src/layouts/default/components/NavSearch.vue +0 -0
  297. package/template-vue-admin/src/layouts/default/components/ScrollPane.vue +0 -0
  298. package/template-vue-admin/src/layouts/default/components/TagsView.vue +0 -0
  299. package/template-vue-admin/src/layouts/default/components/TopMenu.vue +0 -0
  300. package/template-vue-admin/src/layouts/default/components/UserCenter.vue +0 -0
  301. package/template-vue-admin/src/layouts/default/index.vue +0 -0
  302. package/template-vue-admin/src/main.ts +0 -0
  303. package/template-vue-admin/src/modules/1-router.ts +0 -0
  304. package/template-vue-admin/src/modules/2-pinia.ts +0 -0
  305. package/template-vue-admin/src/modules/3-net.ts +0 -0
  306. package/template-vue-admin/src/modules/4-auth.ts +0 -0
  307. package/template-vue-admin/src/modules/5-checkupdate.ts +0 -0
  308. package/template-vue-admin/src/shims.d.ts +0 -0
  309. package/template-vue-admin/src/stores/index.ts +0 -0
  310. package/template-vue-admin/src/stores/local/index.ts +0 -0
  311. package/template-vue-admin/src/stores/session/index.ts +0 -0
  312. package/template-vue-admin/src/stores/tags.ts +0 -0
  313. package/template-vue-admin/src/typings/global.d.ts +0 -0
  314. package/template-vue-admin/src/typings/index.ts +0 -0
  315. package/template-vue-admin/src/typings/system.d.ts +0 -0
  316. package/template-vue-admin/src/views/403.vue +0 -0
  317. package/template-vue-admin/src/views/[...all_404].vue +0 -0
  318. package/template-vue-admin/src/views/base/login.vue +0 -0
  319. package/template-vue-admin/src/views/dashboard/[name].vue +0 -0
  320. package/template-vue-admin/src/views/index.vue +0 -0
  321. package/template-vue-admin/src/views/system/api.vue +0 -0
  322. package/template-vue-admin/src/views/system/hooks/useRole.ts +0 -0
  323. package/template-vue-admin/src/views/system/menuList.vue +0 -0
  324. package/template-vue-admin/src/views/system/role.vue +0 -0
  325. package/template-vue-admin/src/views/system/user.vue +0 -0
  326. package/template-vue-admin/src/vite-env.d.ts +0 -0
  327. package/template-vue-admin/tsconfig.json +0 -0
  328. package/template-vue-admin/tsconfig.node.json +0 -0
  329. package/template-vue-admin/unocss.config.ts +0 -0
  330. package/template-vue-admin/vite.config.ts +0 -0
  331. package/template-vue-mobile/.vscode/base.code-snippets +0 -0
  332. package/template-vue-mobile/.vscode/extensions.json +0 -0
  333. package/template-vue-mobile/.vscode/settings.json +0 -0
  334. package/template-vue-mobile/Dockerfile +0 -0
  335. package/template-vue-mobile/README.md +0 -0
  336. package/template-vue-mobile/_env +0 -0
  337. package/template-vue-mobile/_gitignore +0 -0
  338. package/template-vue-mobile/boot.mjs +0 -0
  339. package/template-vue-mobile/build/custom-plugin.ts +0 -0
  340. package/template-vue-mobile/build/index.ts +0 -0
  341. package/template-vue-mobile/build/plugins.ts +0 -0
  342. package/template-vue-mobile/config/.devrc +0 -0
  343. package/template-vue-mobile/config/.onlinerc +0 -0
  344. package/template-vue-mobile/config/.testrc +0 -0
  345. package/template-vue-mobile/index.html +0 -0
  346. package/template-vue-mobile/nitro.config.ts +0 -0
  347. package/template-vue-mobile/package.json +0 -0
  348. package/template-vue-mobile/plugins/env.ts +0 -0
  349. package/template-vue-mobile/public/vite.svg +0 -0
  350. package/template-vue-mobile/rome.json +0 -0
  351. package/template-vue-mobile/routes/[...all].ts +0 -0
  352. package/template-vue-mobile/routes/get/env.ts +0 -0
  353. package/template-vue-mobile/src/App.vue +0 -0
  354. package/template-vue-mobile/src/auto-components.d.ts +0 -0
  355. package/template-vue-mobile/src/auto-imports.d.ts +0 -0
  356. package/template-vue-mobile/src/components/Init.vue +0 -0
  357. package/template-vue-mobile/src/global.d.ts +0 -0
  358. package/template-vue-mobile/src/hooks/useVerifyCode.ts +0 -0
  359. package/template-vue-mobile/src/layouts/blank.vue +0 -0
  360. package/template-vue-mobile/src/layouts/default.vue +0 -0
  361. package/template-vue-mobile/src/layouts/sub.vue +0 -0
  362. package/template-vue-mobile/src/main.ts +0 -0
  363. package/template-vue-mobile/src/modules/1-router.ts +0 -0
  364. package/template-vue-mobile/src/modules/2-pinia.ts +0 -0
  365. package/template-vue-mobile/src/modules/3-net.ts +0 -0
  366. package/template-vue-mobile/src/modules/4-auth.ts +0 -0
  367. package/template-vue-mobile/src/views/[...all_404].vue +0 -0
  368. package/template-vue-mobile/src/views/base/login.vue +0 -0
  369. package/template-vue-mobile/src/views/base/resetPasswd.vue +0 -0
  370. package/template-vue-mobile/src/views/index.vue +0 -0
  371. package/template-vue-mobile/src/views/my.vue +0 -0
  372. package/template-vue-mobile/src/views/sub.vue +0 -0
  373. package/template-vue-mobile/src/vite-env.d.ts +0 -0
  374. package/template-vue-mobile/tsconfig.json +0 -0
  375. package/template-vue-mobile/tsconfig.node.json +0 -0
  376. package/template-vue-mobile/unocss.config.ts +0 -0
  377. package/template-vue-mobile/vite.config.ts +0 -0
  378. package/template-vue-mobile/yarn.lock +0 -0
  379. package/template-vue-thin/.vscode/extensions.json +0 -0
  380. package/template-vue-thin/.vscode/settings.json +0 -0
  381. package/template-vue-thin/README.md +0 -0
  382. package/template-vue-thin/_env +0 -0
  383. package/template-vue-thin/_gitignore +0 -0
  384. package/template-vue-thin/index.html +0 -0
  385. package/template-vue-thin/package.json +0 -0
  386. package/template-vue-thin/public/vite.svg +0 -0
  387. package/template-vue-thin/src/App.vue +0 -0
  388. package/template-vue-thin/src/layouts/blank.vue +0 -0
  389. package/template-vue-thin/src/layouts/default.vue +0 -0
  390. package/template-vue-thin/src/layouts/list.vue +0 -0
  391. package/template-vue-thin/src/main.ts +0 -0
  392. package/template-vue-thin/src/views/[...all_404].vue +0 -0
  393. package/template-vue-thin/src/views/index.vue +0 -0
  394. package/template-vue-thin/src/views/list.vue +0 -0
  395. package/template-vue-thin/src/vite-env.d.ts +0 -0
  396. package/template-vue-thin/tsconfig.json +0 -0
  397. package/template-vue-thin/tsconfig.node.json +0 -0
  398. package/template-vue-thin/unocss.config.ts +0 -0
  399. package/template-vue-thin/vite.config.ts +0 -0
  400. package/template-nuxt-admin/rome.json +0 -26
  401. package/template-uni-app/rome.json +0 -26
@@ -5,46 +5,46 @@
5
5
  * @Description:
6
6
  */
7
7
  export default defineNuxtRouteMiddleware(async (to, from) => {
8
- if (to.matched.length === 0) {
9
- throw createError({ message: '页面不存在', statusCode: 404 });
10
- }
8
+ if (to.matched.length === 0)
9
+ throw createError({ message: '页面不存在', statusCode: 404 })
11
10
 
12
- const { hasLogin } = storeToRefs(useUserStore());
13
- const { nav_arr, flat_nav_arr } = storeToRefs(useNavStore());
11
+ const { hasLogin } = storeToRefs(useUserStore())
12
+ const { nav_arr, flat_nav_arr } = storeToRefs(useNavStore())
14
13
 
15
14
  const changeTitle = () => {
16
- const nav = flat_nav_arr.value.find((item) => item.component === to.path);
17
- if (nav && nav.title) {
18
- to.meta.title = nav.title;
19
- }
15
+ const nav = flat_nav_arr.value.find(item => item.component === to.path)
16
+ if (nav && nav.title)
17
+ to.meta.title = nav.title
20
18
 
21
- document.title = (to.meta.title as string) || window.__YOUNG_ENV__.NUXT_PUBLIC_TITLE;
22
- };
19
+ document.title = (to.meta.title as string) || window.__YOUNG_ENV__.NUXT_PUBLIC_TITLE
20
+ }
23
21
 
24
- const { addView } = useTagsStore();
22
+ const { addView } = useTagsStore()
25
23
 
26
24
  // 页面无需登录
27
25
  if (to.meta.auth === false) {
28
- changeTitle();
29
- addView(to);
30
- return;
26
+ changeTitle()
27
+ addView(to)
28
+ return
31
29
  }
32
30
 
33
31
  if (!hasLogin.value && to.path !== '/login') {
34
32
  // 页面需要登录,但是未登录
35
- showFailToast('未登录或登录过期,请重新登录');
36
- return navigateTo(`/login?redirect=${encodeURIComponent(to.fullPath)}`);
37
- } else if (hasLogin.value && to.path === '/login') {
33
+ showFailToast('未登录或登录过期,请重新登录')
34
+ return navigateTo(`/login?redirect=${encodeURIComponent(to.fullPath)}`)
35
+ }
36
+ else if (hasLogin.value && to.path === '/login') {
38
37
  // 已登录进入登录页
39
- return navigateTo('/');
40
- } else {
41
- nav_arr.value.length === 0 && (await generateNavData());
38
+ return navigateTo('/')
39
+ }
40
+ else {
41
+ nav_arr.value.length === 0 && (await generateNavData())
42
42
  if (hasPermission(to.path)) {
43
- changeTitle();
44
- addView(to);
45
- return;
46
- } else {
47
- throw createError({ message: '无权限,请联系系统管理员', statusCode: 403 });
43
+ changeTitle()
44
+ addView(to)
45
+ }
46
+ else {
47
+ throw createError({ message: '无权限,请联系系统管理员', statusCode: 403 })
48
48
  }
49
49
  }
50
- });
50
+ })
@@ -1,10 +1,10 @@
1
1
  /*
2
2
  * @Author: zhangyang
3
3
  * @Date: 2023-05-25 19:45:20
4
- * @LastEditTime: 2023-07-28 17:35:11
4
+ * @LastEditTime: 2023-09-06 16:13:06
5
5
  * @Description:
6
6
  */
7
- import { resolve } from 'node:path';
7
+ import { resolve } from 'node:path'
8
8
 
9
9
  // https://nuxt.com/docs/api/configuration/nuxt-config
10
10
  export default defineNuxtConfig({
@@ -56,7 +56,7 @@ export default defineNuxtConfig({
56
56
  // native: true,
57
57
  // js 实现,仅指令生效 v-lazy-load
58
58
  // directiveOnly: true,
59
- // @ts-ignore js 实现的占位图
59
+ // @ts-expect-error js 实现的占位图
60
60
  defaultImage: '/image_placeholder.svg',
61
61
  },
62
62
 
@@ -66,9 +66,10 @@ export default defineNuxtConfig({
66
66
  },
67
67
  },
68
68
 
69
- devtools: {
70
- enabled: true,
71
- },
69
+ // 开发调试工具,按需启用
70
+ // devtools: {
71
+ // enabled: true,
72
+ // },
72
73
 
73
74
  modules: [
74
75
  '@vueuse/nuxt',
@@ -98,4 +99,4 @@ export default defineNuxtConfig({
98
99
  },
99
100
  },
100
101
  },
101
- });
102
+ })
@@ -1,44 +1,64 @@
1
1
  {
2
2
  "name": "nuxt-app",
3
+ "version": "0.0.0",
3
4
  "private": true,
4
5
  "scripts": {
5
6
  "build": "nuxt build",
6
7
  "dev": "nuxt dev --host",
7
8
  "generate": "nuxt generate",
8
9
  "preview": "nuxt preview --host",
9
- "postinstall": "nuxt prepare"
10
+ "postinstall": "nuxt prepare",
11
+ "lint": "eslint .",
12
+ "lint:fix": "eslint . --fix"
13
+ },
14
+ "dependencies": {
15
+ "@bluesyoung/casdoor-auth": "^0.1.0",
16
+ "@bluesyoung/http": "^0.3.4",
17
+ "@bluesyoung/ui-vue3": "^0.1.1",
18
+ "@bluesyoung/ui-vue3-element-plus": "0.11.6",
19
+ "@bluesyoung/utils": "0.2.1",
20
+ "@wangeditor/editor": "^5.1.23",
21
+ "@wangeditor/editor-for-vue": "^5.1.12",
22
+ "c12": "^1.4.2",
23
+ "file-saver": "^2.0.5",
24
+ "http-proxy": "^1.18.1",
25
+ "jszip": "^3.10.1",
26
+ "md5": "^2.3.0",
27
+ "qrcode": "^1.5.3",
28
+ "sortablejs": "^1.15.0",
29
+ "vue-cropper": "^1.0.9"
10
30
  },
11
31
  "devDependencies": {
32
+ "@antfu/eslint-config": "^0.41.0",
12
33
  "@bluesyoung/logger": "^0.0.1",
13
34
  "@element-plus/nuxt": "^1.0.5",
14
35
  "@iconify/json": "^2.2.93",
15
36
  "@nuxt/devtools": "^0.8.2",
16
37
  "@pinia/nuxt": "^0.4.11",
17
38
  "@types/file-saver": "^2.0.5",
18
- "@types/node": "20.5.7",
39
+ "@types/md5": "^2.3.2",
40
+ "@types/node": "20.5.9",
19
41
  "@types/qrcode": "^1.5.1",
20
- "@unocss/nuxt": "^0.55.4",
42
+ "@unocss/nuxt": "^0.55.6",
21
43
  "@vant/nuxt": "^1.0.2",
22
44
  "@vueuse/nuxt": "^10.2.1",
45
+ "add": "^2.0.6",
23
46
  "dayjs": "^1.11.9",
24
47
  "element-plus": "^2.3.8",
25
- "nuxt": "^3.7.0",
48
+ "eslint": "^8.48.0",
49
+ "lint-staged": "^14.0.1",
50
+ "nuxt": "^3.7.1",
26
51
  "nuxt-lazy-load": "^3.0.4",
27
52
  "pinia": "^2.1.4",
28
53
  "sass": "^1.64.0",
54
+ "simple-git-hooks": "^2.9.0",
55
+ "typescript": "^5.2.2",
29
56
  "vant": "^4.6.2"
30
57
  },
31
- "dependencies": {
32
- "@bluesyoung/http": "0.3.4",
33
- "@bluesyoung/ui-vue3": "^0.1.1",
34
- "@bluesyoung/ui-vue3-element-plus": "0.11.5",
35
- "@bluesyoung/utils": "^0.2.1",
36
- "c12": "^1.4.2",
37
- "file-saver": "^2.0.5",
38
- "http-proxy": "^1.18.1",
39
- "jszip": "^3.10.1",
40
- "qrcode": "^1.5.3",
41
- "sortablejs": "^1.15.0",
42
- "vue-cropper": "^0.6.2"
58
+ "simple-git-hooks": {
59
+ "pre-commit": "npx lint-staged"
60
+ },
61
+ "lint-staged": {
62
+ "*": "eslint --fix"
43
63
  }
44
64
  }
@@ -8,15 +8,15 @@
8
8
  definePageMeta({
9
9
  title: '工作台',
10
10
  auth: false,
11
- noCache: true
12
- });
11
+ noCache: true,
12
+ })
13
13
 
14
- const { nick } = storeToRefs(useUserStore());
15
- const { nav_arr } = storeToRefs(useNavStore());
14
+ const { nick } = storeToRefs(useUserStore())
15
+ const { nav_arr } = storeToRefs(useNavStore())
16
16
 
17
17
  onMounted(() => {
18
- nav_arr.value.length === 0 && generateNavData();
19
- });
18
+ nav_arr.value.length === 0 && generateNavData()
19
+ })
20
20
  </script>
21
21
 
22
22
  <template>
@@ -6,13 +6,13 @@
6
6
  -->
7
7
  <script setup lang="ts">
8
8
  definePageMeta({
9
- noCache: true
10
- });
9
+ noCache: true,
10
+ })
11
11
 
12
12
  navigateTo({
13
13
  path: '/home/index',
14
- replace: true
15
- });
14
+ replace: true,
15
+ })
16
16
  </script>
17
17
 
18
18
  <template>
@@ -5,15 +5,15 @@
5
5
  * @Description:
6
6
  -->
7
7
  <script lang="ts" setup>
8
- import { isMobile } from '@bluesyoung/utils';
9
- import type { FormInstance } from 'element-plus';
8
+ import { isMobile } from '@bluesyoung/utils'
9
+ import type { FormInstance } from 'element-plus'
10
10
 
11
11
  definePageMeta({
12
12
  auth: false,
13
13
  title: '用户登录',
14
14
  noCache: true,
15
- layout: 'blank'
16
- });
15
+ layout: 'blank',
16
+ })
17
17
 
18
18
  const {
19
19
  NUXT_PUBLIC_LOGIN_LOGO: LoginLogo,
@@ -21,91 +21,104 @@ const {
21
21
  NUXT_PUBLIC_TITLE: Title,
22
22
  NUXT_PUBLIC_SUB_TITLE: SubTitle,
23
23
  NUXT_PUBLIC_SLOGAN: SloGan,
24
- NUXT_PUBLIC_CURRENT_VERSION: Version
25
- } = window.__YOUNG_ENV__;
24
+ NUXT_PUBLIC_CURRENT_VERSION: Version,
25
+ } = window.__YOUNG_ENV__
26
26
 
27
- const { SaveFlag, hasLogin, cookie } = storeToRefs(useUserStore());
27
+ const { SaveFlag, hasLogin, cookie } = storeToRefs(useUserStore())
28
28
 
29
- const loginType = ref<'account' | 'code'>('account');
29
+ const loginType = ref<'account' | 'code'>('account')
30
30
 
31
31
  const form = reactive<LoginForm>({
32
32
  mobile: '',
33
33
  vercode: '',
34
34
  password: '',
35
- });
35
+ })
36
36
 
37
- const formRef = ref<FormInstance>();
37
+ const formRef = ref<FormInstance>()
38
38
 
39
- const loginHandler = () => {
39
+ function loginHandler() {
40
40
  formRef.value?.validate(async (valid: boolean) => {
41
41
  try {
42
42
  if (valid) {
43
- const { enter } = useFullscreen();
44
- const { width, height } = useWindowSize();
43
+ const { enter } = useFullscreen()
44
+ const { width, height } = useWindowSize()
45
45
 
46
- const data = await apis.post.login(form);
46
+ const data = await apis.post.login(form)
47
47
  if (data) {
48
- cookie.value = data;
49
- height.value > width.value && enter();
50
- showSuccessToast('登录成功!');
51
- navigateTo('/');
48
+ cookie.value = data
49
+ height.value > width.value && enter()
50
+ showSuccessToast('登录成功!')
51
+ navigateTo('/')
52
52
  }
53
- } else {
54
- ElMessage.error('请仔细检查输入内容');
55
- return;
56
53
  }
57
- } catch (error) {
58
- console.error(error);
54
+ else {
55
+ ElMessage.error('请仔细检查输入内容')
56
+ }
57
+ }
58
+ catch (error) {
59
+ console.error(error)
59
60
  }
60
- });
61
- };
61
+ })
62
+ }
62
63
 
63
64
  onMounted(() => {
64
65
  if (SaveFlag.value && hasLogin.value) {
65
66
  navigateTo({
66
67
  path: '/',
67
- replace: true
68
- });
68
+ replace: true,
69
+ })
69
70
  }
70
- });
71
+ })
71
72
  </script>
72
73
 
73
74
  <template>
74
- <img :src="LoginBg" class="absolute object-center object-cover w-100vw h-100vh blur-6 brightness-50" />
75
+ <img :src="LoginBg" class="absolute object-center object-cover w-100vw h-100vh blur-6 brightness-50">
75
76
  <div class="flex flex-col items-center login-container pt-6%">
76
77
  <div class="w-80px h-80px">
77
- <img class="h-full" :src="LoginLogo" referrerpolicy="no-referrer" />
78
+ <img class="h-full" :src="LoginLogo" referrerpolicy="no-referrer">
78
79
  </div>
79
- <div class="title">{{ Title }}</div>
80
- <div v-if="SubTitle" v-html="SubTitle" class="sub-title" />
80
+ <div class="title">
81
+ {{ Title }}
82
+ </div>
83
+ <div v-if="SubTitle" class="sub-title" v-html="SubTitle" />
81
84
 
82
85
  <ElCard class="w-430px mt-3%" lt-sm="w-[96%] mx-[2%]">
83
86
  <ElForm ref="formRef" :model="form">
84
87
  <VanTabs v-model:active="loginType" size="large" @change="formRef?.resetFields?.()">
85
88
  <VanTab name="account" title="账密登录">
86
- <ElFormItem prop="mobile" :rules="[
87
- { required: true, trigger: 'blur', message: '请输入手机号' },
88
- { message: '请输入合法的手机号', trigger: 'blur', validator: (_: any, v: string) => isMobile(v) }
89
- ]" class="mt-20px">
89
+ <ElFormItem
90
+ prop="mobile" :rules="[
91
+ { required: true, trigger: 'blur', message: '请输入手机号' },
92
+ { message: '请输入合法的手机号', trigger: 'blur', validator: (_: any, v: string) => isMobile(v) },
93
+ ]" class="mt-20px"
94
+ >
90
95
  <ElInput v-model.trim="form.mobile" placeholder="请输入手机号" maxlength="11" class="!h-52px" clearable />
91
96
  </ElFormItem>
92
- <ElFormItem v-if="loginType === 'account'" prop="password" :rules="[
93
- { required: true, trigger: 'blur', message: '请输入密码' },
94
- { min: 8, max: 16, trigger: 'blur', message: '请输入8-16位字符!' }
95
- ]">
96
- <ElInput type="password" v-model.trim="form.password" minlength="8" maxlength="16" placeholder="请输入密码"
97
- class="!h-52px" clearable show-password @keyup.enter="loginHandler" />
97
+ <ElFormItem
98
+ v-if="loginType === 'account'" prop="password" :rules="[
99
+ { required: true, trigger: 'blur', message: '请输入密码' },
100
+ { min: 8, max: 16, trigger: 'blur', message: '请输入8-16位字符!' },
101
+ ]"
102
+ >
103
+ <ElInput
104
+ v-model.trim="form.password" type="password" minlength="8" maxlength="16" placeholder="请输入密码"
105
+ class="!h-52px" clearable show-password @keyup.enter="loginHandler"
106
+ />
98
107
  </ElFormItem>
99
108
  </VanTab>
100
109
  <VanTab name="code" title="短信登录">
101
- <ElFormItem prop="mobile" :rules="[
102
- { required: true, trigger: 'blur', message: '请输入手机号' },
103
- { message: '请输入合法的手机号', trigger: 'blur', validator: (_: any, v: string) => isMobile(v) }
104
- ]" class="mt-20px">
110
+ <ElFormItem
111
+ prop="mobile" :rules="[
112
+ { required: true, trigger: 'blur', message: '请输入手机号' },
113
+ { message: '请输入合法的手机号', trigger: 'blur', validator: (_: any, v: string) => isMobile(v) },
114
+ ]" class="mt-20px"
115
+ >
105
116
  <ElInput v-model.trim="form.mobile" placeholder="请输入手机号" maxlength="11" class="!h-52px" clearable />
106
117
  </ElFormItem>
107
- <ElFormItem v-if="loginType === 'code'" prop="vercode"
108
- :rules="[{ required: true, trigger: 'blur', message: '请输入验证码' }]">
118
+ <ElFormItem
119
+ v-if="loginType === 'code'" prop="vercode"
120
+ :rules="[{ required: true, trigger: 'blur', message: '请输入验证码' }]"
121
+ >
109
122
  <YoungCodeInput v-model.trim="form.vercode" :tel="form.mobile" @enter="loginHandler" />
110
123
  </ElFormItem>
111
124
  </VanTab>
@@ -113,8 +126,12 @@ onMounted(() => {
113
126
 
114
127
  <ElFormItem>
115
128
  <div class="flex justify-between w-full">
116
- <ElCheckbox v-model="SaveFlag">三天之内免登录</ElCheckbox>
117
- <ElButton v-show="loginType === 'account'" type="warning" @click="useChangePassword" link>忘记密码?</ElButton>
129
+ <ElCheckbox v-model="SaveFlag">
130
+ 三天之内免登录
131
+ </ElCheckbox>
132
+ <ElButton v-show="loginType === 'account'" type="warning" link @click="useChangePassword">
133
+ 忘记密码?
134
+ </ElButton>
118
135
  </div>
119
136
  </ElFormItem>
120
137
  </ElForm>
@@ -128,7 +145,9 @@ onMounted(() => {
128
145
  {{ SloGan }}
129
146
  </div>
130
147
  <div class="content-wrapper">
131
- <div class="mb-5% text-[#c0c0c0] text-16px">{{ Version }}</div>
148
+ <div class="mb-5% text-[#c0c0c0] text-16px">
149
+ {{ Version }}
150
+ </div>
132
151
  </div>
133
152
  </div>
134
153
  </template>
@@ -176,4 +195,3 @@ onMounted(() => {
176
195
  }
177
196
  }
178
197
  </style>
179
-
@@ -5,24 +5,24 @@
5
5
  * @Description:
6
6
  -->
7
7
  <script lang="ts" setup>
8
- import { useFormMode, YoungDialog, YoungTablePro, YoungPagination, YoungSelect, useQuery, YoungSearchForm } from '@bluesyoung/ui-vue3-element-plus';
9
- import type { TableDataItem, TableHeadItem, SelectOptionItem, YoungSearchScheme } from '@bluesyoung/ui-vue3-element-plus';
10
- import { deepClone } from '@bluesyoung/utils';
11
- import { ElButton, ElTag } from 'element-plus';
8
+ import { YoungDialog, YoungPagination, YoungSearchForm, YoungSelect, YoungTablePro, useFormMode, useQuery } from '@bluesyoung/ui-vue3-element-plus'
9
+ import type { SelectOptionItem, TableDataItem, TableHeadItem, YoungSearchScheme } from '@bluesyoung/ui-vue3-element-plus'
10
+ import { deepClone } from '@bluesyoung/utils'
11
+ import { ElButton, ElTag } from 'element-plus'
12
12
 
13
13
  definePageMeta({
14
- title: '接口管理'
15
- });
14
+ title: '接口管理',
15
+ })
16
16
 
17
- interface Form extends ApiItem { op?: any; };
17
+ interface Form extends ApiItem { op?: any };
18
18
  const FORM_TEMP: Form = {
19
19
  id: 0,
20
20
  path: '',
21
21
  desc: '',
22
22
  method: 'POST',
23
23
  category: '',
24
- roleIds: []
25
- };
24
+ roleIds: [],
25
+ }
26
26
  const {
27
27
  isAdd,
28
28
  isEdit,
@@ -32,33 +32,33 @@ const {
32
32
  clear,
33
33
  form,
34
34
  formRef,
35
- validForm
35
+ validForm,
36
36
  } = useFormMode<Form>(FORM_TEMP, {
37
37
  addCbk: async () => {
38
- const res = await validForm() as boolean;
38
+ const res = await validForm() as boolean
39
39
  if (res) {
40
- const v = deepClone(form.value);
41
- await apis.post.addApiItem(v);
42
- ElMessage.success('新增成功!');
40
+ const v = deepClone(form.value)
41
+ await apis.post.addApiItem(v)
42
+ ElMessage.success('新增成功!')
43
43
  }
44
- return res;
44
+ return res
45
45
  },
46
46
  modCbk: async () => {
47
- const res = await validForm() as boolean;
47
+ const res = await validForm() as boolean
48
48
  if (res) {
49
- const v = deepClone(form.value);
50
- await apis.patch.changeApiItem(v);
51
- ElMessage.success('修改成功!');
49
+ const v = deepClone(form.value)
50
+ await apis.patch.changeApiItem(v)
51
+ ElMessage.success('修改成功!')
52
52
  }
53
- return res;
53
+ return res
54
54
  },
55
55
  delCbk: async (row) => {
56
- await apis.delete.deleteApi(row.id.toString());
57
- ElMessage.success('删除成功!');
58
- query.value.pageNum = 1;
56
+ await apis.delete.deleteApi(row.id.toString())
57
+ ElMessage.success('删除成功!')
58
+ query.value.pageNum = 1
59
59
  },
60
60
  cgEffect: () => getList(),
61
- });
61
+ })
62
62
  const tableHead: TableHeadItem<Form>[] = [
63
63
  { prop: 'id', label: '接口ID' },
64
64
  { prop: 'desc', label: '接口描述' },
@@ -66,41 +66,45 @@ const tableHead: TableHeadItem<Form>[] = [
66
66
  { prop: 'path', label: '接口路径' },
67
67
  { prop: 'creator', label: '创建信息' },
68
68
  {
69
- prop: 'method', label: '接口方法', render: (row) => h(ElTag, {
69
+ prop: 'method',
70
+ label: '接口方法',
71
+ render: row => h(ElTag, {
70
72
  effect: 'dark',
71
- type: MethodObj[row.method]
73
+ type: MethodObj[row.method],
72
74
  },
73
- {
74
- default: () => row.method
75
- }
76
- )
75
+ {
76
+ default: () => row.method,
77
+ },
78
+ ),
77
79
  },
78
80
  {
79
- prop: 'op', label: '操作', render: (row) => h('div', [
81
+ prop: 'op',
82
+ label: '操作',
83
+ render: row => h('div', [
80
84
  h(ElButton, { type: 'primary', link: true, onClick: () => edit(row) }, { default: () => '编辑' }),
81
- h(ElButton, { type: 'danger', link: true, onClick: () => del(row) }, { default: () => '删除' })
82
- ])
83
- }
84
- ];
85
- const tableData = ref<TableDataItem<Form>[]>([]);
85
+ h(ElButton, { type: 'danger', link: true, onClick: () => del(row) }, { default: () => '删除' }),
86
+ ]),
87
+ },
88
+ ]
89
+ const tableData = ref<TableDataItem<Form>[]>([])
86
90
 
87
- const getList = async () => {
88
- const { list: role_list } = await apis.get.getRoleList({ noPagination: true });
91
+ async function getList() {
92
+ const { list: role_list } = await apis.get.getRoleList({ noPagination: true })
89
93
  roleList.value = (role_list || []).map((item: RoleItem) => {
90
94
  return {
91
95
  label: item.name,
92
- value: item.id
93
- };
94
- });
96
+ value: item.id,
97
+ }
98
+ })
95
99
 
96
- const { list, pageNum, pageSize, total } = await apis.get.getApiList(query.value);
97
- tableData.value = deepClone(list || []);
98
- query.value.pageNum = +pageNum || 1;
99
- query.value.pageSize = +pageSize || 50;
100
- query.value.total = +total || 0;
101
- };
100
+ const { list, pageNum, pageSize, total } = await apis.get.getApiList(query.value)
101
+ tableData.value = deepClone(list || [])
102
+ query.value.pageNum = +pageNum || 1
103
+ query.value.pageSize = +pageSize || 50
104
+ query.value.total = +total || 0
105
+ }
102
106
 
103
- type Query = BaseQuery & Partial<Form>;
107
+ type Query = BaseQuery & Partial<Form>
104
108
  const { query, reset } = useQuery<Query>(
105
109
  {
106
110
  pageNum: 1,
@@ -109,7 +113,7 @@ const { query, reset } = useQuery<Query>(
109
113
  path: '',
110
114
  },
111
115
  getList,
112
- );
116
+ )
113
117
  const queryScheme: YoungSearchScheme<Query> = {
114
118
  path: {
115
119
  type: 'input',
@@ -118,27 +122,32 @@ const queryScheme: YoungSearchScheme<Query> = {
118
122
  placeholder: '请输入接口路径',
119
123
  },
120
124
  },
121
- };
125
+ }
122
126
 
123
- const roleList = ref<SelectOptionItem<number>[]>([]);
127
+ const roleList = ref<SelectOptionItem<number>[]>([])
124
128
 
125
- useTabReOpen(getList);
129
+ useTabReOpen(getList)
126
130
  </script>
131
+
127
132
  <template>
128
133
  <ElCard>
129
134
  <YoungSearchForm v-model="query" :search-scheme="queryScheme" :on-search="getList" :on-reset="reset">
130
135
  <template #btns>
131
- <ElButton type="success" @click="isAdd = true">添加接口</ElButton>
136
+ <ElButton type="success" @click="isAdd = true">
137
+ 添加接口
138
+ </ElButton>
132
139
  </template>
133
140
  </YoungSearchForm>
134
141
  </ElCard>
135
142
 
136
- <br />
143
+ <br>
137
144
 
138
145
  <ElCard>
139
146
  <YoungTablePro :table-data="tableData" :table-head="tableHead" />
140
- <YoungPagination v-model:page="query.pageNum" v-model:limit="query.pageSize" :total="query.total"
141
- @page-change="getList" />
147
+ <YoungPagination
148
+ v-model:page="query.pageNum" v-model:limit="query.pageSize" :total="query.total"
149
+ @page-change="getList"
150
+ />
142
151
  </ElCard>
143
152
  <YoungDialog :is-add="isAdd" :is-edit="isEdit" :diff-form="form" width="520px" @sure="sure" @clear="clear">
144
153
  <template #body>
@@ -150,11 +159,15 @@ useTabReOpen(getList);
150
159
  <ElInput v-model.trim="form.desc" class="!w-300px" />
151
160
  </ElFormItem>
152
161
  <ElFormItem label="请求方法">
153
- <YoungSelect v-model="form.method" class="!w-300px"
154
- :options="Object.keys(MethodObj).map((item) => ({ label: item, value: item }))" />
162
+ <YoungSelect
163
+ v-model="form.method" class="!w-300px"
164
+ :options="Object.keys(MethodObj).map((item) => ({ label: item, value: item }))"
165
+ />
155
166
  </ElFormItem>
156
- <ElFormItem label="接口路径" prop="path"
157
- :rules="{ message: '请填写合法的接口路径, eg: /user/list', trigger: 'blur', validator: (_: any, v: string) => /\/(.*)\/(.*)/.test(v) }">
167
+ <ElFormItem
168
+ label="接口路径" prop="path"
169
+ :rules="{ message: '请填写合法的接口路径, eg: /user/list', trigger: 'blur', validator: (_: any, v: string) => /\/(.*)\/(.*)/.test(v) }"
170
+ >
158
171
  <ElInput v-model.trim="form.path" class="!w-300px" />
159
172
  </ElFormItem>
160
173
  <ElFormItem label="关联角色">