flat: 修改传说中的Attachment

This commit is contained in:
Apcallover
2024-04-22 15:59:25 +08:00
parent d71c5171f4
commit ab94467da4
2 changed files with 7 additions and 18 deletions

View File

@@ -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('数据异常'))
}

View File

@@ -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);
})
},