Commit 727f0be5 by 陈玉桐

test

parent 1235a645
...@@ -11,15 +11,16 @@ Vue.config.productionTip = false ...@@ -11,15 +11,16 @@ Vue.config.productionTip = false
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
console.log(localStorage.getItem("token")) console.log(localStorage.getItem("token"))
if(!localStorage.getItem("token")){ if(!localStorage.getItem("token")){
// localStorage.setItem("token","oZXSFtw8JcLyFIdtKc6TvkJm4crA") localStorage.setItem("token","oZXSFtw8JcLyFIdtKc6TvkJm4crA")
// 这个redirectUrl用 当前页路径 next()
let redirectUrl = window.location.href // // 这个redirectUrl用 当前页路径
redirectUrl = encodeURIComponent(redirectUrl) // let redirectUrl = window.location.href
console.log(redirectUrl) // redirectUrl = encodeURIComponent(redirectUrl)
const appid='wx0201b63e761568b8' // console.log(redirectUrl)
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` // 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{ }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