diff --git a/src/stores/AuthStore.js b/src/stores/AuthStore.js index 665586b..a70b85b 100644 --- a/src/stores/AuthStore.js +++ b/src/stores/AuthStore.js @@ -143,17 +143,16 @@ const useAuthStore = create(devtools((set, get) => ({ return parsedUser } else { return null } }, - // 钉钉免登后获取用户信息 loginByJSAuth: async (authCode) => { - const { saveUserSession, setLoginStatus } = get() + const { saveUserSession, setLoginStatus, parseLoginJson } = get() + setLoginStatus(200) const json = await fetchJSON( 'https://p9axztuwd7x8a7.mycht.cn/dingtalk/dingtalkwork/Getusers_auth_wa', - { authCode }, + { code: authCode }, ) - const parsedUser = parseLoginJson(json) if (parsedUser) { @@ -165,6 +164,8 @@ const useAuthStore = create(devtools((set, get) => ({ } else { setLoginStatus(403) } + + }, getPrimaryEmail: () => {