Commit 8565b353 authored by verestrasz's avatar verestrasz

update

parent 328da2b2
...@@ -36,6 +36,7 @@ export default { ...@@ -36,6 +36,7 @@ export default {
mounted() { mounted() {
var local = window.location.href // 获取页面url var local = window.location.href // 获取页面url
var appid = 'wxbdddd81913c795e9' var appid = 'wxbdddd81913c795e9'
let url=window.location.host+"/"+window.location.hash
this.timeTask = setInterval(() => { this.timeTask = setInterval(() => {
this.setCurrentTime(+new Date()) this.setCurrentTime(+new Date())
}, 1000); }, 1000);
...@@ -43,7 +44,7 @@ export default { ...@@ -43,7 +44,7 @@ export default {
if (this.code == null || this.code === ''){ if (this.code == null || this.code === ''){
// 没有code去拿code; // 没有code去拿code;
if(sysInfo.isWechat) { if(sysInfo.isWechat) {
window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${encodeURIComponent(local)}&response_type=code&scope=snsapi_base&state=1#wechat_redirect`; window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${encodeURIComponent(url)}&response_type=code&scope=snsapi_base&state=1#wechat_redirect`;
} }
}else{ }else{
// 获取得code // 获取得code
...@@ -61,7 +62,7 @@ export default { ...@@ -61,7 +62,7 @@ export default {
error: () => { error: () => {
// console.log(error) // console.log(error)
if(sysInfo.isWechat) { if(sysInfo.isWechat) {
window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${encodeURIComponent(local)}&response_type=code&scope=snsapi_base&state=1#wechat_redirect`; window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${encodeURIComponent(url)}&response_type=code&scope=snsapi_base&state=1#wechat_redirect`;
} }
this.code='' this.code=''
}, },
......
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