loginSuccess.js 547 字节
Newer Older
DCloud_JSON's avatar
DCloud_JSON 已提交
1 2
export default function(result){
	uni.showToast({
DCloud_JSON's avatar
DCloud_JSON 已提交
3
		title: '登录成功',
DCloud_JSON's avatar
DCloud_JSON 已提交
4 5
		icon: 'none'
	});
DCloud_JSON's avatar
DCloud_JSON 已提交
6
	console.log('登录成功',result);
DCloud_JSON's avatar
DCloud_JSON 已提交
7 8 9
	
	var delta = 0//判断需要返回几层
	let pages = getCurrentPages();
DCloud_JSON's avatar
DCloud_JSON 已提交
10
	// console.log(pages);
DCloud_JSON's avatar
DCloud_JSON 已提交
11
	pages.forEach((page,index)=>{
DCloud_JSON's avatar
DCloud_JSON 已提交
12
		// console.log(pages[pages.length-index-1].route.split('/')[2]);
DCloud_JSON's avatar
DCloud_JSON 已提交
13 14
		pages[pages.length-index-1].route.split('/')
		if(pages[pages.length-index-1].route.split('/')[2] == 'login-page'){
DCloud_JSON's avatar
DCloud_JSON 已提交
15 16 17
			delta ++
		}
	})
DCloud_JSON's avatar
DCloud_JSON 已提交
18
	// console.log('判断需要返回几层',delta);
DCloud_JSON's avatar
DCloud_JSON 已提交
19
	uni.navigateBack({delta})
20
}