Explorar o código

PC IM自动登录缓存统一设定

linehang %!s(int64=6) %!d(string=hai) anos
pai
achega
ae2bab46ab
Modificáronse 1 ficheiros con 29 adicións e 0 borrados
  1. 29 0
      login.html

+ 29 - 0
login.html

@ -215,6 +215,35 @@
				var timer = null;
				
				if(userAgent) {
					$.ajax(server +'doctor/doctorRole',{
						data:{},
						dataType: 'json',
						type:'get',
						beforeSend: function(request) {
							request.setRequestHeader("userAgent", userAgent);
						},
						timeout: 30000, 
						success: function(res) {
							if(res.status == 200){
								var agentObj = JSON.parse(userAgent)
								var data = res.data;
								window.localStorage.setItem('WLYY_IMEI',agentObj.imei)
								//添加医生到userRole
								var addData = {
									areas:data.hospital,
									authOperate:data.doctorAuthOperate,
									code:data.hospital,
									isManage:0,
									level:4,
									name:data.name
								}
								data.token = agentObj.token
								data.userRole.push(addData)
								localStorage.setItem('wlyyAgent',JSON.stringify(data))					
							}
						}
					})
					
					userAgent = decodeURIComponent(userAgent)
					localStorage.setItem(agentName, userAgent)
					if(userAgent){