u
This commit is contained in:
parent
11d3a2cf7a
commit
9fad1ec855
14
index.js
14
index.js
@ -1,6 +1,9 @@
|
||||
module.exports = {
|
||||
clog(message){
|
||||
console.log('【【【【【【【【【【', getApp().$options.router.currentRoute.path, message, '】】】】】】】】】】】')
|
||||
clog(...message){
|
||||
console.log('【【【【【【【【【【',
|
||||
getCurrentPages().length>0 ? getCurrentPages().pop().route : 'pages/Welcome', // 在首页时,getApp() 或 getCurrentPages() 有可能获取不到。
|
||||
...message,
|
||||
'】】】】】】】】】】】')
|
||||
},
|
||||
|
||||
async request(obj){
|
||||
@ -18,9 +21,9 @@ module.exports = {
|
||||
}
|
||||
}
|
||||
|
||||
console.log('👇 👇 👇 👇 👇 👇 👇 👇 < Request >', obj, '👆 👆 👆 👆 👆 👆 👆 👆 < /Request >')
|
||||
console.log('👇 👇 👇 👇 < Request > 👇 👇 👇 👇 ', obj, '👆 👆 👆 👆 < /Request > 👆 👆 👆 👆')
|
||||
let [error, response] = await uni.request(obj)
|
||||
console.log('⬇️ ⬇️ ⬇️ ⬇️ ⬇️ ⬇️ ⬇️ ⬇️ < Response >', response, '⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ < /Response >')
|
||||
console.log('⬇️ ⬇️ ⬇️ ⬇️ < Response > ⬇️ ⬇️ ⬇️ ⬇️ ', response, '⬆️ ⬆️ ⬆️ ⬆️ < /Response > ⬆️ ⬆️ ⬆️ ⬆️')
|
||||
return [error, response]
|
||||
},
|
||||
|
||||
@ -74,8 +77,7 @@ module.exports = {
|
||||
},
|
||||
|
||||
showToast({type, icon, image, title, duration}){
|
||||
let pageStack = getCurrentPages()
|
||||
let pageNow = pageStack[pageStack.length-1]
|
||||
let pageNow = getCurrentPages().pop()
|
||||
if (pageNow.$refs && pageNow.$refs.toast) {
|
||||
pageNow.$refs.toast.open({type, content:title, duration})
|
||||
}else {
|
||||
|
Loading…
Reference in New Issue
Block a user