fix: 上传更新包添加头部信息

This commit is contained in:
539943419 committed 2025-01-15 20:27:08 +08:00
1 parent f4e4d8c8f7
commit c941ec5723
1 file changed
+7 -1
+7 -1
View File
@@ -7,7 +7,7 @@
</el-button> </el-button>
<div> <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> <template #trigger>
<el-button type="primary">select file</el-button> <el-button type="primary">select file</el-button>
</template> </template>
@@ -32,6 +32,12 @@ const userStore = useUserStore()
const uploadRef = ref() const uploadRef = ref()
const headers = computed(() => {
return {
Authorization: `Bearer ${userStore.token}`
}
})
const submitUpload = () => { const submitUpload = () => {
uploadRef.value!.submit() uploadRef.value!.submit()
} }