Commit 4b4064af by 高淑倩

modify: webviewOnload

parent cfa6ec5c
...@@ -26,22 +26,22 @@ wxService.page({ ...@@ -26,22 +26,22 @@ wxService.page({
} }
}, },
webviewOnload (e) { webviewOnload (e) {
if (e.type === 'load') { // if (e.type === 'load') {
const src = e.detail.src // const src = e.detail.src
console.log(src) // console.log(src)
let pass = false // let pass = false
const whitePages = this.data.h5WhitePages // const whitePages = this.data.h5WhitePages
whitePages.map(item => { // whitePages.map(item => {
const regex = new RegExp(`${item}`, 'gi') // const regex = new RegExp(`${item}`, 'gi')
if (!pass) { // if (!pass) {
pass = regex.test(src) // pass = regex.test(src)
} // }
}) // })
// 不在白名单页中统一返回到首页 // // 不在白名单页中统一返回到首页
if (!pass) { // if (!pass) {
wxService.router('/pages/userCenter/userCenter').back() // 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