reghao 4 달 전
부모
커밋
a6d8fa5fe9
2개의 변경된 파일9개의 추가작업 그리고 17개의 파일을 삭제
  1. 9 14
      src/views/my/MyProfile.vue
  2. 0 3
      src/views/post/VideoPostPublish.vue

+ 9 - 14
src/views/my/MyProfile.vue

@@ -189,7 +189,7 @@ export default {
   mixins: [userMixin],
   data() {
     return {
-      imgOssUrl: '',
+      imgOssUrl: null,
       imgHeaders: {
         Authorization: ''
       },
@@ -230,20 +230,10 @@ export default {
         this.imgOssUrl = resData.ossUrl
         this.imgHeaders.Authorization = 'Bearer ' + resData.token
       } else {
-        this.$notify({
-          title: '提示',
-          message: '获取 OSS 服务器地址失败, 暂时无法上传文件',
-          type: 'error',
-          duration: 3000
-        })
+        this.$message.error(res.msg)
       }
     }).catch(error => {
-      this.$notify({
-        title: '提示',
-        message: error.message,
-        type: 'warning',
-        duration: 3000
-      })
+      this.$message.error(error.message)
     })
   },
   mounted() {
@@ -251,6 +241,11 @@ export default {
   methods: {
     // ****************************************************************************************************************
     beforeAvatarUpload(file) {
+      if (this.imgOssUrl === null) {
+        this.$message.error('没有可上传的 OSS 地址!')
+        return
+      }
+
       const isJPG = file.type === 'image/jpeg'
       const isLt2M = file.size / 1024 / 1024 < 2
       if (!isJPG) {
@@ -267,7 +262,7 @@ export default {
         this.coverUrl = URL.createObjectURL(file.raw)
 
         const avatar = {}
-        avatar.channelId = this.imgData.channelCode
+        avatar.channelCode = this.imgData.channelCode
         avatar.uploadId = resData.uploadId
         updateAvatar(avatar).then(resp => {
           if (resp.code === 0) {

+ 0 - 3
src/views/post/VideoPostPublish.vue

@@ -480,9 +480,6 @@ export default {
     },
     // 根据输入的标签获取相似的标签
     getRecommendTags(tags) {
-      for (const tag of tags) {
-        console.log(tag)
-      }
     },
     onSubmit() {
       if (!this.videoPostForm.videoId) {