MCPcopy Create free account
hub / github.com/MCSManager/MCSManager / updateUserInfo

Function updateUserInfo

frontend/src/stores/useAppStateStore.ts:42–58  ·  view source on GitHub ↗
(userInfo?: LoginUserInfo)

Source from the content-addressed store, hash-verified

40 const isLogged = computed(() => Number(state.userInfo?.permission) > 0);
41
42 const updateUserInfo = async (userInfo?: LoginUserInfo) => {
43 try {
44 if (userInfo) {
45 state.userInfo = userInfo;
46 } else {
47 const info = await reqUserInfo();
48 if (info.value) {
49 state.userInfo = info.value;
50 } else {
51 throw new Error("Failed to get user information from server!");
52 }
53 }
54 } catch (err: any) {
55 console.error(err);
56 throw new Error(err.message);
57 }
58 };
59
60 const updatePanelStatus = async () => {
61 const { state } = useAppStateStore();

Callers 3

mountAppFunction · 0.85
autoOpenUserApiKeyFunction · 0.85
router.tsFile · 0.85

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected