浏览代码

no message

libushang 9 月之前
父节点
当前提交
2d2bdf86ae
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      src/views/index.vue

+ 5 - 2
src/views/index.vue

@@ -33,10 +33,13 @@ onMounted(() => {
   // if(env === 'development') 
   // if(env === 'development') 
   {
   {
     localStorage.setItem('Admin-Token', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxIiwiZXhwIjoyMDM5Njk2ODMzfQ.Rhd38oo_S1odjg0xnT4n31cCWCAAPXGb8y_V2XcgqzQ');
     localStorage.setItem('Admin-Token', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxIiwiZXhwIjoyMDM5Njk2ODMzfQ.Rhd38oo_S1odjg0xnT4n31cCWCAAPXGb8y_V2XcgqzQ');
+    setTimeout(()=> {
+      getUserInfo();
+    }, 500);
   }
   }
 })
 })
 
 
-nextTick(()=>{
+const getUserInfo = () => {
   getInfo().then((res)=>{
   getInfo().then((res)=>{
     const roles = res.data.roles;
     const roles = res.data.roles;
     console.log('roles', roles);
     console.log('roles', roles);
@@ -58,7 +61,7 @@ nextTick(()=>{
       handleJump('WorkerIndex', 'worker');
       handleJump('WorkerIndex', 'worker');
     }
     }
   })
   })
-})
+}
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>