|
|
@@ -290,16 +290,22 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
- handlePhotoUpload(file) {
|
|
|
+ async handlePhotoUpload(file) {
|
|
|
// cdnService.uploadVoice(file);
|
|
|
- this.file = file;
|
|
|
+ // this.file = file;
|
|
|
let formData = {
|
|
|
- file: this.file.raw
|
|
|
+ file: file.raw
|
|
|
}
|
|
|
- let response = cdnService.upload(formData);
|
|
|
- console.log(response.data);
|
|
|
- // this.photoFileName = file.name;
|
|
|
- // todo 实际项目中应上传文件到服务器
|
|
|
+
|
|
|
+ cdnService.upload(formData).then(res => {
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ this.photo = res.data.data;
|
|
|
+ }else {
|
|
|
+ this.photo = '';
|
|
|
+ }
|
|
|
+ console.log(res.data.data);
|
|
|
+ console.log(this.photo);
|
|
|
+ });
|
|
|
},
|
|
|
handleVoiceUpload(file) {
|
|
|
|