Commit aff342bb by xinla

--no commit message

1 parent 441791e5
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0, user-scalable=no">
<meta name="viewport"
content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0, user-scalable=no">
<title>linke-wechat</title>
</head>
<body>
<div class="container">
<img src='' class='posterImg'/>
<img src='' class='posterImg' />
<div class="footerLink">
<div class="sharePic" >分享图片</div>
<div class="sharePic">分享图片</div>
<div class="myTaskDetail">我的邀请任务进度</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
// import vconsole from 'vconsole'
import vconsole from 'vconsole'
$(function () {
var dpr, rem, scale
var docEl = document.documentElement
......@@ -31,6 +31,5 @@ $(function () {
window.dpr = dpr
window.rem = rem
// var myConsole = new vconsole()
console.log('hello')
new vconsole()
})
......@@ -23,7 +23,7 @@ const request = (url, params, method = 'get') => {
},
error(err) {
// console.log(err.status)
alert(url + err.status)
alert(url + ',错误码:' + err.status)
reject(err)
}
})
......
import config from './contant'
export function getUrlParam (name) {
let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
let r = window.location.search.substr(1).match(reg);
if (r != null) {
return unescape(r[2]);
}
return null;
export function getUrlParam(name) {
let reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)')
let r = window.location.search.substr(1).match(reg)
if (r != null) {
return unescape(r[2])
}
return null
}
export function getWxCode(){
let appid = "wxa57479bcd3f15461";
let code = getUrlParam("code"); //是否存在code
let local = window.location.origin.includes('localhost')?'http://h5.linkwechat.cn/test.html': window.location.href;
// let local = 'http://h5.x*****o.com/'
if (code == null || code === "") {
//不存在就打开上面的地址进行授权
window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${encodeURIComponent(local)}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
export function getWxCode() {
let appid = 'wx8bfe6bc2ca5c45ae' // 公众号appid
let code = getUrlParam('code') //是否存在code
let local = window.location.origin.includes('localhost')
? 'http://h5.linkwechat.cn/test.html'
: window.location.href
// let local = 'http://h5.x*****o.com/'
if (code == null || code === '') {
//不存在就打开上面的地址进行授权
window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${encodeURIComponent(
local
)}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
return false
// window.location.href =
// `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${encodeURIComponent(local)}&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect`;
}else{
config.code = code
}
}
\ No newline at end of file
return false
// window.location.href =
// `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${encodeURIComponent(local)}&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect`;
} else {
config.code = code
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!