取消headers
This commit is contained in:
parent
1098acf567
commit
26028d5dbe
@ -79,10 +79,10 @@
|
||||
<el-input v-model="form.name" placeholder="请输入姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="照片">
|
||||
<!-- :headers="upload.headers" -->
|
||||
<el-upload
|
||||
class="upload-demo"
|
||||
:action="upload.url"
|
||||
:headers="upload.headers"
|
||||
:on-preview="handlePreview"
|
||||
:on-remove="handleRemove"
|
||||
:on-success="handleSuccess"
|
||||
@ -148,9 +148,9 @@ export default {
|
||||
// 上传参数
|
||||
upload: {
|
||||
// 上传地址
|
||||
url: process.env.VUE_APP_BASE_API + "/restaurant/images/uploadDispatchings",
|
||||
url: process.env.VUE_APP_BASE_API + "/common/upload/restaurant",
|
||||
// 设置上传的请求头部
|
||||
headers: { Authorization: "Bearer " + getToken() }
|
||||
// headers: { Authorization: "Bearer " + getToken() }
|
||||
},
|
||||
// 文件列表
|
||||
fileList: [],
|
||||
@ -181,7 +181,8 @@ export default {
|
||||
this.form = {
|
||||
id: undefined,
|
||||
name: undefined,
|
||||
imageUrl: undefined
|
||||
imageUrl: undefined,
|
||||
findId: ''
|
||||
};
|
||||
this.fileList = [];
|
||||
this.resetForm("form");
|
||||
@ -221,12 +222,9 @@ export default {
|
||||
},
|
||||
/** 文件上传成功处理 */
|
||||
handleSuccess(response, file, fileList) {
|
||||
console.log('上传响应:', response);
|
||||
console.log('上传文件:', file);
|
||||
console.log('文件列表:', fileList);
|
||||
|
||||
if (response.code === 200) {
|
||||
this.form.imageUrl = response.data || response.url;
|
||||
this.form.imageUrl = response.url;
|
||||
this.form.fileId = response.fileId;
|
||||
this.$modal.msgSuccess("上传成功");
|
||||
this.fileList = fileList;
|
||||
} else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user