This commit is contained in:
weiwei committed 2025-05-19 14:32:11 +08:00
1 parent 79a01f9667
commit a0db682078
1 file changed
+16 -16
+16 -16
View File
@@ -57,15 +57,15 @@ async function handleShLogin(): Promise<boolean> {
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<boolean> {
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