Procházet zdrojové kódy

update MyProfile.vue

reghao před 1 rokem
rodič
revize
3411e6713f
1 změnil soubory, kde provedl 4 přidání a 3 odebrání
  1. 4 3
      src/views/my/MyProfile.vue

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

@@ -66,9 +66,9 @@
 </template>
 
 <script>
-import { getServerInfo } from '@/api/content'
 import { updateAvatar } from '@/api/account'
 import { getAuthedUser, updateAuthedUser } from '@/utils/auth'
+import {getAvatarChannelInfo} from "@/api/file";
 
 export default {
   name: 'MyProfile',
@@ -79,7 +79,7 @@ export default {
         Authorization: ''
       },
       imgData: {
-        channelId: process.env.VUE_APP_UPLOAD_AVATAR_CHANNEL
+        channelId: null
       },
       coverUrl: null,
       // ****************************************************************************************************************
@@ -88,9 +88,10 @@ export default {
   },
   created() {
     this.loginUser = getAuthedUser()
-    getServerInfo(this.imgData.channelId).then(res => {
+    getAvatarChannelInfo().then(res => {
       if (res.code === 0) {
         const resData = res.data
+        this.imgData.channelId = resData.channelId
         this.imgOssUrl = resData.ossUrl
         this.imgHeaders.Authorization = 'Bearer ' + resData.token
       } else {