|
@@ -25,6 +25,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import { getToken } from '@/utils/auth'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -64,12 +65,11 @@
|
|
|
success(resp) {
|
|
|
resp.tempFiles.forEach((item, index) => {
|
|
|
const task = uni.uploadFile({
|
|
|
- url: _this.$HTTP + `/obs`,
|
|
|
+ url: _this.$HTTP + `/common/upload`,
|
|
|
filePath: item.path,
|
|
|
name: 'file',
|
|
|
formData: {},
|
|
|
header: _this.headers,
|
|
|
-
|
|
|
success: res => {
|
|
|
// 判断是否json字符串,将其转为json格式
|
|
|
let data = JSON.parse(res.data);
|
|
@@ -80,7 +80,7 @@
|
|
|
_this.imgArr.push(data.data.url)
|
|
|
_this.$modal.msg('上传成功!')
|
|
|
_this.photo = false;
|
|
|
- this.$emit('updateImg',this.imgArr);
|
|
|
+ this.$emit('updateImg',_this.imgArr);
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -120,7 +120,7 @@
|
|
|
maxDuration: 30,
|
|
|
success(resp) {
|
|
|
const task = uni.uploadFile({
|
|
|
- url: _this.$HTTP + `/obs`,
|
|
|
+ url: _this.$HTTP + `/common/upload`,
|
|
|
filePath: resp.tempFilePath,
|
|
|
name: 'file',
|
|
|
formData: {},
|
|
@@ -136,7 +136,7 @@
|
|
|
_this.imgArr.push(data.data.url)
|
|
|
_this.$modal.msg('上传成功!')
|
|
|
_this.photo = false;
|
|
|
- this.$emit('updateImg',this.imgArr);
|
|
|
+ this.$emit('updateImg',_this.imgArr);
|
|
|
}
|
|
|
}
|
|
|
},
|