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