Commit 7f3699f2 by zhujian

'fixed'

parent 905a7460
......@@ -28,7 +28,7 @@
display: flex;
align-items: center;
justify-content: center;
background:rgba(244, 246, 250, 1) ;
background: rgba(244, 246, 250, 1);
}
......@@ -104,25 +104,22 @@
const appTermEnum = getParameterByName('appTermEnum');
const code = getParameterByName('code');
const ticket = getParameterByName('ticket');
console.log(appTermEnum, code, ticket);
if (!code) {
const url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${APPID_MAP[env]}&redirect_uri=${encodeURIComponent(location.href)}&response_type=code&scope=snsapi_privateinfo&state=STATE#wechat_redirect`
postJSON('hades/anon/hades/getCorpTrainSuiteId', {}, (res) => {
const url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${res.result}&redirect_uri=${encodeURIComponent(location.href)}&response_type=code&scope=snsapi_privateinfo&state=STATE#wechat_redirect`
location.href = url
})
return
}
const ajaxOptions = {
data: JSON.stringify({
} else {
postJSON("hades/anon/hades/wXWorkUserTicketLogin", {
appTermEnum: appTermEnum,
code: code,
ticket: ticket
}),
type: 'POST',
url: BASIC_HOST_MAP[env] + "hades/anon/hades/wXWorkUserTicketLogin",
contentType: 'application/json; charset=UTF-8',
timeout: 20000,
dataType: 'json',
success(res, status, xhr) {
}, (res) => {
if (res.code == 200) {
$('#success').show()
} else {
......@@ -132,10 +129,33 @@
$('#message').html(message)
}
})
}
function postJSON(url, data, callback) {
const ajaxOptions = {
data: JSON.stringify(),
type: 'POST',
url: BASIC_HOST_MAP[env] + url,
contentType: 'application/json; charset=UTF-8',
timeout: 20000,
dataType: 'json',
success(res, status, xhr) {
callback(res)
},
};
$.ajax(ajaxOptions)
}
});
</script>
......
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