Skip to content

Commit 664a211

Browse files
committed
4.0 版本提交
1 parent 016c354 commit 664a211

File tree

309 files changed

+20133
-36518
lines changed

Some content is hidden

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

309 files changed

+20133
-36518
lines changed

.editorConfig

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
root = true
2+
3+
# 匹配全部文件
4+
[*]
5+
# 设置字符集
6+
charset = utf-8
7+
# 缩进风格,可选 space、tab
8+
indent_style = tab
9+
# 缩进的空格数,当 indent_style = tab 将使用 tab_width
10+
# 否则使用 indent_size
11+
indent_size = 2
12+
tab_width = 2
13+
# 结尾换行符,可选 lf、cr、crlf
14+
end_of_line = crlf
15+
# 在文件结尾插入新行
16+
insert_final_newline = true
17+
# 删除一行中的前后空格
18+
trim_trailing_whitespace = true
19+
20+
# 匹配 md 结尾的文件
21+
[*.md]
22+
insert_final_newline = false
23+
trim_trailing_whitespace = false

.env

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# 通用环境变量
2+
3+
# 标题
4+
VITE_APP_TITLE = ZFile
5+
6+
7+
# markdown 渲染支持
8+
VITE_APP_MARKDOWN = true
9+
10+
11+
# 开发时 Inspect 调试支持
12+
VITE_APP_INSPECT = true
13+
14+
15+
# 生产时 mock 支持
16+
VITE_APP_MOCK_IN_PRODUCTION = false
17+
18+
19+
# 生产时压缩算法,可选 gzip, brotliCompress, deflate, deflateRaw
20+
VITE_APP_COMPRESSINON_ALGORITHM = gzip
21+
22+
23+
# api 自动按需引入
24+
# 注意设置关闭时,其他的 api 自动按需引入也将自动关闭
25+
VITE_APP_API_AUTO_IMPORT = true
26+
27+
28+
# 项目级 api 自动按需导入
29+
VITE_APP_DIR_API_AUTO_IMPORT = true

.env.development

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# 开发时环境变量
2+
3+
# 标题
4+
# VITE_APP_TITLE = ZFile
5+
6+
7+
# 开发时 Inspect 调试支持
8+
# VITE_APP_Inspect = true

.env.production

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# 生产时环境变量
2+
3+
# 标题
4+
# VITE_APP_TITLE = ZFile
5+
6+
7+
# 生产时 mock 支持
8+
# VITE_APP_MOCK_IN_PRODUCTION = false
9+
10+
11+
# 生产时压缩算法,可选 gzip, brotliCompress, deflate, deflateRaw
12+
# VITE_APP_COMPRESSINON_ALGORITHM = gzip

.eslintignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# 忽略 eslint 检查
2+
dist
3+
node_modules
4+
presets/types

.eslintrc.json

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"root": true, // 禁止接着往上找
3+
"env": {
4+
"node": true,
5+
"es2021": true,
6+
"browser": true // 浏览器
7+
},
8+
"parser": "vue-eslint-parser",
9+
"parserOptions": {
10+
"ecmaVersion": "latest",
11+
"parser": "@typescript-eslint/parser",
12+
"ecmaFeatures": {
13+
"jsx": true // 启用 jsx
14+
}
15+
},
16+
"plugins": ["prettier"],
17+
"extends": [
18+
"eslint:recommended", // 内置规则
19+
"plugin:vue/vue3-recommended", // 支持 vue sfc
20+
"prettier",
21+
"./presets/eslint/.eslintrc-auto-import.json"
22+
],
23+
"rules": {
24+
// 允许相同组件名
25+
"vue/multi-word-component-names": "off",
26+
// prettier 作为规则
27+
"prettier/prettier": "error",
28+
// 禁止使用 var,而应该用 let 或 const
29+
"no-var": "error",
30+
"global-require": 0
31+
}
32+
}

.github/ISSUE_TEMPLATE.md

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
name: bug template
3+
about: 请提供系统详细信息
4+
---
5+
6+
## 信息
7+
8+
### nodejs 版本
9+
10+
TODO
11+
12+
13+
(推荐使用 `v16` 以上)
14+
15+
<br />
16+
17+
18+
### 包管理器及其版本
19+
20+
TODO
21+
22+
23+
(推荐使用 `pnpm`)
24+
25+
26+
<br />
27+
28+
29+
### 系统
30+
31+
TODO
32+
33+
(该项目开发环境系统为 `win11`)
34+
35+
36+
<br />
37+
<br />
38+
39+
## bug
40+
41+
### 描述
42+
43+
TODO
44+
45+
<br />
46+
47+
### 预期结果
48+
49+
TODO
50+
51+
<br />
52+
53+
### 最小测试仓库
54+
55+
TODO

.gitignore

+2-20
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,3 @@
1-
.DS_Store
1+
dist
22
node_modules
3-
/dist
4-
5-
# local env files
6-
.env.local
7-
.env.*.local
8-
9-
# Log files
10-
npm-debug.log*
11-
yarn-debug.log*
12-
yarn-error.log*
13-
14-
# Editor directories and files
15-
.idea
16-
.vscode
17-
*.suo
18-
*.ntvs*
19-
*.njsproj
20-
*.sln
21-
*.sw?
3+
.eslintcache

.ide.alias.resovle.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const resolve = (dir) => require('path').join(__dirname, dir);
2+
module.exports = {
3+
extensions: ['.js', '.json', '.vue', 'ts'],
4+
resolve: {
5+
alias: {
6+
"~": resolve('src')
7+
}
8+
}
9+
};

.prettierignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist
2+
node_modules
3+
presets/types

.prettierrc.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"semi": false,
3+
"singleQuote": true,
4+
"endOfLine": "auto"
5+
}
6+

LICENSE

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
MIT LICENSE
2+
3+
Copyright (c) 2022 markthree
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
6+
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
7+
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
8+
to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
11+
12+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
13+
THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
15+
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
16+
IN THE SOFTWARE.

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Z-File
22

3-
此项目是一个在线文件目录的程序, 支持各种对象存储和本地存储, 使用定位是个人放常用工具下载, 或做公共的文件库. 不会向多账户方向开发.
3+
此仓库是 ZFile 4.0 前端 Vue 仓库, 使用技术为 Vue3、Pinia、VueRoute、Axios、Element Plus 等.
44

55
预览地址: [http://zfile.vip](http://zfile.vip)
66
后端代码: [https://github.com/zhaojun1998/zfile](https://github.com/zhaojun1998/zfile)
77

88
## 访问地址
99

10-
用户前台: http://127.0.0.1:8080/main
10+
用户前台: http://127.0.0.1:3000/
1111

12-
初始安装: http://127.0.0.1:8080/install
12+
初始安装: http://127.0.0.1:3000/install
1313

14-
管理后台: http://127.0.0.1:8080/admin
14+
管理后台: http://127.0.0.1:3000/admin

babel.config.js

-16
This file was deleted.

components.d.ts

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// generated by unplugin-vue-components
2+
// We suggest you to commit this file into source control
3+
// Read more: https://github.com/vuejs/vue-next/pull/3399
4+
5+
declare module 'vue' {
6+
export interface GlobalComponents {
7+
Header: typeof import('./src/components/layout/Header.vue')['default']
8+
SvgIcon: typeof import('./src/components/SvgIcon.vue')['default']
9+
}
10+
}
11+
12+
export { }

index.html

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!DOCTYPE html>
2+
<html lang="zh-CN">
3+
4+
<head>
5+
<meta charset="UTF-8" />
6+
<link rel="icon" href="/favicon.svg" type="image/svg+xml" />
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8+
<title>Vite App</title>
9+
<script>
10+
(function () {
11+
const prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches
12+
const setting = localStorage.getItem('vueuse-color-scheme') || 'auto'
13+
if (setting === 'dark' || (prefersDark && setting !== 'light'))
14+
document.documentElement.classList.toggle('dark', true)
15+
})()
16+
</script>
17+
</head>
18+
19+
<body>
20+
<div id="app"></div>
21+
<script type="module" src="/src/main.ts"></script>
22+
</body>
23+
24+
</html>

locales/en.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# English
2+
3+
index: index
4+
about: about
5+
not-found: Notfound
6+
7+
nesting:
8+
sir: man
9+
lady: lady

locales/zh-CN.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# 中文
2+
3+
index: 主页
4+
about: 关于
5+
not-found: 未找到页面
6+
7+
nesting:
8+
sir: 男人
9+
lady: 女士

mock/test.ts

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import { MockMethod } from 'vite-plugin-mock'
2+
export default [
3+
{
4+
url: '/api/get',
5+
method: 'get',
6+
response: () => {
7+
return {
8+
code: 0,
9+
data: {
10+
name: 'vben',
11+
},
12+
}
13+
},
14+
},
15+
{
16+
url: '/api/post',
17+
method: 'post',
18+
timeout: 2000,
19+
response: {
20+
code: 0,
21+
data: {
22+
name: 'vben',
23+
},
24+
},
25+
},
26+
{
27+
url: '/api/text',
28+
method: 'post',
29+
rawResponse: async (req, res) => {
30+
let reqbody = ''
31+
await new Promise((resolve) => {
32+
req.on('data', (chunk) => {
33+
reqbody += chunk
34+
})
35+
req.on('end', () => resolve(undefined))
36+
})
37+
res.setHeader('Content-Type', 'text/plain')
38+
res.statusCode = 200
39+
res.end(`hello, ${reqbody}`)
40+
},
41+
},
42+
] as MockMethod[]

0 commit comments

Comments
 (0)