Commit 7f3699f2 by zhujian

'fixed'

parent 905a7460
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
background:rgba(244, 246, 250, 1) ; background: rgba(244, 246, 250, 1);
} }
...@@ -104,25 +104,22 @@ ...@@ -104,25 +104,22 @@
const appTermEnum = getParameterByName('appTermEnum'); const appTermEnum = getParameterByName('appTermEnum');
const code = getParameterByName('code'); const code = getParameterByName('code');
const ticket = getParameterByName('ticket'); const ticket = getParameterByName('ticket');
console.log(appTermEnum, code, ticket);
if (!code) { 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) => {
location.href = url 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 return
} } else {
const ajaxOptions = { postJSON("hades/anon/hades/wXWorkUserTicketLogin", {
data: JSON.stringify({
appTermEnum: appTermEnum, appTermEnum: appTermEnum,
code: code, code: code,
ticket: ticket ticket: ticket
}), }, (res) => {
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) {
if (res.code == 200) { if (res.code == 200) {
$('#success').show() $('#success').show()
} else { } else {
...@@ -132,10 +129,33 @@ ...@@ -132,10 +129,33 @@
$('#message').html(message) $('#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)
}
$.ajax(ajaxOptions)
}); });
</script> </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