fix:事务处理

This commit is contained in:
2024-03-21 16:07:51 +08:00
parent 90b72393be
commit cad3bd0c69
4 changed files with 40 additions and 23 deletions

View File

@@ -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/;