This commit is contained in:
pushuo 2022-07-25 17:31:20 +08:00
parent 91aaa2296a
commit b2a8699edf
1 changed files with 8 additions and 13 deletions

View File

@ -9,10 +9,10 @@
{{-- <button type="button" @click="upload" class="btn btn-primary">上传插件</button> --}}
<el-upload
class="upload-demo"
action="{{ admin_route('plugins.import') }}"
action=""
:limit="1"
:on-change="handleFileChange"
:before-upload="beforeFileUpload"
:show-file-list="false"
:http-request="uploadFile"
accept=".zip"
>
<el-button size="small" type="primary">上传插件 (仅支持 zip 文件)</el-button>
@ -83,16 +83,11 @@
})
},
handleFileChange(e) {
console.log(e);
},
beforeFileUpload(e) {
console.log(e);
},
upload() {
uploadFile(file) {
$http.post('plugins/import', file).then((res) => {
layer.msg(res.message)
location.reload();
})
},
installedPlugin(code, type, index) {