fix:事务处理
This commit is contained in:
parent
90b72393be
commit
cad3bd0c69
@ -1,8 +1,6 @@
|
||||
import config from '../config'
|
||||
import { useStore} from '@/store/index.js'
|
||||
|
||||
// import {useStore} from '@/store/index.js'
|
||||
// console.log(useStore)
|
||||
// const store = useStore()
|
||||
const loginUrl = 'pages/user/login';
|
||||
// function JSON_to_URLEncoded(element,key,list){
|
||||
// var list = list || [];
|
||||
@ -76,20 +74,20 @@ export default {
|
||||
});
|
||||
}
|
||||
}
|
||||
// if(res.data.code === 7) { // 登录失败
|
||||
// uni.showToast({
|
||||
// title:res.msg,
|
||||
// icon:"error",
|
||||
// duration:2000,
|
||||
// mask:true,
|
||||
// success() {
|
||||
// if(res.code === 7) // 登录失败
|
||||
// {
|
||||
// store.afterFailLogin(2000)
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
if(res.data.code === 7) { // 登录失败
|
||||
const store = useStore()
|
||||
store.afterFailLogin(2000)
|
||||
uni.showToast({
|
||||
title:res.msg,
|
||||
icon:"error",
|
||||
duration:2000,
|
||||
mask:true,
|
||||
// success() {
|
||||
// console.log(1212121)
|
||||
// store.afterFailLogin(2000)
|
||||
// }
|
||||
})
|
||||
}
|
||||
return res.data;
|
||||
} else {
|
||||
const reg = /abort/;
|
||||
|
@ -1,6 +1,6 @@
|
||||
// isdev 为 true 表示开发环境 false 表示发布环境
|
||||
const isdev = false;
|
||||
const baseUrl = isdev ? 'http://318ca56c.r28.cpolar.top' : 'https://api.jimingyiliao.com';// 办公室接口 & 测试环境
|
||||
const isdev = true;
|
||||
const baseUrl = isdev ? 'https://367a21fd.r12.cpolar.top' : 'https://api.jimingyiliao.com';// 办公室接口 & 测试环境
|
||||
// const baseUrl = isdev ? 'https://api.jimingyiliao.com' : 'http://eb467b6.r19.cpolar.top';// 办公室接口 & 测试环境
|
||||
// const baseUrl = isdev ? 'http://707788f2.r1.cpolar.top' : 'http://eb467b6.r19.cpolar.top';// 办公室接口 & 测试环境
|
||||
// const baseUrl = isdev ? 'http://192.168.1.133:8899' : 'https://api.gwkjxb.com';// 办公室接口 & 正式环境
|
||||
|
@ -161,7 +161,7 @@
|
||||
})
|
||||
uni.showToast({
|
||||
title:res_.msg,
|
||||
icon:"error",
|
||||
icon:"success",
|
||||
duration:2000,
|
||||
mask:true,
|
||||
success() {
|
||||
@ -205,6 +205,24 @@
|
||||
{{handle_info?.content}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="pb-item">
|
||||
<view class="pb-item-left">待办状态</view>
|
||||
<view class="pb-item-right">
|
||||
{{handle_info?.remindPeriod?'手术前':'手术后'}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="pb-item">
|
||||
<view class="pb-item-left">用药频率</view>
|
||||
<view class="pb-item-right">
|
||||
{{handle_info?.frequency}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="pb-item">
|
||||
<view class="pb-item-left">提醒时间</view>
|
||||
<view class="pb-item-right">
|
||||
{{handle_info?.remindTime}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="pb-item">
|
||||
<view class="pb-item-left">创建时间</view>
|
||||
<view class="pb-item-right">
|
||||
|
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user