安琪酵母(西藏)益生菌信息采集中心智能实验室
longyvfengyun
2023-06-30 09ab26b8df36c5ebd7cfc20a862011fb98681588
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import {ref} from "vue";
import {useRouter} from "vue-router";
 
/**
 * 用户下拉组件
 */
const userDropdown = ()=>{
  const isVisible = ref(false);
  const router = useRouter();
  const commandClick = (name)=>{
    switch (name) {
      case "outSystem":
        outSystem();
        break;
      case "passwordChange":
        passwordChange();
        break;
      default:
        break;
    }
  }
 
  const outSystem = ()=>{
    sessionStorage.removeItem("login-token");
    router.push({
      path: "/login",
      replace: true
    });
  };
 
  const passwordChange = ()=>{
 
  }
  const visibleChange = (state)=>{
    isVisible.value = state;
  }
  return {isVisible, commandClick, visibleChange};
};
export default userDropdown;