单点修改
This commit is contained in:
1 parent
fa76e2c072
commit
aa5b2039a8
2 files changed
+16
-7
No files matched your search
@@ -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>
|
||||
Reference in new issue
Block a user