|
@ -30,7 +30,8 @@
|
|
|
var redirectUrl = ""
|
|
|
var pagetype = 5;
|
|
|
var d = dialog({contentType:'load', skin:'bk-popup'});
|
|
|
|
|
|
var accessToken = ""
|
|
|
|
|
|
var target = "wx", idCard = ""
|
|
|
if(queryParam.target == "app") {
|
|
|
target = queryParam.target
|
|
@ -50,22 +51,37 @@
|
|
|
filter: "org_code=49229004X"
|
|
|
}))
|
|
|
redirectUrl = profileServer+'/gateway/authentication/oauth/sso?response_type=token&client_id=P7dIRS0FvX&state='
|
|
|
+state+'&scope=read&redirect_uri='+profileServer+'/profile/app/mprofile/html/signin.html?idCardNo='+idCard+'&user=tourists'
|
|
|
+state+'&scope=read&redirect_uri='+profileServer+'/profile/app/mprofile/html/signin.html?idCardNo='+idCard+'&token='+accessToken
|
|
|
|
|
|
location.replace(redirectUrl)
|
|
|
}
|
|
|
|
|
|
function queryInit(){
|
|
|
|
|
|
getReqPromise("patient/baseinfo", {}, 'json', 'post').then(function(res){
|
|
|
if(res.status == 200) {
|
|
|
idCard = res.data && res.data.idcardAll
|
|
|
getReqPromises([
|
|
|
{
|
|
|
url: profileServer+'/gateway/authentication/oauth/login',
|
|
|
data: {client_id:'P7dIRS0FvX', username: 'tourists', password: 'tourists123'},
|
|
|
reqType: 'post'
|
|
|
},
|
|
|
{
|
|
|
url: 'patient/baseinfo',
|
|
|
data: {},
|
|
|
reqType: 'post'
|
|
|
}
|
|
|
]).then(function(ress) {
|
|
|
var res0 = ress[0], res1 = ress[1]
|
|
|
|
|
|
accessToken = res0.accessToken
|
|
|
|
|
|
if(res1.status == 200) {
|
|
|
idCard = res1.data && res1.data.idcardAll
|
|
|
redirect()
|
|
|
} else {
|
|
|
dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:res.msg}).show();
|
|
|
dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:res1.msg}).show();
|
|
|
}
|
|
|
}).catch(function(e) {
|
|
|
console && console.error(e)
|
|
|
console && console.error(e)
|
|
|
})
|
|
|
}
|
|
|
</script>
|