fix: 上传更新包添加头部信息
This commit is contained in:
1 parent
f4e4d8c8f7
commit
c941ec5723
1 file changed
+7
-1
@@ -7,7 +7,7 @@
|
||||
</el-button>
|
||||
<div>
|
||||
测试更新
|
||||
<el-upload :auto-upload="false" v-model="fileList" action="/api/system/update" ref="uploadRef">
|
||||
<el-upload :auto-upload="false" v-model="fileList" action="/api/system/update" ref="uploadRef" :headers="headers">
|
||||
<template #trigger>
|
||||
<el-button type="primary">select file</el-button>
|
||||
</template>
|
||||
@@ -32,6 +32,12 @@ const userStore = useUserStore()
|
||||
|
||||
const uploadRef = ref()
|
||||
|
||||
const headers = computed(() => {
|
||||
return {
|
||||
Authorization: `Bearer ${userStore.token}`
|
||||
}
|
||||
})
|
||||
|
||||
const submitUpload = () => {
|
||||
uploadRef.value!.submit()
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user