Commit 4b4064af by 高淑倩

modify: webviewOnload

parent cfa6ec5c
......@@ -26,22 +26,22 @@ wxService.page({
}
},
webviewOnload (e) {
if (e.type === 'load') {
const src = e.detail.src
console.log(src)
let pass = false
const whitePages = this.data.h5WhitePages
whitePages.map(item => {
const regex = new RegExp(`${item}`, 'gi')
if (!pass) {
pass = regex.test(src)
}
})
// 不在白名单页中统一返回到首页
if (!pass) {
wxService.router('/pages/userCenter/userCenter').back()
}
}
// if (e.type === 'load') {
// const src = e.detail.src
// console.log(src)
// let pass = false
// const whitePages = this.data.h5WhitePages
// whitePages.map(item => {
// const regex = new RegExp(`${item}`, 'gi')
// if (!pass) {
// pass = regex.test(src)
// }
// })
// // 不在白名单页中统一返回到首页
// if (!pass) {
// wxService.router('/pages/userCenter/userCenter').back()
// }
// }
},
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment