You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							27 lines
						
					
					
						
							555 B
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							27 lines
						
					
					
						
							555 B
						
					
					
				
								/**
							 | 
						|
								 * @description  token失效时跳转登录页方法
							 | 
						|
								 * @return { Function }
							 | 
						|
								 */
							 | 
						|
								export const httpMessage = (function () {
							 | 
						|
									let isTp = true
							 | 
						|
									// 返回一个闭包来保证同时间段的多次请求错误都只弹出一个窗口
							 | 
						|
									return function (msg) {
							 | 
						|
										if (isTp) {
							 | 
						|
											isTp = false
							 | 
						|
											uni.showModal({
							 | 
						|
												title: '提示',
							 | 
						|
												content: msg,
							 | 
						|
												showCancel: false,
							 | 
						|
												confirmText: '确定',
							 | 
						|
												success: (res) =>{
							 | 
						|
													if (res.confirm) {
							 | 
						|
														isTp = true
							 | 
						|
														uni.reLaunch({
							 | 
						|
															url: '/pages/login/login',
							 | 
						|
														})
							 | 
						|
													}
							 | 
						|
												}
							 | 
						|
											})
							 | 
						|
										}
							 | 
						|
									}
							 | 
						|
								})()
							 |