|
@ -2,6 +2,7 @@
|
|
|
var publish_version = false;
|
|
|
var isInner = false; //发布线上后有内外网的配置
|
|
|
var agentName = "wlyyAgentForDoc";
|
|
|
var docAgentName = "docInfo";
|
|
|
var server, userAgent, loginUrl, imserver, socketUrl, imgServer;
|
|
|
|
|
|
var IMEI = localStorage.getItem('WLYY_IMEI') || uuid(16, 16)
|
|
@ -37,19 +38,22 @@
|
|
|
imgServer = "http://172.19.103.54/";
|
|
|
}
|
|
|
|
|
|
userAgent = localStorage.getItem(agentName)
|
|
|
var baseInfo = window.localStorage.getItem('app_storage');
|
|
|
|
|
|
userAgent = window.localStorage.getItem(agentName)
|
|
|
|
|
|
//hard code userAgent for test start
|
|
|
//全科
|
|
|
// userAgent = {"id":4800,"uid":"zbqD201703150222","imei":"864394010176834","token":"9b23e4ec0bcd3b9fa72a52f91544a4e9","platform":4,"hospital":"3502050100"}
|
|
|
//健管
|
|
|
// userAgent = {"id":4821,"uid":"zbqD201703150228","imei":"864394010176834","token":"73f5ace5c7d4cdb811f743902fd705d9","platform":4,"hospital":"3502050100"};
|
|
|
// userAgent = JSON.stringify(userAgent);
|
|
|
//hard code userAgent for test end
|
|
|
|
|
|
if(userAgent) {
|
|
|
if(baseInfo) {
|
|
|
try {
|
|
|
userAgent = JSON.parse(userAgent)
|
|
|
baseInfo = JSON.parse(baseInfo);
|
|
|
window.localStorage.setItem(docAgentName, JSON.stringify(baseInfo.api_login_doctor));
|
|
|
userAgent = {
|
|
|
'id': baseInfo.api_login_doctor.id,
|
|
|
'uid': baseInfo.api_login_doctor.uid,
|
|
|
'imei': baseInfo.IMEI,
|
|
|
'token': baseInfo.api_login_doctor.token,
|
|
|
'platform': '4'
|
|
|
};
|
|
|
localStorage.setItem('WLYY_IMEI', baseInfo.IMEI)
|
|
|
} catch(e) {
|
|
|
toastr && toastr.warning("登录失效,请重新登录")
|
|
|
toLoginPage()
|
|
@ -75,7 +79,7 @@
|
|
|
beforeSend: function(request) {
|
|
|
var agent = userAgent || {
|
|
|
imei: localStorage.getItem('WLYY_IMEI'),
|
|
|
platform: 4
|
|
|
platform: '4'
|
|
|
}
|
|
|
request.setRequestHeader("userAgent", JSON.stringify(agent));
|
|
|
},
|