This commit is contained in:
weiwei committed 2025-05-19 15:37:59 +08:00
1 parent c2a765ebf7
commit ab5998ce89
1 file changed
+9 -9
+9 -9
View File
@@ -79,15 +79,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 })
@@ -104,7 +104,7 @@ async function handleShLogin(): Promise<boolean> {
}
// 如果是设备未验证,保存响应数据
if (response.data === -1) {
if (response.data == -1) {
uni.setStorageSync(TOKEN_KEY, { data: -1 })
}