Commit 79ece97f authored by Davve's avatar Davve

限制上传图片类型

parent 5bd469c0
......@@ -7,6 +7,8 @@
:on-success="handleImageSuccess"
class="image-uploader"
drag
accept="image/png,image/gif,image/jpg,image/jpeg"
:before-upload="handleBeforeUpload"
action="/api/file/upload">
<i class="el-icon-upload"/>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
......@@ -66,7 +68,7 @@ export default {
handleImageSuccess(file) {
this.emitInput(file.data.file_url)
},
beforeUpload() {
handleBeforeUpload() {
const _self = this
return new Promise((resolve, reject) => {
getToken().then(response => {
......
......@@ -196,6 +196,10 @@ export default {
OffLineOrOnLine({type:val, ids:str}).then(response => {
this.multipleSelection = [];
this.$message.success(response.data.data.message);
setTimeout(() => {
this.$router.go(0)
}, 1000)
})
},
}
......
......@@ -128,7 +128,7 @@ export default {
userListOptions: [],
expireTimeOption: {
disabledDate(date){
return date.getTime() <= Date.now() ;
return date.getTime() <= Date.now() - 86400000;
}
},
rules: {
......
......@@ -143,6 +143,7 @@ export default {
OffLineOrOnLine({type:val, ids:str}).then(response => {
this.multipleSelection = [];
this.$message.success(response.data.data.message);
})
},
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