create-young-proj 0.10.2 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.mjs +9 -9
- package/package.json +1 -1
- package/template-nuxt-admin/README.md +42 -1
- package/template-nuxt-admin/components/layout/Main.vue +2 -2
- package/template-nuxt-admin/components/layout/NavBar.vue +11 -2
- package/template-nuxt-admin/components/layout/SideBar.vue +6 -2
- package/template-nuxt-admin/components/layout/SubMenu.vue +9 -2
- package/template-nuxt-admin/components/layout/TabsBar.vue +4 -5
- package/template-nuxt-admin/composables/api.ts +17 -3
- package/template-nuxt-admin/composables/nav.ts +20 -3
- package/template-nuxt-admin/composables/tags.ts +29 -1
- package/template-nuxt-admin/middleware/auth.global.ts +16 -4
- package/template-nuxt-admin/nuxt.config.ts +5 -1
- package/template-nuxt-admin/package.json +5 -5
- package/template-nuxt-admin/pages/home/[id].vue +2 -2
- package/template-nuxt-admin/pages/index.vue +2 -7
- package/template-nuxt-admin/pages/login.vue +2 -2
- package/template-nuxt-admin/pages/system/menuList.vue +0 -1
- package/template-nuxt-admin/public/bg.webp +0 -0
- package/template-nuxt-admin/public/favicon.svg +2 -0
- package/template-nuxt-admin/public/logo.svg +2 -0
- package/template-nuxt-admin/server/plugins/env.ts +3 -4
- package/template-nuxt-admin/utils/tool.ts +17 -1
- package/template-nuxt-admin/yarn.lock +706 -854
- package/template-uni-app/auto-imports.d.ts +9 -6
- package/template-uni-app/custom-plugins/index.ts +1 -2
- package/template-uni-app/dist/dev/mp-weixin/apis/index.js +5 -6
- package/template-uni-app/dist/dev/mp-weixin/apis/requests/get.js +2 -2
- package/template-uni-app/dist/dev/mp-weixin/apis/requests/post.js +4 -4
- package/template-uni-app/dist/dev/mp-weixin/app.js +4 -5
- package/template-uni-app/dist/dev/mp-weixin/common/vendor.js +1448 -2471
- package/template-uni-app/dist/dev/mp-weixin/components/young-navbar/young-navbar.js +7 -8
- package/template-uni-app/dist/dev/mp-weixin/components/young-navbar/young-navbar.wxml +1 -1
- package/template-uni-app/dist/dev/mp-weixin/components/young-tabbar/young-tabbar.js +7 -8
- package/template-uni-app/dist/dev/mp-weixin/components/young-tabbar/young-tabbar.wxml +1 -1
- package/template-uni-app/dist/dev/mp-weixin/layouts/default.js +1 -2
- package/template-uni-app/dist/dev/mp-weixin/layouts/tabbar.wxml +1 -1
- package/template-uni-app/dist/dev/mp-weixin/pages/demo/index.js +4 -5
- package/template-uni-app/dist/dev/mp-weixin/pages/demo/index.wxml +1 -1
- package/template-uni-app/dist/dev/mp-weixin/pages/index.js +4 -5
- package/template-uni-app/dist/dev/mp-weixin/pages/index.wxml +1 -1
- package/template-uni-app/dist/dev/mp-weixin/pages/my.wxml +1 -1
- package/template-uni-app/dist/dev/mp-weixin/project.config.json +1 -2
- package/template-uni-app/dist/dev/mp-weixin/project.private.config.json +6 -0
- package/template-uni-app/dist/dev/mp-weixin/store/local/index.js +3 -1
- package/template-uni-app/dist/dev/mp-weixin/utils/modal.js +10 -14
- package/template-uni-app/dist/dev/mp-weixin/utils/route.js +4 -6
- package/template-uni-app/dist/dev/mp-weixin/utils/system.js +4 -4
- package/template-uni-app/package.json +2 -3
- package/template-uni-app/pnpm-lock.yaml +154 -105
- package/template-uni-app/src/apis/index.ts +2 -2
- package/template-uni-app/src/apis/requests/get.ts +5 -5
- package/template-uni-app/src/apis/requests/post.ts +5 -5
- package/template-uni-app/vite.config.ts +2 -3
- package/template-nuxt-admin/public/favicon.ico +0 -0
- package/template-uni-app/custom-plugins/polyfill.ts +0 -32
- package/template-uni-app/dist/dev/mp-weixin/apis/lib/index.js +0 -90
- package/template-uni-app/src/apis/lib/index.ts +0 -235
- package/template-vue-admin/.vscode/extensions.json +0 -10
- package/template-vue-admin/.vscode/list-add.code-snippets +0 -108
- package/template-vue-admin/.vscode/list-export.code-snippets +0 -72
- package/template-vue-admin/.vscode/list.code-snippets +0 -61
- package/template-vue-admin/.vscode/settings.json +0 -7
- package/template-vue-admin/Dockerfile +0 -42
- package/template-vue-admin/README.md +0 -75
- package/template-vue-admin/_env +0 -8
- package/template-vue-admin/_gitignore +0 -30
- package/template-vue-admin/boot.mjs +0 -16
- package/template-vue-admin/build/custom-plugin.ts +0 -57
- package/template-vue-admin/build/index.ts +0 -7
- package/template-vue-admin/build/plugins.ts +0 -59
- package/template-vue-admin/config/.devrc +0 -2
- package/template-vue-admin/config/.onlinerc +0 -2
- package/template-vue-admin/config/.testrc +0 -2
- package/template-vue-admin/index.html +0 -21
- package/template-vue-admin/nitro.config.ts +0 -19
- package/template-vue-admin/package.json +0 -51
- package/template-vue-admin/plugins/init.ts +0 -31
- package/template-vue-admin/public/vite.svg +0 -1
- package/template-vue-admin/rome.json +0 -26
- package/template-vue-admin/routes/api/[...all].ts +0 -49
- package/template-vue-admin/routes/get/env.ts +0 -18
- package/template-vue-admin/src/App.vue +0 -14
- package/template-vue-admin/src/apis/delete.ts +0 -36
- package/template-vue-admin/src/apis/get.ts +0 -83
- package/template-vue-admin/src/apis/index.ts +0 -10
- package/template-vue-admin/src/apis/patch.ts +0 -78
- package/template-vue-admin/src/apis/post.ts +0 -76
- package/template-vue-admin/src/assets/img/login_background.jpg +0 -0
- package/template-vue-admin/src/auto-components.d.ts +0 -38
- package/template-vue-admin/src/auto-imports.d.ts +0 -302
- package/template-vue-admin/src/layouts/blank.vue +0 -9
- package/template-vue-admin/src/layouts/default/components/Link.vue +0 -23
- package/template-vue-admin/src/layouts/default/components/Logo.vue +0 -20
- package/template-vue-admin/src/layouts/default/components/Menu.vue +0 -54
- package/template-vue-admin/src/layouts/default/components/NavSearch.vue +0 -52
- package/template-vue-admin/src/layouts/default/components/ScrollPane.vue +0 -79
- package/template-vue-admin/src/layouts/default/components/TagsView.vue +0 -137
- package/template-vue-admin/src/layouts/default/components/TopMenu.vue +0 -21
- package/template-vue-admin/src/layouts/default/components/UserCenter.vue +0 -50
- package/template-vue-admin/src/layouts/default/index.vue +0 -95
- package/template-vue-admin/src/main.ts +0 -46
- package/template-vue-admin/src/modules/1-router.ts +0 -48
- package/template-vue-admin/src/modules/2-pinia.ts +0 -10
- package/template-vue-admin/src/modules/3-net.ts +0 -79
- package/template-vue-admin/src/modules/4-auth.ts +0 -124
- package/template-vue-admin/src/modules/5-checkupdate.ts +0 -38
- package/template-vue-admin/src/shims.d.ts +0 -12
- package/template-vue-admin/src/stores/index.ts +0 -9
- package/template-vue-admin/src/stores/local/index.ts +0 -31
- package/template-vue-admin/src/stores/session/index.ts +0 -63
- package/template-vue-admin/src/stores/tags.ts +0 -109
- package/template-vue-admin/src/typings/global.d.ts +0 -70
- package/template-vue-admin/src/typings/index.ts +0 -13
- package/template-vue-admin/src/typings/system.d.ts +0 -46
- package/template-vue-admin/src/views/403.vue +0 -33
- package/template-vue-admin/src/views/[...all_404].vue +0 -557
- package/template-vue-admin/src/views/base/login.vue +0 -194
- package/template-vue-admin/src/views/dashboard/[name].vue +0 -28
- package/template-vue-admin/src/views/index.vue +0 -25
- package/template-vue-admin/src/views/system/api.vue +0 -160
- package/template-vue-admin/src/views/system/hooks/useRole.ts +0 -286
- package/template-vue-admin/src/views/system/menuList.vue +0 -194
- package/template-vue-admin/src/views/system/role.vue +0 -131
- package/template-vue-admin/src/views/system/user.vue +0 -192
- package/template-vue-admin/src/vite-env.d.ts +0 -52
- package/template-vue-admin/tsconfig.json +0 -21
- package/template-vue-admin/tsconfig.node.json +0 -9
- package/template-vue-admin/unocss.config.ts +0 -47
- package/template-vue-admin/vite.config.ts +0 -32
@@ -1,42 +0,0 @@
|
|
1
|
-
# 拉取基础镜像
|
2
|
-
FROM node:18-alpine as builder
|
3
|
-
|
4
|
-
# 维护者
|
5
|
-
MAINTAINER BluesYoung "bluesyoung_web@163.com"
|
6
|
-
|
7
|
-
# 工作目录
|
8
|
-
WORKDIR /app
|
9
|
-
|
10
|
-
# 没有压缩包,首选 COPY,如果需要自动解包或下载,则使用 ADD
|
11
|
-
|
12
|
-
# 对比依赖是否变更
|
13
|
-
COPY package.json yarn.lock /app/
|
14
|
-
|
15
|
-
# 设置npm仓库 + 下载依赖,上面的文件如果没有变化则跳过下载,直接使用缓存
|
16
|
-
RUN npm config set registry https://registry.npmmirror.com && \
|
17
|
-
yarn config set registry https://registry.npmmirror.com && \
|
18
|
-
yarn
|
19
|
-
|
20
|
-
# 加入代码
|
21
|
-
COPY . /app
|
22
|
-
# 打包
|
23
|
-
RUN yarn build
|
24
|
-
|
25
|
-
# 打包完成,构建最终的极简镜像
|
26
|
-
FROM node:18-alpine
|
27
|
-
|
28
|
-
# 工作目录
|
29
|
-
WORKDIR /app
|
30
|
-
|
31
|
-
# 复制运行需要的文件[及依赖]
|
32
|
-
# 直接复制源代码
|
33
|
-
COPY boot.mjs /app/
|
34
|
-
COPY config /app/config
|
35
|
-
# 复制上一步的打包产物
|
36
|
-
COPY --from=builder /app/.output /app/.output
|
37
|
-
|
38
|
-
# 暴露指定的端口号,暂不需要
|
39
|
-
# EXPOSE 3001
|
40
|
-
|
41
|
-
# 启动容器时运行的命令
|
42
|
-
ENTRYPOINT ["node", "boot.mjs"]
|
@@ -1,75 +0,0 @@
|
|
1
|
-
# 后台模板
|
2
|
-
|
3
|
-
## 用户代码片段(页面模板)
|
4
|
-
|
5
|
-
模板 | 触发关键字
|
6
|
-
--- | ---
|
7
|
-
基础列表 | `list`
|
8
|
-
列表 + `Excel` 导出 | `list-export`
|
9
|
-
列表 + 弹出层 | `list-add`
|
10
|
-
|
11
|
-
## **Docker 部署**
|
12
|
-
|
13
|
-
- 同一份代码,可以根据运行时的环境变量决定具体表现
|
14
|
-
- `node` 服务:
|
15
|
-
- 托管前端静态资源
|
16
|
-
- 根据环境变量读取对应的配置文件,并以接口的形式暴露给前端
|
17
|
-
- 跨域接口代理
|
18
|
-
|
19
|
-
环境变量
|
20
|
-
|
21
|
-
```sh
|
22
|
-
# 部署环境 dev | test | online
|
23
|
-
DEPLOY_ENV=dev
|
24
|
-
# DEPLOY_ENV=test
|
25
|
-
# DEPLOY_ENV=online
|
26
|
-
# node 服务监听的端口号
|
27
|
-
LISTEN_PORT=3000
|
28
|
-
# 网关主机地址
|
29
|
-
# APIGATEHOST='apisix.intranet.cn'
|
30
|
-
```
|
31
|
-
|
32
|
-
### 本地开发
|
33
|
-
|
34
|
-
**确保上述的环境变量存在**
|
35
|
-
|
36
|
-
启动服务端程序 `yarn dev:server`
|
37
|
-
|
38
|
-
启动客户端程序 `yarn dev`
|
39
|
-
|
40
|
-
### 打包预览
|
41
|
-
|
42
|
-
`yarn build`
|
43
|
-
|
44
|
-
确保上述的环境变量存在
|
45
|
-
|
46
|
-
`node boot.mjs`
|
47
|
-
|
48
|
-
### 配置文件
|
49
|
-
|
50
|
-
存放于 `config` 目录下的 `.${env}rc` 文件,`env` 为对应的环境标识
|
51
|
-
|
52
|
-
## 常规部署
|
53
|
-
|
54
|
-
- `nginx` 托管前端静态资源
|
55
|
-
- 每次打包时读取环境变量,打包完成之后不可变
|
56
|
-
- 使用 `nginx` 代理跨域
|
57
|
-
|
58
|
-
环境变量
|
59
|
-
|
60
|
-
```sh
|
61
|
-
# 设置静态部署
|
62
|
-
VITE_USE_DEFAULT_DEPLOY_METHOD=true
|
63
|
-
# 其他的环境变量,根据环境区分
|
64
|
-
VITE_TITLE=管理后台
|
65
|
-
```
|
66
|
-
|
67
|
-
### 本地开发
|
68
|
-
|
69
|
-
确保上述的环境变量存在,然后 `yarn dev` 即可
|
70
|
-
|
71
|
-
### 打包预览
|
72
|
-
|
73
|
-
`yarn build`
|
74
|
-
|
75
|
-
`yarn preview`
|
package/template-vue-admin/_env
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
# Logs
|
2
|
-
logs
|
3
|
-
*.log
|
4
|
-
npm-debug.log*
|
5
|
-
yarn-debug.log*
|
6
|
-
yarn-error.log*
|
7
|
-
pnpm-debug.log*
|
8
|
-
lerna-debug.log*
|
9
|
-
|
10
|
-
node_modules
|
11
|
-
dist
|
12
|
-
dist-ssr
|
13
|
-
*.local
|
14
|
-
.env
|
15
|
-
|
16
|
-
# Editor directories and files
|
17
|
-
.vscode/*
|
18
|
-
!.vscode/extensions.json
|
19
|
-
!.vscode/settings.json
|
20
|
-
!.vscode/*.code-snippets
|
21
|
-
.idea
|
22
|
-
.DS_Store
|
23
|
-
*.suo
|
24
|
-
*.ntvs*
|
25
|
-
*.njsproj
|
26
|
-
*.sln
|
27
|
-
*.sw?
|
28
|
-
|
29
|
-
.nitro
|
30
|
-
.output
|
@@ -1,16 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* @Author: zhangyang
|
3
|
-
* @Date: 2022-09-16 11:48:05
|
4
|
-
* @LastEditTime: 2022-12-29 16:21:59
|
5
|
-
* @Description:
|
6
|
-
*/
|
7
|
-
(async () => {
|
8
|
-
const env = process.env.DEPLOY_ENV;
|
9
|
-
const listenPort = process.env.LISTEN_PORT || 3003;
|
10
|
-
console.log('当前环境:', env);
|
11
|
-
console.log('服务监听端口:', listenPort);
|
12
|
-
|
13
|
-
process.env.NITRO_PORT = listenPort;
|
14
|
-
|
15
|
-
await import('./.output/server/index.mjs');
|
16
|
-
})();
|
@@ -1,57 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* @Author: zhangyang
|
3
|
-
* @Date: 2023-01-10 14:43:13
|
4
|
-
* @LastEditTime: 2023-05-18 15:55:37
|
5
|
-
* @Description:
|
6
|
-
*/
|
7
|
-
import { networkInterfaces } from 'node:os';
|
8
|
-
|
9
|
-
function getLocalIP(): string | undefined {
|
10
|
-
const ips = networkInterfaces();
|
11
|
-
|
12
|
-
function isPrivateIP(ip: string) {
|
13
|
-
return (
|
14
|
-
/^192\.168\.\d{1,3}\.\d{1,3}$/.test(ip) ||
|
15
|
-
/^10\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(ip) ||
|
16
|
-
/^172\.(1[6-9]|2\d|3[01])\.\d{1,3}\.\d{1,3}$/.test(ip)
|
17
|
-
);
|
18
|
-
}
|
19
|
-
|
20
|
-
for (const name of Object.keys(ips)) {
|
21
|
-
const networkInterface = ips[name];
|
22
|
-
|
23
|
-
for (const interfaceInfo of networkInterface) {
|
24
|
-
if (
|
25
|
-
interfaceInfo.family === 'IPv4' &&
|
26
|
-
!interfaceInfo.internal &&
|
27
|
-
isPrivateIP(interfaceInfo.address)
|
28
|
-
) {
|
29
|
-
return interfaceInfo.address;
|
30
|
-
}
|
31
|
-
}
|
32
|
-
}
|
33
|
-
|
34
|
-
return '127.0.0.1';
|
35
|
-
}
|
36
|
-
|
37
|
-
const virtualModuleId = 'virtual:local-server';
|
38
|
-
export const localServer = `http://${getLocalIP()}:3000`;
|
39
|
-
|
40
|
-
/**
|
41
|
-
* 获取本机 ip 地址,拼接开发时的服务地址
|
42
|
-
*/
|
43
|
-
export const serverPlugin = () => {
|
44
|
-
return {
|
45
|
-
name: 'local-server',
|
46
|
-
resolveId(id) {
|
47
|
-
if (id === virtualModuleId) {
|
48
|
-
return virtualModuleId;
|
49
|
-
}
|
50
|
-
},
|
51
|
-
load(id) {
|
52
|
-
if (id === virtualModuleId) {
|
53
|
-
return `export const server = '${localServer}';`;
|
54
|
-
}
|
55
|
-
},
|
56
|
-
};
|
57
|
-
};
|
@@ -1,59 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* @Author: zhangyang
|
3
|
-
* @Date: 2023-01-10 14:26:01
|
4
|
-
* @LastEditTime: 2023-01-10 15:18:31
|
5
|
-
* @Description:
|
6
|
-
*/
|
7
|
-
import type { PluginOption } from 'vite';
|
8
|
-
import { serverPlugin } from './custom-plugin';
|
9
|
-
import vue from '@vitejs/plugin-vue';
|
10
|
-
import vueJsx from '@vitejs/plugin-vue-jsx';
|
11
|
-
import legacy from '@vitejs/plugin-legacy';
|
12
|
-
import Unocss from 'unocss/vite';
|
13
|
-
// 自动导入
|
14
|
-
import AutoImport from 'unplugin-auto-import/vite';
|
15
|
-
import AutoComopnents from 'unplugin-vue-components/vite';
|
16
|
-
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers';
|
17
|
-
// 自动路由及布局
|
18
|
-
import Pages from 'vite-plugin-pages';
|
19
|
-
import Layouts from 'vite-plugin-vue-layouts';
|
20
|
-
|
21
|
-
export { localServer } from './custom-plugin';
|
22
|
-
|
23
|
-
export const usePlugins = () => {
|
24
|
-
return [
|
25
|
-
serverPlugin(),
|
26
|
-
vue(),
|
27
|
-
vueJsx(),
|
28
|
-
Pages({
|
29
|
-
extensions: ['vue', 'tsx'],
|
30
|
-
dirs: 'src/views',
|
31
|
-
exclude: ['**/components/*.{vue,tsx}', '_*'],
|
32
|
-
}),
|
33
|
-
Layouts({ defaultLayout: 'default/index' }),
|
34
|
-
AutoComopnents({
|
35
|
-
dirs: ['src/components'],
|
36
|
-
dts: './src/auto-components.d.ts',
|
37
|
-
extensions: ['vue', 'tsx'],
|
38
|
-
resolvers: [ElementPlusResolver()],
|
39
|
-
}),
|
40
|
-
AutoImport({
|
41
|
-
dts: './src/auto-imports.d.ts',
|
42
|
-
imports: [
|
43
|
-
'vue',
|
44
|
-
'vue-router',
|
45
|
-
'@vueuse/core',
|
46
|
-
'pinia',
|
47
|
-
{
|
48
|
-
'element-plus': ['ElMessage', 'ElMessageBox', 'ElLoadingService'],
|
49
|
-
},
|
50
|
-
],
|
51
|
-
}),
|
52
|
-
Unocss(),
|
53
|
-
// 不生成同名 polyfill 文件,打包速度翻倍
|
54
|
-
// 如果出现兼容问题,可以删除此配置
|
55
|
-
legacy({
|
56
|
-
// renderLegacyChunks: false
|
57
|
-
}),
|
58
|
-
] as PluginOption[];
|
59
|
-
};
|
@@ -1,21 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html lang="zh-CN">
|
3
|
-
<head>
|
4
|
-
<meta charset="UTF-8" />
|
5
|
-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
7
|
-
<title>Vite + Vue + TS</title>
|
8
|
-
<script>
|
9
|
-
// hack globalThis
|
10
|
-
this.globalThis || (this.globalThis = this);
|
11
|
-
// window.onerror = function(e) {
|
12
|
-
// console.log(e)
|
13
|
-
// window.alert('您的浏览器版本过低,请尝试使用其他浏览器或将浏览器升级至最新版本后重试!');
|
14
|
-
// }
|
15
|
-
</script>
|
16
|
-
</head>
|
17
|
-
<body>
|
18
|
-
<div id="app"></div>
|
19
|
-
<script type="module" src="/src/main.ts"></script>
|
20
|
-
</body>
|
21
|
-
</html>
|
@@ -1,19 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* @Author: zhangyang
|
3
|
-
* @Date: 2022-12-28 11:59:56
|
4
|
-
* @LastEditTime: 2023-01-04 19:01:20
|
5
|
-
* @Description:
|
6
|
-
*/
|
7
|
-
import { defineNitroConfig } from 'nitropack';
|
8
|
-
|
9
|
-
export default defineNitroConfig({
|
10
|
-
/**
|
11
|
-
* 托管前端静态资源
|
12
|
-
*/
|
13
|
-
serveStatic: 'node',
|
14
|
-
publicAssets: [
|
15
|
-
{
|
16
|
-
dir: 'dist',
|
17
|
-
},
|
18
|
-
],
|
19
|
-
});
|
@@ -1,51 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name": "music_admin",
|
3
|
-
"private": true,
|
4
|
-
"version": "0.0.0",
|
5
|
-
"type": "module",
|
6
|
-
"scripts": {
|
7
|
-
"dev": "vite --host",
|
8
|
-
"dev:server": "nitropack dev",
|
9
|
-
"build": "vite build && nitropack build",
|
10
|
-
"preview": "vite preview --host",
|
11
|
-
"format": "rome format .* --write",
|
12
|
-
"release": "changelogen && bumpp --commit --tag --no-push"
|
13
|
-
},
|
14
|
-
"dependencies": {
|
15
|
-
"@bluesyoung/http": "0.2.1",
|
16
|
-
"@bluesyoung/ui-vue3": "0.1.0",
|
17
|
-
"@bluesyoung/ui-vue3-element-plus": "0.9.2",
|
18
|
-
"@bluesyoung/utils": "0.1.0",
|
19
|
-
"@vueuse/core": "^10.1.2",
|
20
|
-
"core-js": "^3.30.2",
|
21
|
-
"element-plus": "^2.2.28",
|
22
|
-
"pinia": "^2.0.23",
|
23
|
-
"regenerator-runtime": "^0.13.10",
|
24
|
-
"sortablejs": "^1.15.0",
|
25
|
-
"vue": "^3.2.41",
|
26
|
-
"vue-router": "^4.1.6"
|
27
|
-
},
|
28
|
-
"devDependencies": {
|
29
|
-
"@iconify/json": "^2.2.66",
|
30
|
-
"@types/node": "16",
|
31
|
-
"@unocss/reset": "^0.51.13",
|
32
|
-
"@vitejs/plugin-legacy": "^4.0.3",
|
33
|
-
"@vitejs/plugin-vue": "^4.2.3",
|
34
|
-
"@vitejs/plugin-vue-jsx": "^3.0.1",
|
35
|
-
"bumpp": "^9.1.0",
|
36
|
-
"c12": "^1.4.1",
|
37
|
-
"changelogen": "^0.5.3",
|
38
|
-
"less": "^4.1.3",
|
39
|
-
"nitropack": "^2.4.1",
|
40
|
-
"rome": "^12.1.1",
|
41
|
-
"sass": "^1.62.1",
|
42
|
-
"terser": "^5.17.4",
|
43
|
-
"typescript": "^5.0.4",
|
44
|
-
"unocss": "^0.51.13",
|
45
|
-
"unplugin-auto-import": "^0.16.0",
|
46
|
-
"unplugin-vue-components": "^0.24.1",
|
47
|
-
"vite": "^4.3.7",
|
48
|
-
"vite-plugin-pages": "^0.29.1",
|
49
|
-
"vite-plugin-vue-layouts": "^0.8.0"
|
50
|
-
}
|
51
|
-
}
|
@@ -1,31 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* @Author: zhangyang
|
3
|
-
* @Date: 2023-01-04 18:53:23
|
4
|
-
* @LastEditTime: 2023-05-18 16:10:14
|
5
|
-
* @Description: 在插件中读取环境变量,避免重复的文件 io
|
6
|
-
*/
|
7
|
-
import { resolve } from 'node:path';
|
8
|
-
import { loadConfig } from 'c12';
|
9
|
-
// @ts-ignore
|
10
|
-
export default defineNitroPlugin(async (app) => {
|
11
|
-
const env = (process.env.DEPLOY_ENV as 'dev' | 'test' | 'online') || 'dev';
|
12
|
-
const { config } = await loadConfig({
|
13
|
-
name: env,
|
14
|
-
cwd: resolve(process.cwd(), 'config'),
|
15
|
-
defaultConfig: {
|
16
|
-
// 由于频繁修改 package.json 会浪费 docker 性能,故将版本信息放于此处
|
17
|
-
// 优先读取环境变量中的版本信息(自己打的 Tag)
|
18
|
-
VITE_CURRENT_VERSION: process.env.PROJECT_VERSION || '0.5.5',
|
19
|
-
},
|
20
|
-
});
|
21
|
-
|
22
|
-
for (const key in config) {
|
23
|
-
if (Object.prototype.hasOwnProperty.call(config, key)) {
|
24
|
-
process.env[key] = config[key];
|
25
|
-
}
|
26
|
-
}
|
27
|
-
|
28
|
-
console.log('------------------------读取配置文件------------------------');
|
29
|
-
console.log(config);
|
30
|
-
console.log('------------------------------------------------------------');
|
31
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
@@ -1,26 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"formatter": {
|
3
|
-
"ignore": [
|
4
|
-
"node_modules/**/*",
|
5
|
-
"src/utils/**/*.js",
|
6
|
-
"src/utils/**/*.map",
|
7
|
-
"*.d.ts",
|
8
|
-
"index.html",
|
9
|
-
"yarn.lock",
|
10
|
-
"*.json",
|
11
|
-
"README.md",
|
12
|
-
"dist/**/*"
|
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
|
-
}
|
@@ -1,49 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* @Author: zhangyang
|
3
|
-
* @Date: 2023-01-04 15:16:30
|
4
|
-
* @LastEditTime: 2023-01-05 09:10:47
|
5
|
-
* @Description:
|
6
|
-
*/
|
7
|
-
export default eventHandler(async (event) => {
|
8
|
-
const method = event.node.req.method;
|
9
|
-
const url = event.node.req.url;
|
10
|
-
let body;
|
11
|
-
|
12
|
-
if (!(method && method.toLowerCase() === 'get')) {
|
13
|
-
try {
|
14
|
-
body = await readBody(event);
|
15
|
-
console.log('🚀 ~ file: [...all].ts:16 ~ eventHandler ~ body', body);
|
16
|
-
} catch (error) {
|
17
|
-
console.log('🚀 ~ file: [...all].ts:18 ~ eventHandler ~ error', error);
|
18
|
-
}
|
19
|
-
}
|
20
|
-
|
21
|
-
// 开发服使用 http + 主机名,其他环境直接读取完整配置
|
22
|
-
const api_server_url = process.env.VITE_BASE_HTTP;
|
23
|
-
// 如果正式服报错,则设置一个请求头白名单,只传递对应的请求头
|
24
|
-
// console.log("🚀 ~ file: [...].post.ts:11 ~ defineEventHandler ~ api_server_url", api_server_url);
|
25
|
-
const headers = event.node.req.headers as Record<string, string>;
|
26
|
-
|
27
|
-
try {
|
28
|
-
const res = await $fetch(`${api_server_url}${url}`, {
|
29
|
-
method: event.node.req.method,
|
30
|
-
headers: {
|
31
|
-
time: headers['time'],
|
32
|
-
authorization: headers['authorization'],
|
33
|
-
sign: headers['sign'],
|
34
|
-
'content-type': headers['content-type'],
|
35
|
-
'x-forwarded-for': headers['x-forwarded-for'],
|
36
|
-
},
|
37
|
-
body,
|
38
|
-
});
|
39
|
-
|
40
|
-
return res;
|
41
|
-
} catch (error: any) {
|
42
|
-
if (error.toString().includes('401')) {
|
43
|
-
event.node.res.statusCode = 401;
|
44
|
-
return error.data;
|
45
|
-
} else {
|
46
|
-
return error;
|
47
|
-
}
|
48
|
-
}
|
49
|
-
});
|
@@ -1,18 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* @Author: zhangyang
|
3
|
-
* @Date: 2022-11-18 10:55:50
|
4
|
-
* @LastEditTime: 2023-01-04 19:06:46
|
5
|
-
* @Description:
|
6
|
-
*/
|
7
|
-
export default defineEventHandler(async (event) => {
|
8
|
-
const envObj: any = {};
|
9
|
-
for (const key in process.env) {
|
10
|
-
if (Object.prototype.hasOwnProperty.call(process.env, key) && key.startsWith('VITE_')) {
|
11
|
-
envObj[key] = process.env[key];
|
12
|
-
}
|
13
|
-
}
|
14
|
-
|
15
|
-
event.node.res.setHeader('Access-Control-Allow-Origin', '*');
|
16
|
-
|
17
|
-
return envObj as ImportMetaEnv;
|
18
|
-
});
|
@@ -1,14 +0,0 @@
|
|
1
|
-
<!--
|
2
|
-
* @Author: zhangyang
|
3
|
-
* @Date: 2022-12-03 15:57:40
|
4
|
-
* @LastEditTime: 2023-01-05 14:07:02
|
5
|
-
* @Description:
|
6
|
-
-->
|
7
|
-
<script lang="ts" setup>
|
8
|
-
import locale from 'element-plus/lib/locale/lang/zh-cn';
|
9
|
-
</script>
|
10
|
-
<template>
|
11
|
-
<ElConfigProvider :locale="locale">
|
12
|
-
<RouterView />
|
13
|
-
</ElConfigProvider>
|
14
|
-
</template>
|
@@ -1,36 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* @Author: zhangyang
|
3
|
-
* @Date: 2023-01-06 10:50:53
|
4
|
-
* @LastEditTime: 2023-01-06 14:08:45
|
5
|
-
* @Description:
|
6
|
-
*/
|
7
|
-
import { http } from '@/modules/3-net';
|
8
|
-
|
9
|
-
const method = 'DELETE';
|
10
|
-
|
11
|
-
const del = async (url: string, ids: string) => {
|
12
|
-
await http.authReq({
|
13
|
-
url,
|
14
|
-
method,
|
15
|
-
data: { ids },
|
16
|
-
});
|
17
|
-
};
|
18
|
-
|
19
|
-
export const useDeleteReq = () => ({
|
20
|
-
/**
|
21
|
-
* 删除用户
|
22
|
-
*/
|
23
|
-
deleteUser: async (ids: string) => del('/user/delete/batch', ids),
|
24
|
-
/**
|
25
|
-
* 删除菜单
|
26
|
-
*/
|
27
|
-
deleteMenu: async (ids: string) => del('/menu/delete/batch', ids),
|
28
|
-
/**
|
29
|
-
* 删除接口
|
30
|
-
*/
|
31
|
-
deleteApi: async (ids: string) => del('/api/delete/batch', ids),
|
32
|
-
/**
|
33
|
-
* 删除角色
|
34
|
-
*/
|
35
|
-
deleteRole: async (ids: string) => del('/role/delete/batch', ids),
|
36
|
-
});
|
@@ -1,83 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* @Author: zhangyang
|
3
|
-
* @Date: 2023-01-04 19:31:22
|
4
|
-
* @LastEditTime: 2023-05-18 16:07:52
|
5
|
-
* @Description:
|
6
|
-
*/
|
7
|
-
import { http } from '@/modules/3-net';
|
8
|
-
import { useNavStore } from '@/stores';
|
9
|
-
|
10
|
-
const method = 'GET';
|
11
|
-
|
12
|
-
export const useGetReq = () => ({
|
13
|
-
/**
|
14
|
-
* 获取当前用户的菜单树
|
15
|
-
*/
|
16
|
-
getMenuTree: async (force = false) => {
|
17
|
-
const { RawNav } = useNavStore();
|
18
|
-
if (!force && RawNav.value.length > 0) {
|
19
|
-
return Promise.resolve(RawNav.value);
|
20
|
-
}
|
21
|
-
return http.authReq<Record<number, NavArrItem>>({
|
22
|
-
url: '/menu/tree',
|
23
|
-
method,
|
24
|
-
});
|
25
|
-
},
|
26
|
-
/**
|
27
|
-
* 获取角色列表
|
28
|
-
*/
|
29
|
-
getRoleList: async (params: Partial<BaseQuery> = {}) =>
|
30
|
-
http.authReq<PagesData>({
|
31
|
-
url: `/role/list`,
|
32
|
-
params,
|
33
|
-
method,
|
34
|
-
}),
|
35
|
-
/**
|
36
|
-
* 获取用户列表
|
37
|
-
*/
|
38
|
-
getUserList: async (params: Partial<BaseQuery> = {}) =>
|
39
|
-
http.authReq<PagesData>({
|
40
|
-
url: '/user/list',
|
41
|
-
method,
|
42
|
-
params,
|
43
|
-
}),
|
44
|
-
/**
|
45
|
-
* 获取菜单列表
|
46
|
-
*/
|
47
|
-
getMenuList: async () =>
|
48
|
-
http.authReq<Record<string, NavArrItem>>({
|
49
|
-
url: '/menu/list',
|
50
|
-
method,
|
51
|
-
}),
|
52
|
-
/**
|
53
|
-
* 获取接口列表
|
54
|
-
*/
|
55
|
-
getApiList: async (params: Partial<BaseQuery> = {}) =>
|
56
|
-
http.authReq<PagesData>({
|
57
|
-
url: '/api/list',
|
58
|
-
method,
|
59
|
-
params,
|
60
|
-
}),
|
61
|
-
/**
|
62
|
-
* 获取角色拥有权限的菜单
|
63
|
-
*/
|
64
|
-
getRoleMenuTree: async (id: number) =>
|
65
|
-
http.authReq<{
|
66
|
-
list: NavArrItem[];
|
67
|
-
accessIds: number[];
|
68
|
-
}>({
|
69
|
-
url: `/menu/all/${id}`,
|
70
|
-
method,
|
71
|
-
}),
|
72
|
-
/**
|
73
|
-
* 获取角色拥有的接口权限
|
74
|
-
*/
|
75
|
-
getRoleApis: async (id: number) =>
|
76
|
-
http.authReq<{
|
77
|
-
list: ApiItem[];
|
78
|
-
accessIds: number[];
|
79
|
-
}>({
|
80
|
-
url: `/api/all/category/${id}`,
|
81
|
-
method,
|
82
|
-
}),
|
83
|
-
});
|