Commit 727f0be5 by 陈玉桐

test

parent 1235a645
......@@ -11,15 +11,16 @@ Vue.config.productionTip = false
router.beforeEach((to, from, next) => {
console.log(localStorage.getItem("token"))
if(!localStorage.getItem("token")){
// localStorage.setItem("token","oZXSFtw8JcLyFIdtKc6TvkJm4crA")
// 这个redirectUrl用 当前页路径
let redirectUrl = window.location.href
redirectUrl = encodeURIComponent(redirectUrl)
console.log(redirectUrl)
const appid='wx0201b63e761568b8'
window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${redirectUrl}&response_type=code&scope=snsapi_userinfo&state=123#wechat_redirect`
localStorage.setItem("token","oZXSFtw8JcLyFIdtKc6TvkJm4crA")
next()
// // 这个redirectUrl用 当前页路径
// let redirectUrl = window.location.href
// redirectUrl = encodeURIComponent(redirectUrl)
// console.log(redirectUrl)
// const appid='wx0201b63e761568b8'
// window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${redirectUrl}&response_type=code&scope=snsapi_userinfo&state=123#wechat_redirect`
}else{
// next()
next()
}
})
......
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