reghao 2 лет назад
Родитель
Сommit
7370956010
4 измененных файлов с 17 добавлено и 4 удалено
  1. 6 0
      src/views/home/Status.vue
  2. 2 0
      src/views/home/Video.vue
  3. 1 1
      src/views/home/VideoPage.vue
  4. 8 3
      src/views/user/Profile.vue

+ 6 - 0
src/views/home/Status.vue

@@ -22,6 +22,7 @@
 import TextCard from '@/components/card/TextCard'
 import StatusCard from '@/components/card/StatusCard'
 import HotList from '@/components/hotlist/HotList'
+import { getUserInfo } from '@/utils/auth'
 import { statusRecommend } from '@/api/status'
 
 export default {
@@ -37,6 +38,11 @@ export default {
     }
   },
   created() {
+    const userInfo = getUserInfo()
+    if (userInfo != null) {
+      document.title = userInfo.username + '的时间线'
+    }
+
     this.currentPage = 1
     statusRecommend(this.currentPage).then(res => {
       if (res.code === 0) {

+ 2 - 0
src/views/home/Video.vue

@@ -105,6 +105,8 @@ export default {
     }
   },
   created() {
+    document.title = '视频'
+
     this.currentPage = 1
     videoCategory().then(res => {
       console.log(res.data)

+ 1 - 1
src/views/home/VideoPage.vue

@@ -334,7 +334,7 @@ export default {
         // 用户未登录,给出提示
         this.$notify({
           title: '提示',
-          message: '要登后才可以收藏哦!',
+          message: '要登后才可以收藏哦!',
           type: 'warning',
           duration: 3000
         })

+ 8 - 3
src/views/user/Profile.vue

@@ -7,7 +7,8 @@
 </template>
 
 <script>
-import { getUserInfo } from "@/api/user";
+import { getUserInfo } from '@/utils/auth'
+// import { getUserInfo } from "@/api/user";
 
 export default {
   name: 'Profile',
@@ -20,12 +21,16 @@ export default {
     }
   },
   created() {
-    getUserInfo(10001).then(res => {
+    const userInfo = getUserInfo()
+    if (userInfo != null) {
+      document.title = userInfo.username + '的帐号主页'
+    }
+    /*getUserInfo(10001).then(res => {
       if (res.code === 0) {
         this.user = res.data
         document.title = this.user.screenName + '的帐号主页'
       }
-    })
+    })*/
   },
   mounted() {
     // 当窗口宽度改变时获取屏幕宽度