create-young-proj 0.6.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. package/README.md +5 -3
  2. package/dist/index.mjs +9 -9
  3. package/package.json +1 -1
  4. package/template-nuxt-admin/Dockerfile +41 -0
  5. package/template-nuxt-admin/README.md +35 -0
  6. package/template-nuxt-admin/app.vue +41 -0
  7. package/template-nuxt-admin/boot.mjs +16 -0
  8. package/template-nuxt-admin/components/ScreenFull.vue +18 -0
  9. package/template-nuxt-admin/components/TopSearch.vue +73 -0
  10. package/template-nuxt-admin/components/TopUser.vue +69 -0
  11. package/template-nuxt-admin/components/YoungChangePassword.vue +87 -0
  12. package/template-nuxt-admin/components/YoungCodeInput.vue +60 -0
  13. package/template-nuxt-admin/components/YoungLink.vue +23 -0
  14. package/template-nuxt-admin/components/YoungLoading.vue +39 -0
  15. package/template-nuxt-admin/components/layout/Footer.vue +29 -0
  16. package/template-nuxt-admin/components/layout/Logo.vue +52 -0
  17. package/template-nuxt-admin/components/layout/Main.vue +41 -0
  18. package/template-nuxt-admin/components/layout/NavBar.vue +77 -0
  19. package/template-nuxt-admin/components/layout/SideBar.vue +90 -0
  20. package/template-nuxt-admin/components/layout/SubMenu.vue +46 -0
  21. package/template-nuxt-admin/components/layout/TabsBar.vue +183 -0
  22. package/template-nuxt-admin/composables/api.ts +104 -0
  23. package/template-nuxt-admin/composables/apis/delete.ts +37 -0
  24. package/template-nuxt-admin/composables/apis/get.ts +83 -0
  25. package/template-nuxt-admin/composables/apis/index.ts +10 -0
  26. package/template-nuxt-admin/composables/apis/patch.ts +74 -0
  27. package/template-nuxt-admin/composables/apis/post.ts +85 -0
  28. package/template-nuxt-admin/composables/config.ts +13 -0
  29. package/template-nuxt-admin/composables/icon.ts +27 -0
  30. package/template-nuxt-admin/composables/nav.ts +60 -0
  31. package/template-nuxt-admin/composables/tags.ts +108 -0
  32. package/template-nuxt-admin/composables/user.ts +29 -0
  33. package/template-nuxt-admin/config/.devrc +1 -0
  34. package/template-nuxt-admin/config/.onlinerc +1 -0
  35. package/template-nuxt-admin/config/.testrc +1 -0
  36. package/template-nuxt-admin/env.d.ts +47 -0
  37. package/template-nuxt-admin/error.vue +53 -0
  38. package/template-nuxt-admin/layouts/blank.vue +9 -0
  39. package/template-nuxt-admin/layouts/default.vue +124 -0
  40. package/template-nuxt-admin/middleware/auth.global.ts +39 -0
  41. package/template-nuxt-admin/nuxt.config.ts +101 -0
  42. package/template-nuxt-admin/package.json +44 -0
  43. package/template-nuxt-admin/pages/home/[id].vue +28 -0
  44. package/template-nuxt-admin/pages/index.vue +20 -0
  45. package/template-nuxt-admin/pages/login.vue +179 -0
  46. package/template-nuxt-admin/pages/system/api.vue +166 -0
  47. package/template-nuxt-admin/pages/system/hooks/useRole.ts +336 -0
  48. package/template-nuxt-admin/pages/system/menuList.vue +329 -0
  49. package/template-nuxt-admin/pages/system/role.vue +117 -0
  50. package/template-nuxt-admin/pages/system/user.vue +214 -0
  51. package/template-nuxt-admin/plugins/directive.ts +26 -0
  52. package/template-nuxt-admin/public/default_avatar.svg +1 -0
  53. package/template-nuxt-admin/public/favicon.ico +0 -0
  54. package/template-nuxt-admin/public/image_placeholder.svg +15 -0
  55. package/template-nuxt-admin/public/tabbar_bg.png +0 -0
  56. package/template-nuxt-admin/rome.json +26 -0
  57. package/template-nuxt-admin/server/api/[...all].ts +10 -0
  58. package/template-nuxt-admin/server/plugins/env.ts +89 -0
  59. package/template-nuxt-admin/server/routes/get/env.ts +13 -0
  60. package/template-nuxt-admin/server/tsconfig.json +3 -0
  61. package/template-nuxt-admin/server/utils/index.ts +35 -0
  62. package/template-nuxt-admin/styles/element.scss +30 -0
  63. package/template-nuxt-admin/styles/index.scss +59 -0
  64. package/template-nuxt-admin/styles/variable.scss +103 -0
  65. package/template-nuxt-admin/tsconfig.json +7 -0
  66. package/template-nuxt-admin/typings/global.d.ts +16 -0
  67. package/template-nuxt-admin/typings/system.d.ts +66 -0
  68. package/template-nuxt-admin/typings/user.d.ts +19 -0
  69. package/template-nuxt-admin/uno.config.ts +40 -0
  70. package/template-nuxt-admin/utils/tool.ts +207 -0
  71. package/template-nuxt-admin/yarn.lock +6849 -0
  72. package/template-uni-app/_npmrc +2 -0
  73. package/template-uni-app/src/layouts/tabbar.vue +6 -6
  74. package/template-uni-app/src/pages/index.vue +16 -12
  75. package/template-uni-app/src/pages/my.vue +7 -11
@@ -0,0 +1,15 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="margin: auto; background: rgb(255, 255, 255); display: block; shape-rendering: auto;" width="200px" height="200px" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid">
3
+ <rect x="17.5" y="30" width="15" height="40" fill="#93dbe9">
4
+ <animate attributeName="y" repeatCount="indefinite" dur="1s" calcMode="spline" keyTimes="0;0.5;1" values="18;30;30" keySplines="0 0.5 0.5 1;0 0.5 0.5 1" begin="-0.2s"></animate>
5
+ <animate attributeName="height" repeatCount="indefinite" dur="1s" calcMode="spline" keyTimes="0;0.5;1" values="64;40;40" keySplines="0 0.5 0.5 1;0 0.5 0.5 1" begin="-0.2s"></animate>
6
+ </rect>
7
+ <rect x="42.5" y="30" width="15" height="40" fill="#689cc5">
8
+ <animate attributeName="y" repeatCount="indefinite" dur="1s" calcMode="spline" keyTimes="0;0.5;1" values="20.999999999999996;30;30" keySplines="0 0.5 0.5 1;0 0.5 0.5 1" begin="-0.1s"></animate>
9
+ <animate attributeName="height" repeatCount="indefinite" dur="1s" calcMode="spline" keyTimes="0;0.5;1" values="58.00000000000001;40;40" keySplines="0 0.5 0.5 1;0 0.5 0.5 1" begin="-0.1s"></animate>
10
+ </rect>
11
+ <rect x="67.5" y="30" width="15" height="40" fill="#5e6fa3">
12
+ <animate attributeName="y" repeatCount="indefinite" dur="1s" calcMode="spline" keyTimes="0;0.5;1" values="20.999999999999996;30;30" keySplines="0 0.5 0.5 1;0 0.5 0.5 1"></animate>
13
+ <animate attributeName="height" repeatCount="indefinite" dur="1s" calcMode="spline" keyTimes="0;0.5;1" values="58.00000000000001;40;40" keySplines="0 0.5 0.5 1;0 0.5 0.5 1"></animate>
14
+ </rect>
15
+ <!-- [ldio] generated by https://loading.io/ --></svg>
@@ -0,0 +1,26 @@
1
+ {
2
+ "formatter": {
3
+ "ignore": [
4
+ "*.d.ts",
5
+ "index.html",
6
+ "yarn.lock",
7
+ "*.json",
8
+ "README.md",
9
+ ".nuxt/*",
10
+ ".vscode/*",
11
+ "Dockerfile",
12
+ "*.vue"
13
+ ],
14
+ "indentStyle": "space",
15
+ "indentSize": 2,
16
+ "lineWidth": 100
17
+ },
18
+ "javascript": {
19
+ "formatter": {
20
+ "quoteStyle": "single"
21
+ }
22
+ },
23
+ "linter": {
24
+ "enabled": false
25
+ }
26
+ }
@@ -0,0 +1,10 @@
1
+ /*
2
+ * @Author: zhangyang
3
+ * @Date: 2023-07-21 09:50:36
4
+ * @LastEditTime: 2023-07-21 09:50:36
5
+ * @Description:
6
+ */
7
+ export default eventHandler(async (event) => {
8
+ const proxy = createTransparentProxy(process.env.NUXT_PUBLIC_API_BASE as string);
9
+ await proxy.handle(event);
10
+ });
@@ -0,0 +1,89 @@
1
+ /*
2
+ * @Author: zhangyang
3
+ * @Date: 2022-12-30 17:19:42
4
+ * @LastEditTime: 2023-07-31 17:52:20
5
+ * @Description:
6
+ */
7
+ import { resolve } from 'node:path';
8
+ import { loadConfig } from 'c12';
9
+ import { useYoungLogger } from '@bluesyoung/logger';
10
+
11
+ export default defineNitroPlugin(async (nitroApp) => {
12
+ const env = (process.env.DEPLOY_ENV as 'dev' | 'test' | 'online') || 'dev';
13
+ const { config } = await loadConfig<Record<string, any>>({
14
+ name: env,
15
+ cwd: resolve(process.cwd(), 'config'),
16
+ defaultConfig: {
17
+ // 此处可以放置通用的环境变量
18
+ // 由于频繁修改 package.json 会浪费 docker 性能,故将版本信息放于此处
19
+ // 优先读取环境变量中的版本信息(自己打的 Tag)
20
+ NUXT_PUBLIC_CURRENT_VERSION: process.env.PROJECT_VERSION || 'v0.0.1',
21
+
22
+ NUXT_PUBLIC_TITLE: 'XXX-后台管理系统',
23
+ NUXT_PUBLIC_SUB_TITLE: '做XXX我们是认真的!',
24
+ NUXT_PUBLIC_SLOGAN: 'XXXXX, XXXXX',
25
+ NUXT_PUBLIC_LOGIN_BG:
26
+ 'https://dogefs.s3.ladydaily.com/~/source/unsplash/photo-1688380692117-63178554d76d?ixid=M3wyNjY4NDZ8MHwxfHRvcGljfHxhZXU2ckwtajZld3x8fHx8Mnx8MTY5MDAxMDMzNnw&ixlib=rb-4.0.3&w=1920&h=1080&fmt=webp',
27
+ NUXT_PUBLIC_LOGIN_LOGO: 'https://api.iconify.design/logos:nuxt-icon.svg?color=%23f74d49',
28
+ },
29
+ });
30
+
31
+ for (const key in config) {
32
+ if (process.env[key]) {
33
+ console.log(
34
+ '系统环境变量优先: ',
35
+ key,
36
+ ' = ',
37
+ process.env[key],
38
+ ' -> ',
39
+ config[key],
40
+ ' -> ',
41
+ '覆盖',
42
+ );
43
+ config[key] = process.env[key];
44
+ } else {
45
+ process.env[key] = config[key];
46
+ }
47
+ if (!(key.indexOf('NUXT_PUBLIC_') === 0)) {
48
+ delete config[key];
49
+ }
50
+ }
51
+
52
+ console.log('------------------------读取配置文件------------------------');
53
+ console.log(config);
54
+ console.log('-------------------------------------------------------------');
55
+
56
+ // 仅打包之后格式化日志
57
+ if (process.env.NODE_ENV !== 'development') {
58
+ useYoungLogger();
59
+ }
60
+
61
+ nitroApp.hooks.hook('render:html', (html, { event }) => {
62
+ // 直接注入环境变量到前端
63
+ html.bodyPrepend.push(`
64
+ <!-- 注入环境变量 -->
65
+ <script>window.__YOUNG_ENV__=${JSON.stringify(config)}</script>
66
+ <!-- 更新检测,每分钟一次 -->
67
+ <script>
68
+ setInterval(() => {
69
+ fetch('/get/env')
70
+ .then((res) => res.json())
71
+ .then(({ NUXT_PUBLIC_CURRENT_VERSION }) => {
72
+ if (NUXT_PUBLIC_CURRENT_VERSION !== window.__YOUNG_ENV__.NUXT_PUBLIC_CURRENT_VERSION) {
73
+ alert('版本已更新,请重新加载页面!');
74
+ window.location.reload();
75
+ }
76
+ });
77
+ }, 6e4);
78
+ </script>
79
+ `);
80
+
81
+ // 移动端调试控制台,需要使用就放开下面的注释
82
+ // if (process.env.NODE_ENV === 'development' || process.env.NUXT_PUBLIC_ENABLE_CONSOLE) {
83
+ // html.bodyAppend.push(`
84
+ // <script src="//cdn.bootcdn.net/ajax/libs/eruda/2.3.3/eruda.js"></script>
85
+ // <script>eruda.init();</script>
86
+ // `);
87
+ // }
88
+ });
89
+ });
@@ -0,0 +1,13 @@
1
+ /*
2
+ * @Author: zhangyang
3
+ * @Date: 2023-07-20 19:48:12
4
+ * @LastEditTime: 2023-07-21 11:18:40
5
+ * @Description:
6
+ */
7
+ export default defineEventHandler(async (event) => {
8
+ const envObj = {
9
+ NUXT_PUBLIC_CURRENT_VERSION: process.env.PROJECT_VERSION || 'v0.0.1',
10
+ };
11
+
12
+ return envObj;
13
+ });
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": "../.nuxt/tsconfig.server.json"
3
+ }
@@ -0,0 +1,35 @@
1
+ /*
2
+ * @Author: zhangyang
3
+ * @Date: 2023-05-29 10:29:52
4
+ * @LastEditTime: 2023-06-17 16:20:40
5
+ * @Description:
6
+ */
7
+ import { type ServerOptions as HTTPProxyOptions } from 'http-proxy';
8
+ import ProxyModule from 'http-proxy';
9
+ import type { H3Event } from 'h3';
10
+ /**
11
+ * @param target 接口代理的具体地址
12
+ * @param defaults 代理配置
13
+ * @example
14
+ * export default defineEventHandler(async (event) => {
15
+ * const proxy = createTransparentProxy(`http://127.0.0.1:3333`);
16
+ * await proxy.handle(event);
17
+ * });
18
+ */
19
+ export const createTransparentProxy = (target: string, defaults: HTTPProxyOptions = {}) => {
20
+ const proxy = ProxyModule.createProxy();
21
+ const handle = (event: H3Event, opts: HTTPProxyOptions = {}) => {
22
+ return new Promise<void>((resolve, reject) => {
23
+ proxy.web(event.node.req, event.node.res, { target, ...defaults, ...opts }, (error: any) => {
24
+ if (error.code !== 'ECONNRESET') {
25
+ reject(error);
26
+ }
27
+ resolve();
28
+ });
29
+ });
30
+ };
31
+ return {
32
+ proxy,
33
+ handle,
34
+ };
35
+ };
@@ -0,0 +1,30 @@
1
+ // el-table 样式
2
+ .el-table {
3
+ -webkit-box-flex: 1;
4
+ -webkit-flex: 1;
5
+ -ms-flex: 1;
6
+ flex: 1;
7
+
8
+ table {
9
+ width: 100%;
10
+ }
11
+
12
+ .el-table__header th {
13
+ font-weight: bold;
14
+ color: var(--el-text-color-primary);
15
+ background: var(--el-fill-color-light) !important;
16
+ }
17
+ }
18
+
19
+ // el-dialog 样式
20
+ .el-dialog {
21
+ .el-dialog__header {
22
+ padding: 15px 20px;
23
+ margin: 0;
24
+ border-bottom: 1px solid var(--el-border-color-lighter);
25
+
26
+ .el-dialog__title {
27
+ font-size: 17px;
28
+ }
29
+ }
30
+ }
@@ -0,0 +1,59 @@
1
+ @import './element.scss';
2
+
3
+ // 滚动条样式
4
+ @mixin base-scrollbar {
5
+ &::-webkit-scrollbar {
6
+ width: 13px;
7
+ height: 13px;
8
+ }
9
+
10
+ &::-webkit-scrollbar-thumb {
11
+ background-color: rgb(0 0 0 / 10%);
12
+ background-clip: padding-box;
13
+ border: 3px solid transparent;
14
+ border-radius: 7px;
15
+ }
16
+
17
+ &::-webkit-scrollbar-thumb:hover {
18
+ background-color: rgb(0 0 0 / 30%);
19
+ }
20
+
21
+ &::-webkit-scrollbar-track {
22
+ background-color: transparent;
23
+ }
24
+
25
+ &::-webkit-scrollbar-track:hover {
26
+ background-color: #f8fafc;
27
+ }
28
+ }
29
+
30
+ html body,
31
+ #__nuxt {
32
+ position: relative;
33
+ -webkit-box-sizing: border-box;
34
+ box-sizing: border-box;
35
+ height: 100vh;
36
+ padding: 0;
37
+ overflow: auto;
38
+ font-family: 'PingFang SC', Arial, 'Microsoft YaHei', sans-serif;
39
+ font-size: 14px;
40
+ color: var(--el-color-black);
41
+ background: #f6f8f9;
42
+ -webkit-font-smoothing: antialiased;
43
+ @include base-scrollbar;
44
+
45
+ div {
46
+ @include base-scrollbar;
47
+ }
48
+
49
+ .layout-admin-wrapper {
50
+ .app-main-container {
51
+ @include base-scrollbar;
52
+ }
53
+ }
54
+ }
55
+
56
+ :root {
57
+ --el-color-white: #fff;
58
+ --el-color-grey: rgb(0 0 0 / 65%);
59
+ }
@@ -0,0 +1,103 @@
1
+ // 框架默认主题色
2
+ $base-color-default: #1890ff;
3
+
4
+ // 默认层级
5
+ $base-z-index: 999;
6
+
7
+ // 横向布局纵向布局时菜单背景色
8
+ $base-menu-background: #001529;
9
+
10
+ // 菜单文字颜色
11
+ $base-menu-color: hsl(0deg 0% 100% / 95%);
12
+
13
+ // 菜单选中文字颜色
14
+ $base-menu-color-active: hsl(0deg 0% 100% / 95%);
15
+
16
+ // 菜单选中背景色
17
+ $base-menu-background-active: $base-color-default;
18
+ $base-color-blue: $base-color-default;
19
+
20
+ // 标题颜色
21
+ $base-title-color: #fff;
22
+
23
+ // 字体大小配置
24
+ $base-font-size-small: 12px;
25
+ $base-font-size-default: 14px;
26
+ $base-font-size-big: 16px;
27
+ $base-font-size-bigger: 18px;
28
+ $base-font-size-max: 22px;
29
+ $base-font-color: #606266;
30
+ $base-color-blue: $base-color-default;
31
+ $base-color-green: #41b882;
32
+ $base-color-white: #fff;
33
+ $base-color-black: #000;
34
+ $base-color-yellow: #ffa91b;
35
+ $base-color-orange: #ff6700;
36
+ $base-color-red: #f34d37;
37
+ $base-color-gray: rgb(0 0 0 / 65%);
38
+ $base-main-width: 1279px;
39
+ $base-border-radius: 4px;
40
+ $base-border-color: #dcdfe6;
41
+
42
+ // 输入框高度
43
+ $base-input-height: 32px;
44
+
45
+ // 默认paddiing
46
+ $base-padding: 20px;
47
+
48
+ // 默认阴影
49
+ $base-box-shadow: 0 1px 4px rgb(0 21 41 / 8%);
50
+
51
+ // 横向布局时top-bar、logo、一级菜单的高度
52
+ $base-top-bar-height: 60px;
53
+
54
+ // 纵向布局时logo的高度
55
+ $base-logo-height: 75px;
56
+
57
+ // 顶部nav-bar的高度
58
+ $base-nav-bar-height: 60px;
59
+
60
+ // 顶部多标签页tabs-bar的高度
61
+ $base-tabs-bar-height: 55px;
62
+
63
+ // 顶部多标签页tabs-bar中每一个item的高度
64
+ $base-tag-item-height: 34px;
65
+
66
+ // 菜单li标签的高度
67
+ $base-menu-item-height: 50px;
68
+
69
+ // 头部高度
70
+ $base-header-height: -webkit-calc(#{$base-nav-bar-height} + #{$base-tabs-bar-height});
71
+ $base-header-height: calc(#{$base-nav-bar-height} + #{$base-tabs-bar-height});
72
+
73
+ // app-footer高度
74
+ $base-app-footer-height: 55px;
75
+
76
+ // app-main的高度
77
+ $base-app-main-height: -webkit-calc(
78
+ 100vh - $base-header-height - 40px
79
+ );
80
+ $base-app-main-height: calc(
81
+ 100vh - $base-header-height - 40px
82
+ );
83
+
84
+ // 纵向布局时左侧导航未折叠时的宽度
85
+ $base-left-menu-width: 256px;
86
+
87
+ // 纵向布局时左侧导航未折叠时右侧内容的宽度
88
+ $base-right-content-width: -webkit-calc(100% - #{$base-left-menu-width});
89
+ $base-right-content-width: calc(100% - #{$base-left-menu-width});
90
+
91
+ // 纵向布局时左侧导航已折叠时的宽度
92
+ $base-left-menu-width-min: 64px;
93
+
94
+ // 纵向布局时左侧导航已折叠时右侧内容的宽度
95
+ $base-right-content-width-min: -webkit-calc(100% - #{$base-left-menu-width-min});
96
+ $base-right-content-width-min: calc(100% - #{$base-left-menu-width-min});
97
+
98
+ // 默认动画
99
+ $base-transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1), border 0s,
100
+ background 0s, color 0s, font-size 0s;
101
+
102
+ // 默认动画长
103
+ $base-transition-time: 0.3s;
@@ -0,0 +1,7 @@
1
+ {
2
+ // https://nuxt.com/docs/guide/concepts/typescript
3
+ "extends": "./.nuxt/tsconfig.json",
4
+ "compilerOptions": {
5
+ "allowSyntheticDefaultImports": true
6
+ }
7
+ }
@@ -0,0 +1,16 @@
1
+ /*
2
+ * @Author: zhangyang
3
+ * @Date: 2023-07-26 11:57:29
4
+ * @LastEditTime: 2023-07-26 14:01:32
5
+ * @Description:
6
+ */
7
+ interface BaseQuery {
8
+ pageNum: number;
9
+ pageSize: number;
10
+ total: number;
11
+ noPagination?: boolean;
12
+ }
13
+
14
+ type PagesData = {
15
+ list: any[];
16
+ } & BaseQuery;
@@ -0,0 +1,66 @@
1
+ /*
2
+ * @Author: zhangyang
3
+ * @Date: 2023-07-21 09:03:42
4
+ * @LastEditTime: 2023-07-26 11:49:13
5
+ * @Description:
6
+ */
7
+ import { MethodObj } from '~/composables/config';
8
+ declare global {
9
+ type NavArrItem = {
10
+ breadcrumb: number;
11
+ component: string;
12
+ createdAt: string;
13
+ creator: string;
14
+ icon?: any;
15
+ id: number;
16
+ name: string;
17
+ not_dev: number;
18
+ parentId: number;
19
+ path: string;
20
+ permission: string;
21
+ redirect: string;
22
+ sort: number;
23
+ status: number;
24
+ title?: string;
25
+ updatedAt: string;
26
+ visible: number;
27
+ children?: NavArrItem[] | [];
28
+ } & Record<string, any>;
29
+
30
+ type ApiItem = {
31
+ id: number;
32
+ path: string;
33
+ desc: string;
34
+ category: string;
35
+ method: keyof typeof MethodObj;
36
+ roleIds: number[];
37
+ creator?: string;
38
+ title?: string;
39
+ };
40
+
41
+ type RoleItem = {
42
+ createdAt?: string;
43
+ creator?: string;
44
+ desc: string;
45
+ id: number;
46
+ keyword: string;
47
+ name: string;
48
+ not_dev?: number;
49
+ sort?: number;
50
+ status: number;
51
+ updatedAt?: string;
52
+ };
53
+
54
+ type UserItem = {
55
+ id: number;
56
+ username: string;
57
+ nickname: string;
58
+ mobile: string;
59
+ roleId: number;
60
+ status: number;
61
+ role_name?: string;
62
+ creator?: string;
63
+ newPassword?: string;
64
+ initPassword?: string;
65
+ };
66
+ }
@@ -0,0 +1,19 @@
1
+ /*
2
+ * @Author: zhangyang
3
+ * @Date: 2023-07-21 08:58:31
4
+ * @LastEditTime: 2023-07-24 10:36:06
5
+ * @Description:
6
+ */
7
+ type UserLoginRes = {
8
+ uuid: string;
9
+ nickname: string;
10
+ headimgurl: string;
11
+ phone: string;
12
+ token: string;
13
+ };
14
+
15
+ type LoginForm = {
16
+ mobile: string;
17
+ password: string;
18
+ vercode: string;
19
+ };
@@ -0,0 +1,40 @@
1
+ /*
2
+ * @Author: zhangyang
3
+ * @Date: 2022-06-15 08:59:22
4
+ * @LastEditTime: 2023-05-27 19:36:43
5
+ * @Description:
6
+ */
7
+ import {
8
+ defineConfig,
9
+ presetAttributify,
10
+ presetIcons,
11
+ presetTypography,
12
+ presetUno,
13
+ presetWebFonts,
14
+ transformerDirectives,
15
+ transformerVariantGroup,
16
+ } from 'unocss';
17
+
18
+ export default defineConfig({
19
+ shortcuts: [],
20
+ presets: [
21
+ presetUno(),
22
+ presetAttributify(),
23
+ presetIcons({
24
+ scale: 1.2,
25
+ }),
26
+ presetTypography(),
27
+ presetWebFonts({
28
+ fonts: {
29
+ sans: 'DM Sans',
30
+ serif: 'DM Serif Display',
31
+ mono: 'DM Mono',
32
+ },
33
+ }),
34
+ ],
35
+ transformers: [
36
+ // 不加 enforce 会有 bug
37
+ transformerDirectives({ enforce: 'pre' }),
38
+ transformerVariantGroup(),
39
+ ],
40
+ })