Browse Source

档案浏览器授权方式变更,增加token请求及token参数

yezehua 6 years ago
parent
commit
fcae405974
3 changed files with 68 additions and 20 deletions
  1. 23 7
      html/profile/html/index_0.html
  2. 22 6
      html/profile/html/index_1.html
  3. 23 7
      html/profile/html/index_2.html

+ 23 - 7
html/profile/html/index_0.html

@ -30,6 +30,7 @@
	var redirectUrl = ""
	var pagetype = 5;
	var d = dialog({contentType:'load', skin:'bk-popup'});
	var accessToken = ""
	
	var target = "wx", idCard = ""
	if(queryParam.target == "app") {
@ -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>

+ 22 - 6
html/profile/html/index_1.html

@ -30,6 +30,7 @@
	var redirectUrl = ""
	var pagetype = 5;
	var d = dialog({contentType:'load', skin:'bk-popup'});
	var accessToken = ""
	
	var target = "wx", idCard = ""
	if(queryParam.target == "app") {
@ -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>

+ 23 - 7
html/profile/html/index_2.html

@ -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>