diff --git a/src/sheep/utils/request.ts b/src/sheep/utils/request.ts index 340349f..f121a4d 100644 --- a/src/sheep/utils/request.ts +++ b/src/sheep/utils/request.ts @@ -57,15 +57,15 @@ async function handleShLogin(): Promise { try { uni.showLoading({ title: "登录中...", mask: true }) - // const userInfo = await (window as any).CP2.getUserInfo() - // if (userInfo.code == 0 || !userInfo.data.accountId || !userInfo.data.sessionId) { - // uni.showToast({ title: "获取诗画用户信息失败", icon: "none" }) - // return false - // } + const userInfo = await (window as any).CP2.getUserInfo() + if (userInfo.code == 0 || !userInfo.data.accountId || !userInfo.data.sessionId) { + uni.showToast({ title: "获取诗画用户信息失败", icon: "none" }) + return false + } - // const { accountId, sessionId } = userInfo.data - // const response = await userApi.authsh({ accountId, sessionId }) - const response = await userApi.authsh({ accountId: "67e790d6a95d5a7b507e53dd", sessionId: "68215b03a95d5a4899d20cb4" }) // 测试 + const { accountId, sessionId } = userInfo.data + const response = await userApi.authsh({ accountId, sessionId }) + // const response = await userApi.authsh({ accountId: "67e790d6a95d5a7b507e53dd", sessionId: "68215b03a95d5a4899d20cb4" }) // 测试 if (response.code == 0) { uni.setStorageSync(TOKEN_KEY, { accessToken: response.data.accessToken }) @@ -81,14 +81,14 @@ async function handleShLogin(): Promise { return false } - if (response.data == -1) { - uni.showToast({ title: "您的设备需要信任验证", icon: "none" }) - await showVerifyDeviceImpModel(async () => { - await autoLogin() - uni.reLaunch({ url: window.location.href.split("#")[1] }) - }) - return false - } + // if (response.data == -1) { + // uni.showToast({ title: "您的设备需要信任验证", icon: "none" }) + // await showVerifyDeviceImpModel(async () => { + // await autoLogin() + // uni.reLaunch({ url: window.location.href.split("#")[1] }) + // }) + // return false + // } uni.showToast({ title: response.msg || "登录失败", icon: "none" }) return false