Prechádzať zdrojové kódy

更新用户 avatar 更新接口

reghao 2 rokov pred
rodič
commit
e57093a2c5
1 zmenil súbory, kde vykonal 4 pridanie a 3 odobranie
  1. 4 3
      src/views/my/MyProfile.vue

+ 4 - 3
src/views/my/MyProfile.vue

@@ -118,10 +118,11 @@ export default {
         this.coverUrl = URL.createObjectURL(file.raw)
 
         const avatar = {}
-        avatar.avatarUrl = resData.url
+        avatar.channelId = this.imgData.channelId
+        avatar.uploadId = resData.uploadId
         updateAvatar(avatar).then(resp => {
           if (resp.code === 0) {
-            this.loginUser.avatarUrl = resData.url
+            this.loginUser.avatarUrl = resp.data.url
             updateAuthedUser(this.loginUser)
           } else {
             this.$notify({
@@ -135,7 +136,7 @@ export default {
       } else {
         this.$notify({
           title: '提示',
-          message: '视频封面上传失败,请重试!' + res.msg,
+          message: '头像上传失败,请重试!' + res.msg,
           type: 'warning',
           duration: 3000
         })