浏览代码

Update loganInfo.tsx

lex 2 年之前
父节点
当前提交
8f0dab76bd
共有 1 个文件被更改,包括 14 次插入6 次删除
  1. 14 6
      src/components/col-header/modals/loganInfo.tsx

+ 14 - 6
src/components/col-header/modals/loganInfo.tsx

@@ -161,16 +161,18 @@ export default defineComponent({
     }
     }
     const logout = async () => {
     const logout = async () => {
       try {
       try {
-        const res = await request.get('/api-auth/exit', {})
+        await request.get('/api-auth/exit', {})
         router.push({ path: '/' })
         router.push({ path: '/' })
         removeAuth()
         removeAuth()
-        window.location.reload()
+        setTimeout(() => {
+          window.location.reload()
+        }, 100)
       } catch (e) {
       } catch (e) {
         console.log(e)
         console.log(e)
       }
       }
     }
     }
-    const gotoFans = (nowPath:string)=>{
-      router.push({ path: nowPath, })
+    const gotoFans = (nowPath: string) => {
+      router.push({ path: nowPath })
     }
     }
     const changeState = (val: string) => {
     const changeState = (val: string) => {
       if (val == 'strudent') {
       if (val == 'strudent') {
@@ -240,13 +242,19 @@ export default defineComponent({
 
 
                   {this.userType == 'TEACHER' ? (
                   {this.userType == 'TEACHER' ? (
                     <div class={classes.dropdownInfo}>
                     <div class={classes.dropdownInfo}>
-                      <div class={classes.dropdownItem} onClick={()=>this.gotoFans('/userInfo/myFans')}>
+                      <div
+                        class={classes.dropdownItem}
+                        onClick={() => this.gotoFans('/userInfo/myFans')}
+                      >
                         <p class={classes.dropdownItemTitle}>
                         <p class={classes.dropdownItemTitle}>
                           {this.user.fansNum || 0}
                           {this.user.fansNum || 0}
                         </p>
                         </p>
                         <p class={classes.dropdownItemsubTitle}>粉丝</p>
                         <p class={classes.dropdownItemsubTitle}>粉丝</p>
                       </div>
                       </div>
-                      <div class={classes.dropdownItem} onClick={()=>this.gotoFans('/userInfo/musicClass')}>
+                      <div
+                        class={classes.dropdownItem}
+                        onClick={() => this.gotoFans('/userInfo/musicClass')}
+                      >
                         <p class={classes.dropdownItemTitle}>
                         <p class={classes.dropdownItemTitle}>
                           {this.user.musicSheetNum || 0}
                           {this.user.musicSheetNum || 0}
                         </p>
                         </p>