flat: 修改传说中的Attachment
This commit is contained in:
@@ -25,7 +25,7 @@ export async function uploadFile(file) {
|
||||
}
|
||||
header[website.tokenName] = "bearer " + token
|
||||
uni.uploadFile({
|
||||
url: `${baseUrl}/api/jobslink-api/resource/file/upload/file?bussinessType=5`,
|
||||
url: `${baseUrl}/api/jobslink-api/resource/file/save?bussinessType=5`,
|
||||
header,
|
||||
filePath: file.url,
|
||||
// formData: formdata,
|
||||
@@ -36,7 +36,7 @@ export async function uploadFile(file) {
|
||||
}) => {
|
||||
const resp = JSON.parse(data)
|
||||
if (statusCode === 200 && resp.code === 200) {
|
||||
resolve(resp)
|
||||
resolve(resp.msg)
|
||||
} else {
|
||||
reject(new Error('数据异常'))
|
||||
}
|
||||
|
||||
@@ -39,15 +39,10 @@
|
||||
},
|
||||
computed: {
|
||||
ImgUrl(val) {
|
||||
if (this.value) {
|
||||
const url = this.value.split('|')
|
||||
return [{
|
||||
name: 'img',
|
||||
url: url[url.length - 1]
|
||||
}]
|
||||
} else {
|
||||
return []
|
||||
}
|
||||
return this.value ? [{
|
||||
name: 'img.jpg',
|
||||
url: this.value
|
||||
}] : []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -57,13 +52,7 @@
|
||||
name
|
||||
}) {
|
||||
// this.$emit("input", file);
|
||||
uploadFile(file).then((fileObj) => {
|
||||
const {
|
||||
id,
|
||||
path
|
||||
} = fileObj.data
|
||||
const url = `${id}|${path}$`
|
||||
console.log(url)
|
||||
uploadFile(file).then((url) => {
|
||||
this.$emit("input", url);
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user