Commit 79ece97f authored by Davve's avatar Davve

限制上传图片类型

parent 5bd469c0
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
:on-success="handleImageSuccess" :on-success="handleImageSuccess"
class="image-uploader" class="image-uploader"
drag drag
accept="image/png,image/gif,image/jpg,image/jpeg"
:before-upload="handleBeforeUpload"
action="/api/file/upload"> action="/api/file/upload">
<i class="el-icon-upload"/> <i class="el-icon-upload"/>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div> <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
...@@ -66,7 +68,7 @@ export default { ...@@ -66,7 +68,7 @@ export default {
handleImageSuccess(file) { handleImageSuccess(file) {
this.emitInput(file.data.file_url) this.emitInput(file.data.file_url)
}, },
beforeUpload() { handleBeforeUpload() {
const _self = this const _self = this
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
getToken().then(response => { getToken().then(response => {
......
...@@ -196,6 +196,10 @@ export default { ...@@ -196,6 +196,10 @@ export default {
OffLineOrOnLine({type:val, ids:str}).then(response => { OffLineOrOnLine({type:val, ids:str}).then(response => {
this.multipleSelection = []; this.multipleSelection = [];
this.$message.success(response.data.data.message); this.$message.success(response.data.data.message);
setTimeout(() => {
this.$router.go(0)
}, 1000)
}) })
}, },
} }
......
...@@ -128,7 +128,7 @@ export default { ...@@ -128,7 +128,7 @@ export default {
userListOptions: [], userListOptions: [],
expireTimeOption: { expireTimeOption: {
disabledDate(date){ disabledDate(date){
return date.getTime() <= Date.now() ; return date.getTime() <= Date.now() - 86400000;
} }
}, },
rules: { rules: {
......
...@@ -143,6 +143,7 @@ export default { ...@@ -143,6 +143,7 @@ export default {
OffLineOrOnLine({type:val, ids:str}).then(response => { OffLineOrOnLine({type:val, ids:str}).then(response => {
this.multipleSelection = []; this.multipleSelection = [];
this.$message.success(response.data.data.message); this.$message.success(response.data.data.message);
}) })
}, },
handleFilter() { handleFilter() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment