Compare commits
173 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c84fca443 | ||
|
|
e89b752667 | ||
|
|
3739071bd6 | ||
|
|
2c876a2a11 | ||
|
|
d2f0af59b1 | ||
|
|
8089e8b193 | ||
|
|
170d309978 | ||
|
|
9edc5df08d | ||
|
|
7ea91bebb6 | ||
|
|
ba00fd21ed | ||
|
|
d4736aaa77 | ||
|
|
13ddb22e1c | ||
|
|
65c85de7ec | ||
|
|
97383cc86f | ||
|
|
eedf463e8e | ||
|
|
f339e2a5d8 | ||
|
|
6dc44b74a4 | ||
|
|
3b84681c4b | ||
|
|
97c8066dbb | ||
|
|
18437610b7 | ||
|
|
ea203cfa10 | ||
|
|
11662dcd46 | ||
|
|
792c05306a | ||
|
|
20af998dfe | ||
|
|
159e24537f | ||
|
|
5a71ef7e0d | ||
|
|
972cb5f85f | ||
|
|
f0c82679bf | ||
|
|
4c50a23279 | ||
|
|
0551231c45 | ||
|
|
f744856aff | ||
|
|
dd112fec77 | ||
|
|
456f5e4a5c | ||
|
|
97201b84df | ||
|
|
e4e72887ba | ||
|
|
5362555d06 | ||
|
|
5c501a048a | ||
|
|
de479a837b | ||
|
|
35775bb798 | ||
|
|
f3650cd8f8 | ||
|
|
07a3c94e4f | ||
|
|
cd0f9e9628 | ||
|
|
dd5a6c4bb5 | ||
|
|
f7edbf1f05 | ||
|
|
fa1ce408d4 | ||
|
|
6d606f855e | ||
|
|
f89361f5f7 | ||
|
|
bf2d89dc1a | ||
|
|
1729cf896e | ||
|
|
a033c4592d | ||
|
|
b1bb76f607 | ||
|
|
ea5ac0476e | ||
|
|
54bbf6d1fb | ||
|
|
183c0c5acf | ||
|
|
18228ef862 | ||
|
|
fa8b8bcc22 | ||
|
|
27e01670ba | ||
|
|
6ffcc5435f | ||
|
|
325c8652d2 | ||
|
|
d75f006641 | ||
|
|
2a38d50e88 | ||
|
|
ff0aa185f1 | ||
|
|
92b292aa05 | ||
|
|
fdaa75d5a4 | ||
|
|
bbb6f45f39 | ||
|
|
b67b0d272d | ||
|
|
2b1ea1e7a2 | ||
|
|
dbf21b3aff | ||
|
|
73d312f873 | ||
|
|
a7c03882f4 | ||
|
|
5cc21ac695 | ||
|
|
0a54c2301a | ||
|
|
9568c9a777 | ||
|
|
197d557e87 | ||
|
|
d508df1cc1 | ||
|
|
ed9df3b2ff | ||
|
|
5c82de2403 | ||
|
|
7a1b10291e | ||
|
|
842d37d80d | ||
|
|
5c013311e8 | ||
|
|
bfb9fe84b1 | ||
|
|
6bf9906b27 | ||
|
|
b656275d7b | ||
|
|
231171c5b3 | ||
|
|
c623b13d0b | ||
|
|
07930da9e2 | ||
|
|
1e8e332a71 | ||
|
|
7f8b593128 | ||
|
|
64c577430e | ||
|
|
55acfe0fdc | ||
|
|
e5e9ff4471 | ||
|
|
ea0a8a4efc | ||
|
|
09cc9f9cdf | ||
|
|
25c4435c50 | ||
|
|
7b0422f829 | ||
|
|
58b3b28c36 | ||
|
|
82fc65e9e2 | ||
|
|
e9805a1b77 | ||
|
|
6ef98efb60 | ||
|
|
94783d9fc6 | ||
|
|
2fea143bd9 | ||
|
|
ad1002a06b | ||
|
|
9b90e37dcd | ||
|
|
4e91ae792d | ||
|
|
f904fa7641 | ||
|
|
82c0d2156e | ||
|
|
072a20c9fc | ||
|
|
c3ed96296f | ||
|
|
6bade995fe | ||
|
|
0c81b66cd9 | ||
|
|
a0cfe3084e | ||
|
|
e11383a425 | ||
|
|
9321d8c6c3 | ||
|
|
260f435d0e | ||
|
|
862d809708 | ||
|
|
fa1193a86e | ||
|
|
7523925106 | ||
|
|
4fb81774c7 | ||
|
|
4f1af630d1 | ||
|
|
b8d030fa38 | ||
|
|
d6d2cf87a5 | ||
|
|
06f1f53dad | ||
|
|
337794ee6f | ||
|
|
31c465972e | ||
|
|
a9cf39a336 | ||
|
|
bfb8ca4c4d | ||
|
|
7b8cc4c9ba | ||
|
|
1ff0d86f95 | ||
|
|
cede3cf12a | ||
|
|
4ad591131e | ||
|
|
d646e9a531 | ||
|
|
6ed6bec8b3 | ||
|
|
e34fe60bb5 | ||
|
|
6597befc68 | ||
|
|
12be6a4f2c | ||
|
|
1ef9ab619d | ||
|
|
6089399de5 | ||
|
|
1cecb3cfb4 | ||
|
|
79319b292b | ||
|
|
c9fd78ee30 | ||
|
|
0a50a26be3 | ||
|
|
cc52edefd1 | ||
|
|
b458cd0736 | ||
|
|
2c60f27175 | ||
|
|
5bd03ab67f | ||
|
|
b0f0a6e130 | ||
|
|
76c5bf588e | ||
|
|
035167e508 | ||
|
|
3655497ace | ||
|
|
36ca073c81 | ||
|
|
16b4dfa6c0 | ||
|
|
084818431a | ||
|
|
e7ebdb71ee | ||
|
|
1bac787019 | ||
|
|
6517e00b69 | ||
|
|
fa12a2ec18 | ||
|
|
732b6ed1db | ||
|
|
1dc8c34504 | ||
|
|
770798ee71 | ||
|
|
14ec29e4c5 | ||
|
|
07bee16eee | ||
|
|
035f28b63b | ||
|
|
9aa26a9996 | ||
|
|
b423fbeebc | ||
|
|
5efa89e2e4 | ||
|
|
4e5520ba25 | ||
|
|
3f51dc143e | ||
|
|
ea256201f5 | ||
|
|
74db4fb6e1 | ||
|
|
7a37201b69 | ||
|
|
c0e8d19035 | ||
|
|
cd75c09c2e | ||
|
|
fac3078d8d |
@@ -1,7 +1,7 @@
|
|||||||
ENV = 'development'
|
ENV = 'development'
|
||||||
|
|
||||||
# 接口地址
|
# 接口地址
|
||||||
VUE_APP_BASE_API = 'http://localhost:8000'
|
VUE_APP_BASE_API = 'https://eladmin.vip'
|
||||||
VUE_APP_WS_API = 'ws://localhost:8000'
|
VUE_APP_WS_API = 'ws://localhost:8000'
|
||||||
|
|
||||||
# 是否启用 babel-plugin-dynamic-import-node插件
|
# 是否启用 babel-plugin-dynamic-import-node插件
|
||||||
|
|||||||
@@ -2,6 +2,6 @@ ENV = 'production'
|
|||||||
|
|
||||||
# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置
|
# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置
|
||||||
# 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http
|
# 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http
|
||||||
VUE_APP_BASE_API = 'https://eladmin.vip'
|
VUE_APP_BASE_API = '/'
|
||||||
# 如果接口是 http 形式, wss 需要改为 ws
|
# 如果接口是 http 形式, wss 需要改为 ws
|
||||||
VUE_APP_WS_API = 'wss://eladmin.vip'
|
VUE_APP_WS_API = '/'
|
||||||
|
|||||||
78
README.md
78
README.md
@@ -1,77 +1,7 @@
|
|||||||
# ELADMIN-WEB
|
# 注意
|
||||||
|
|
||||||
ELADMIN 前端源码
|
该分支仅用于 预览服务器 Jenkins 自动部署
|
||||||
|
|
||||||
#### 项目源码
|
# 请勿使用该分支进行开发
|
||||||
|
|
||||||
| | 后端源码 | 前端源码 |
|
# 开发请选择 master 分支
|
||||||
|--- |--- | --- |
|
|
||||||
| github | https://github.com/elunez/eladmin | https://github.com/elunez/eladmin-web |
|
|
||||||
| 码云 | https://gitee.com/elunez/eladmin | https://gitee.com/elunez/eladmin-web |
|
|
||||||
|
|
||||||
#### 开发文档
|
|
||||||
[https://eladmin.vip](https://eladmin.vip)
|
|
||||||
|
|
||||||
#### 体验地址
|
|
||||||
[https://eladmin.vip/demo](https://eladmin.vip/demo)
|
|
||||||
|
|
||||||
#### 前端模板
|
|
||||||
|
|
||||||
初始模板基于: [https://github.com/PanJiaChen/vue-element-admin](https://github.com/PanJiaChen/vue-element-admin)
|
|
||||||
|
|
||||||
模板文档: [https://panjiachen.github.io/vue-element-admin-site/zh/guide/](https://panjiachen.github.io/vue-element-admin-site/zh/guide/)
|
|
||||||
|
|
||||||
#### VPS推荐
|
|
||||||
<a href="https://bwh81.net/aff.php?aff=70876" target="_blank">
|
|
||||||
<img src="https://eladmin.vip/images/banner/side.jpeg" alt="明道云零代码构建平台" style="width: 435px;border-radius: 2px;">
|
|
||||||
</a>
|
|
||||||
|
|
||||||
使用优惠码: `BWHNCXNVXV`,可获得 6.81% 的折扣, [查看介绍](https://eladmin.vip/pages/050101/)
|
|
||||||
|
|
||||||
#### Build Setup
|
|
||||||
**推荐 node 版本:12-16**
|
|
||||||
``` bash
|
|
||||||
# 配置镜像加速
|
|
||||||
https://www.ydyno.com/archives/1219.html
|
|
||||||
|
|
||||||
# 安装依赖
|
|
||||||
npm install
|
|
||||||
|
|
||||||
# 启动服务 localhost:8013
|
|
||||||
npm run dev
|
|
||||||
|
|
||||||
# 构建生产环境
|
|
||||||
npm run build:prod
|
|
||||||
```
|
|
||||||
|
|
||||||
#### 常见问题
|
|
||||||
|
|
||||||
1、linux 系统在安装依赖的时候会出现 node-sass 无法安装的问题
|
|
||||||
|
|
||||||
解决方案:
|
|
||||||
```
|
|
||||||
1. 单独安装:npm install --unsafe-perm node-sass
|
|
||||||
2. 直接使用:npm install --unsafe-perm
|
|
||||||
```
|
|
||||||
|
|
||||||
2、加速node-sass安装
|
|
||||||
|
|
||||||
https://www.ydyno.com/archives/1219.html
|
|
||||||
|
|
||||||
#### 特别鸣谢
|
|
||||||
|
|
||||||
- 感谢 [JetBrains](https://www.jetbrains.com/) 提供的非商业开源软件开发授权
|
|
||||||
|
|
||||||
- 感谢 [PanJiaChen](https://github.com/PanJiaChen/vue-element-admin) 大佬提供的前端模板
|
|
||||||
|
|
||||||
- 感谢 [Moxun](https://github.com/moxun1639) 大佬提供的前端 Crud 通用组件
|
|
||||||
|
|
||||||
- 感谢 [zhy6599](https://gitee.com/zhy6599) 大佬提供的后端运维管理相关功能
|
|
||||||
|
|
||||||
- 感谢 [j.yao.SUSE](https://github.com/everhopingandwaiting) 大佬提供的匿名接口与Redis限流等功能
|
|
||||||
|
|
||||||
- 感谢 [d15801543974](https://github.com/d15801543974) 大佬提供的基于注解的通用查询方式
|
|
||||||
|
|
||||||
#### 反馈交流
|
|
||||||
|
|
||||||
- QQ交流群:891137268 、947578238、659622532
|
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vue-cli-service serve",
|
"dev": "vue-cli-service serve",
|
||||||
"build:prod": "vue-cli-service build",
|
"build:prod": "vue-cli-service build --max_old_space_size=8096",
|
||||||
"build:stage": "vue-cli-service build --mode staging",
|
"build:stage": "vue-cli-service build --mode staging",
|
||||||
"preview": "node build/index.js --preview",
|
"preview": "node build/index.js --preview",
|
||||||
"lint": "eslint --ext .js,.vue src",
|
"lint": "eslint --ext .js,.vue src",
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
"@riophae/vue-treeselect": "^0.4.0",
|
"@riophae/vue-treeselect": "^0.4.0",
|
||||||
"@wangeditor/editor": "^5.1.23",
|
"@wangeditor/editor": "^5.1.23",
|
||||||
"@wangeditor/editor-for-vue": "^1.0.2",
|
"@wangeditor/editor-for-vue": "^1.0.2",
|
||||||
"axios": "^0.21.1",
|
"axios": "^1.6.0",
|
||||||
"clipboard": "2.0.4",
|
"clipboard": "2.0.4",
|
||||||
"codemirror": "^5.49.2",
|
"codemirror": "^5.49.2",
|
||||||
"core-js": "^2.6.12",
|
"core-js": "^2.6.12",
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
<meta base="/demo/">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||||
<meta name="renderer" content="webkit">
|
<meta name="renderer" content="webkit">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
<link href="<%= BASE_URL %>favicon.ico" rel="icon">
|
||||||
<title><%= webpackConfig.name %></title>
|
<title><%= webpackConfig.name %></title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
User-agent: *
|
User-agent: *
|
||||||
Disallow: /
|
|
||||||
|
Allow: /
|
||||||
|
|||||||
1
src/assets/icons/svg/vps.svg
Normal file
1
src/assets/icons/svg/vps.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1690351561879" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10676" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M832 320H362.666667c-46.933333 0-85.333333 38.4-85.333334 85.333333v298.666667c0 46.933333 38.4 85.333333 85.333334 85.333333h149.333333l-21.333333 64h-74.666667c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h362.666667c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32H704l-21.333333-64h149.333333c46.933333 0 85.333333-38.4 85.333333-85.333333V405.333333c0-46.933333-38.4-85.333333-85.333333-85.333333z" p-id="10677" fill="#bfbfbf"></path><path d="M320 885.333333c0-12.8 2.133333-25.6 6.4-36.266666-64-14.933333-113.066667-74.666667-113.066667-145.066667V405.333333c0-83.2 66.133333-149.333333 149.333334-149.333333h170.666666V192c0-46.933333-38.4-85.333333-85.333333-85.333333H192C145.066667 106.666667 106.666667 145.066667 106.666667 192v640c0 46.933333 38.4 85.333333 85.333333 85.333333h134.4c-4.266667-10.666667-6.4-21.333333-6.4-32z" p-id="10678" fill="#bfbfbf"></path></svg>
|
||||||
|
After Width: | Height: | Size: 1.2 KiB |
BIN
src/assets/images/background.jpeg
Normal file
BIN
src/assets/images/background.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 236 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 152 KiB |
@@ -207,3 +207,81 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sidebar-container-ad {
|
||||||
|
transition: width 0.28s;
|
||||||
|
width: $sideBarWidth !important;
|
||||||
|
background-color: $menuBg;
|
||||||
|
height: 30%;
|
||||||
|
position: fixed;
|
||||||
|
font-size: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 1001;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
// reset element-ui css
|
||||||
|
.horizontal-collapse-transition {
|
||||||
|
transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scrollbar-wrapper {
|
||||||
|
overflow-x: hidden !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-scrollbar__bar.is-vertical {
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-scrollbar {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.has-logo {
|
||||||
|
.el-scrollbar {
|
||||||
|
height: calc(100% - 50px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.is-horizontal {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
display: inline-block;
|
||||||
|
width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.svg-icon {
|
||||||
|
margin-right: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-menu {
|
||||||
|
border: none;
|
||||||
|
height: 100%;
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
// menu hover
|
||||||
|
.submenu-title-noDropdown,
|
||||||
|
.el-submenu__title {
|
||||||
|
&:hover {
|
||||||
|
background-color: $menuHover !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.is-active>.el-submenu__title {
|
||||||
|
color: $subMenuActiveText !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
& .nest-menu .el-submenu>.el-submenu__title,
|
||||||
|
& .el-submenu .el-menu-item {
|
||||||
|
min-width: $sideBarWidth !important;
|
||||||
|
background-color: $subMenuBg !important;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: $subMenuHover !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ function CRUD(options) {
|
|||||||
// 排序规则,默认 id 降序, 支持多字段排序 ['id,desc', 'createTime,asc']
|
// 排序规则,默认 id 降序, 支持多字段排序 ['id,desc', 'createTime,asc']
|
||||||
sort: ['id,desc'],
|
sort: ['id,desc'],
|
||||||
// 等待时间
|
// 等待时间
|
||||||
time: 50,
|
time: 1,
|
||||||
// CRUD Method
|
// CRUD Method
|
||||||
crudMethod: {
|
crudMethod: {
|
||||||
add: (form) => {},
|
add: (form) => {},
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
<router-view :key="key" />
|
<router-view :key="key" />
|
||||||
</keep-alive>
|
</keep-alive>
|
||||||
</transition>
|
</transition>
|
||||||
<el-backtop :bottom="50" :right="40"><i class="el-icon-caret-top" /></el-backtop>
|
|
||||||
<div v-if="$store.state.settings.showFooter" id="el-main-footer">
|
<div v-if="$store.state.settings.showFooter" id="el-main-footer">
|
||||||
<span v-html="$store.state.settings.footerTxt" />
|
<span v-html="$store.state.settings.footerTxt" />
|
||||||
<span v-if="$store.state.settings.caseNumber"> ⋅ </span>
|
<span v-if="$store.state.settings.caseNumber"> ⋅ </span>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ const whiteList = ['/login']// no redirect whitelist
|
|||||||
|
|
||||||
router.beforeEach((to, from, next) => {
|
router.beforeEach((to, from, next) => {
|
||||||
if (to.meta.title) {
|
if (to.meta.title) {
|
||||||
document.title = to.meta.title + ' - ' + Config.title
|
document.title = Config.title + ' - ' + to.meta.title
|
||||||
}
|
}
|
||||||
NProgress.start()
|
NProgress.start()
|
||||||
if (getToken()) {
|
if (getToken()) {
|
||||||
|
|||||||
@@ -61,8 +61,9 @@ export const constantRouterMap = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
export default new Router({
|
export default new Router({
|
||||||
// mode: 'hash',
|
mode: 'hash',
|
||||||
mode: 'history',
|
base: '/demo/',
|
||||||
|
// mode: 'history',
|
||||||
scrollBehavior: () => ({ y: 0 }),
|
scrollBehavior: () => ({ y: 0 }),
|
||||||
routes: constantRouterMap
|
routes: constantRouterMap
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ import Config from '@/settings'
|
|||||||
import { getCodeImg } from '@/api/login'
|
import { getCodeImg } from '@/api/login'
|
||||||
import Cookies from 'js-cookie'
|
import Cookies from 'js-cookie'
|
||||||
import qs from 'qs'
|
import qs from 'qs'
|
||||||
import Background from '@/assets/images/background.webp'
|
import Background from '@/assets/images/background.jpeg'
|
||||||
export default {
|
export default {
|
||||||
name: 'Login',
|
name: 'Login',
|
||||||
data() {
|
data() {
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
initWebSocket() {
|
initWebSocket() {
|
||||||
const wsUri = (process.env.VUE_APP_WS_API === '/' ? '/' : (process.env.VUE_APP_WS_API + '/')) + 'webSocket/deploy'
|
const wsUri = process.env.VUE_APP_WS_API + '/webSocket/deploy'
|
||||||
this.websock = new WebSocket(wsUri)
|
this.websock = new WebSocket(wsUri)
|
||||||
this.websock.onerror = this.webSocketOnError
|
this.websock.onerror = this.webSocketOnError
|
||||||
this.websock.onmessage = this.webSocketOnMessage
|
this.websock.onmessage = this.webSocketOnMessage
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
:action="fileUploadApi + '?name=' + form.name"
|
:action="fileUploadApi + '?name=' + form.name"
|
||||||
>
|
>
|
||||||
<div class="eladmin-upload"><i class="el-icon-upload" /> 添加文件</div>
|
<div class="eladmin-upload"><i class="el-icon-upload" /> 添加文件</div>
|
||||||
<div slot="tip" class="el-upload__tip">可上传任意格式文件,且不超过100M</div>
|
<div slot="tip" class="el-upload__tip">请勿上传违法文件,演示环境带宽有限,限制文件大小小于50KB</div>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
@@ -145,10 +145,10 @@ export default {
|
|||||||
},
|
},
|
||||||
beforeUpload(file) {
|
beforeUpload(file) {
|
||||||
let isLt2M = true
|
let isLt2M = true
|
||||||
isLt2M = file.size / 1024 / 1024 < 100
|
isLt2M = file.size / 1024 < 52
|
||||||
if (!isLt2M) {
|
if (!isLt2M) {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
this.$message.error('上传文件大小不能超过 100MB!')
|
this.$message.error('上传文件大小超出限制:50KB')
|
||||||
}
|
}
|
||||||
this.form.name = file.name
|
this.form.name = file.name
|
||||||
return isLt2M
|
return isLt2M
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
:before-remove="handleBeforeRemove"
|
:before-remove="handleBeforeRemove"
|
||||||
:on-success="handleSuccess"
|
:on-success="handleSuccess"
|
||||||
:on-error="handleError"
|
:on-error="handleError"
|
||||||
|
:before-upload="beforeUpload"
|
||||||
:file-list="fileList"
|
:file-list="fileList"
|
||||||
:headers="headers"
|
:headers="headers"
|
||||||
:action="qiNiuUploadApi"
|
:action="qiNiuUploadApi"
|
||||||
@@ -39,7 +40,7 @@
|
|||||||
multiple
|
multiple
|
||||||
>
|
>
|
||||||
<el-button size="small" type="primary">点击上传</el-button>
|
<el-button size="small" type="primary">点击上传</el-button>
|
||||||
<div slot="tip" style="display: block;" class="el-upload__tip">请勿上传违法文件,且文件不超过15M</div>
|
<div slot="tip" style="display: block;" class="el-upload__tip">请勿上传违法文件,演示环境带宽有限,限制文件大小小于50KB</div>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="doSubmit">确认</el-button>
|
<el-button type="primary" @click="doSubmit">确认</el-button>
|
||||||
@@ -120,6 +121,15 @@ export default {
|
|||||||
_this.init()
|
_this.init()
|
||||||
_this.dialog = true
|
_this.dialog = true
|
||||||
},
|
},
|
||||||
|
beforeUpload(file) {
|
||||||
|
let isLt2M = true
|
||||||
|
isLt2M = file.size / 1024 < 52
|
||||||
|
if (!isLt2M) {
|
||||||
|
this.loading = false
|
||||||
|
this.$message.error('上传文件大小超出限制:50KB')
|
||||||
|
}
|
||||||
|
return isLt2M
|
||||||
|
},
|
||||||
handleSuccess(response, file, fileList) {
|
handleSuccess(response, file, fileList) {
|
||||||
const uid = file.uid
|
const uid = file.uid
|
||||||
const id = response.id
|
const id = response.id
|
||||||
|
|||||||
@@ -13,9 +13,8 @@ const port = 8013 // 端口配置
|
|||||||
// All configuration item explanations can be find in https://cli.vuejs.org/config/
|
// All configuration item explanations can be find in https://cli.vuejs.org/config/
|
||||||
module.exports = {
|
module.exports = {
|
||||||
// hash 模式下可使用
|
// hash 模式下可使用
|
||||||
// publicPath: process.env.NODE_ENV === 'development' ? '/' : './',
|
publicPath: process.env.NODE_ENV === 'development' ? '/' : '/demo/',
|
||||||
publicPath: '/',
|
outputDir: 'demo',
|
||||||
outputDir: 'dist',
|
|
||||||
assetsDir: 'static',
|
assetsDir: 'static',
|
||||||
lintOnSave: process.env.NODE_ENV === 'development',
|
lintOnSave: process.env.NODE_ENV === 'development',
|
||||||
productionSourceMap: false,
|
productionSourceMap: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user