fix:事务处理
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
} else { // 已登录
|
||||
userinfo.value = JSON.parse(uni.getStorageSync('userInfo'))
|
||||
h_info.value = userinfo.value
|
||||
h_info.value.surgery_time = h_info.value.surgery_time
|
||||
h_info.value.surgery_time = h_info.value.SurgeryTime
|
||||
userinfo.value.avatar = uni.getStorageSync('avatarUrl')
|
||||
h_index.value = hospitals.value.findIndex((item,i) => {
|
||||
return item.ID == userinfo.value.HospitalId
|
||||
@@ -33,7 +33,7 @@
|
||||
pageSize:1000,
|
||||
key:''
|
||||
})
|
||||
const hospitals = ref(null)
|
||||
const hospitals = ref([])
|
||||
const userinfo = ref({})
|
||||
const avatar = ref(null)
|
||||
const h_info = ref({})
|
||||
@@ -144,6 +144,7 @@
|
||||
// if(!is_login.value) { // 新用户 - 先登录
|
||||
|
||||
// }
|
||||
userinfo.value.SurgeryTime = obj.surgery_time
|
||||
const res = await api.userinfoUpdae(obj) // 更新用户信息
|
||||
if(res.code === 0) {
|
||||
uni.showToast({
|
||||
@@ -175,7 +176,7 @@
|
||||
});
|
||||
let res2=await api.wx_login({code:res.code},userId);
|
||||
if(res2.code === 0) {
|
||||
userinfo.value.HospitalId = hospitals.value[h_index.value].ID
|
||||
userinfo.value.HospitalId = hospitals.value[h_index.value]?.ID
|
||||
h_info.value.hospitalId = userinfo.value.HospitalId
|
||||
uni.setStorageSync('avatarUrl', userinfo.value.avatar);//avatarUrl
|
||||
uni.setStorageSync('userInfo',JSON.stringify(userinfo.value))
|
||||
|
Reference in New Issue
Block a user