单点修改

This commit is contained in:
zjf committed 2024-11-26 17:14:56 +08:00
1 parent fa76e2c072
commit aa5b2039a8
2 files changed
+16 -7

No files matched your search

+3
View File
@@ -85,6 +85,9 @@ const doLogin = async (loginType, token, accountId, sessionId) => {
authData = response.data;
} else {
//后期手机号+验证码登录
router.jump('/pages/test/login')
uni.hideLoading()
return
}
// const {data: authData} = await userApi.auth(token);
uni.setStorageSync(tokenKey, authData)
+13 -7
View File
@@ -41,15 +41,21 @@ const doSubmit = async () => {
const tokenKey = constant.storageConstant.TOKEN
const userInfoKey = constant.storageConstant.USERINFO
uni.showLoading({ title: '登录中...', mask: true });
try {
// try {
const _pa = { ...applyForm }
const { data } = await userApi.testLogin(_pa)
uni.setStorageSync(tokenKey, data)
const res = await userApi.testLogin(_pa)
console.log(res)
if (res.code!=0){
uni.showToast({ title: res.msg+'。登录失败,请重新登录', icon: "error" });
return
}
uni.setStorageSync(tokenKey, res.data)
const { data: userData } = await userApi.userInfo();
uni.setStorageSync(userInfoKey, userData)
} catch (e) {
console.log(e);
}
// } catch (e) {
// console.log(222)
// console.log(e);
// }
uni.hideLoading()
uni.showToast({ title: '登录成功', icon: "none" });
router.back()
@@ -86,4 +92,4 @@ const doSubmit = async () => {
padding-bottom: 10rpx !important;
}
}
</style>
</style>