Browse Source

调整likeNum顺序

wolyshaw 3 years ago
parent
commit
ef9cce4056
2 changed files with 2 additions and 4 deletions
  1. 2 0
      src/components/live-broadcast/index.tsx
  2. 0 4
      src/components/live-message/index.tsx

+ 2 - 0
src/components/live-broadcast/index.tsx

@@ -53,6 +53,8 @@ export default defineComponent({
     async initializeRoom () {
       if (!state.user) throw Error('请先登录')
       try {
+        runtime.likeCount = state.user?.likeNum || 0
+        runtime.lookCount = state.user?.lookNum || 0
         const isLiveing = sessionStorage.getItem(RuntimeUtils.START_LIVE_STATUS) === 'liveing'
         // IM连接
         await RuntimeUtils.connectIM(state.user?.imToken)

+ 0 - 4
src/components/live-message/index.tsx

@@ -32,10 +32,6 @@ export default defineComponent({
       return status
     }
   },
-  mounted() {
-    runtime.likeCount = state.user?.likeNum || 0
-    runtime.lookCount = state.user?.lookNum || 0
-  },
   methods: {
     tabChange(val: any) {
       this.modelIndex = val.props.name