Skip to content

Commit 6a5f181

Browse files
author
张益铭
committed
chore:更换到主分支
1 parent 9064b37 commit 6a5f181

File tree

3,530 files changed

+59784
-479623
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,530 files changed

+59784
-479623
lines changed

.env

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# public path
2+
VITE_PUBLIC_PATH = /
3+
4+
# Cross-domain proxy, you can configure multiple
5+
VITE_PROXY = [ ["/api", "http://127.0.0.1:3000" ] ]

.env.development

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# port
2+
VITE_PORT = 3001
3+
4+
# open
5+
VITE_OPEN = false
6+
7+
# public path
8+
VITE_PUBLIC_PATH = /
9+
10+
# Cross-domain proxy, you can configure multiple
11+
VITE_PROXY = [ ["/api", "http://127.0.0.1:3000" ] ]

.env.production

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# public path
2+
VITE_PUBLIC_PATH = /manages/

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/node_modules
2+
/dist
3+
.DS_Store
4+
src/.DS_Store

README.md

+45-6
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,56 @@
1-
# 后端管理项目文档
1+
# Vue3.0后台管理系统
2+
### 功能已开发完毕,新需求请提issues
3+
4+
## 知识库地址
5+
6+
帮助你获取最新的 API
7+
[vue3.0 中文文档地址]: https://vue3js.cn/docs/zh/
8+
[element-plus 中文文档地址]: https://element-plus.org/#/zh-CN
9+
[composition-Api 中文文档地址]: https://composition-api.vuejs.org/zh/
10+
[vue-router-next 文档地址]: https://next.router.vuejs.org/
11+
[next.vuex 文档地址]: https://next.vuex.vuejs.org/
12+
[vite 源码]: https://github.com/vitejs/vite
13+
[vite 文档地址]: https://vitejs.dev/
14+
[vite 中文文档地址(非官方版本)]: https://vite-design.surge.sh/guide/chinese-doc.html
15+
[vue-i18n-next]: https://vue-i18n-next.intlify.dev/
16+
[composition-api-vue-i18n-next]: https://vue-i18n-next.intlify.dev/advanced/composition.html#local-scope
217

318
## 安装依赖
19+
420
```
521
npm install
622
```
723

8-
## 文档启动
24+
## 项目运行
25+
926
```
10-
npm run docs
27+
npm run serve
1128
```
1229

13-
## 文档打包
30+
## 项目打包
31+
1432
```
15-
npm run docs:build
33+
npm run build
1634
```
17-
打包后会在.vitepress文件夹下生成dist目录
35+
36+
## 注意点
37+
38+
请先全局安装 typescript、ts-node、vite 如安装请忽略
39+
40+
```
41+
npm install -g typescript
42+
npm install -g ts-node
43+
npm install -g create-vite-app
44+
```
45+
46+
坑位
47+
1.
48+
path模块线上部署会遇到process is undefined问题
49+
解决办法:在源码中开头加入window.process = {}
50+
issues:https://github.com/jinder/path/issues/7
51+
2.
52+
运行项目时控制台报NODE_ENV not found
53+
解决办法:删除node_modules和package-lock.json文件,重新npm install
54+
3.
55+
运行项目会感觉菜单切换比较卡,这个原因是使用route造成的,watch(route)是隐式的{ deep: true },最好使用watchEffect
56+
issues:https://github.com/vuejs/vue-next/issues/2027

babel.config.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
const productPlugins = []
3+
process.env.NODE_ENV === "production" && productPlugins.push("transform-remove-console")
4+
module.exports = {
5+
plugins: [...productPlugins],
6+
}

build/proxy.ts

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
type ProxyItem = [string, string];
2+
3+
type ProxyList = ProxyItem[];
4+
5+
const regExps = (value: string,reg: string): string => {
6+
return value.replace(new RegExp(reg, 'g'), '');
7+
}
8+
9+
export function createProxy(list: ProxyList = []) {
10+
const ret: any = {};
11+
for (const [prefix, target] of list) {
12+
ret[prefix] = {
13+
target: target,
14+
changeOrigin: true,
15+
rewrite: (path:string) => regExps(path, prefix)
16+
};
17+
}
18+
return ret;
19+
}

build/utils.ts

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import dotenv from 'dotenv';
2+
3+
export interface ViteEnv {
4+
VITE_PORT: number;
5+
VITE_OPEN: boolean;
6+
VITE_USE_MOCK: boolean;
7+
VITE_PUBLIC_PATH: string;
8+
VITE_PROXY: [string, string][];
9+
}
10+
11+
export function loadEnv(): ViteEnv {
12+
const env = process.env.NODE_ENV;
13+
const ret: any = {};
14+
const envList = [`.env.${env}.local`, `.env.${env}`, '.env.local', '.env', ,]
15+
envList.forEach((e) => {
16+
dotenv.config({
17+
path: e,
18+
});
19+
});
20+
for (const envName of Object.keys(process.env)) {
21+
let realName = (process.env as any)[envName].replace(/\\n/g, '\n');
22+
realName = realName === 'true' ? true : realName === 'false' ? false : realName;
23+
if (envName === 'VITE_PORT') {
24+
realName = Number(realName);
25+
}
26+
if (envName === 'VITE_OPEN') {
27+
realName = Boolean(realName);
28+
}
29+
if (envName === 'VITE_PROXY') {
30+
try {
31+
realName = JSON.parse(realName);
32+
} catch (error) { }
33+
}
34+
ret[envName] = realName;
35+
process.env[envName] = realName;
36+
}
37+
return ret;
38+
}

deploy.sh

-27
This file was deleted.

docs/.vitepress/config.js

-47
This file was deleted.

docs/en/index.md

-8
This file was deleted.

docs/en/introduction/contributor.md

-33
This file was deleted.

docs/en/introduction/description.md

-8
This file was deleted.

docs/en/introduction/images/login.png

-1.1 MB
Binary file not shown.
-541 KB
Binary file not shown.

docs/en/introduction/openSource.md

-26
This file was deleted.

docs/en/introduction/ui.md

-15
This file was deleted.

docs/en/plugs/images/hyper.gif

-243 KB
Binary file not shown.

docs/en/plugs/images/snip.gif

-252 KB
Binary file not shown.

docs/en/plugs/index.md

-37
This file was deleted.

docs/en/standard/index.md

-16
This file was deleted.

0 commit comments

Comments
 (0)