diff --git a/App.vue b/App.vue index bac732c..1be10e4 100644 --- a/App.vue +++ b/App.vue @@ -6,7 +6,17 @@ }, onLaunch: function(option) { console.log(option,'option===='); - if(!(option.query && option.query.did)){ + var did = false + try { + const pathParts = location.href.split('/'); + const paramIndex = pathParts.indexOf('did'); + if(paramIndex !== -1 && paramIndex + 1 < pathParts.length) { + did = pathParts[paramIndex + 1] + } + } catch (e) { + } + + if(!did){ var doctor_id = uni.getStorageSync(this.globalData.doctoridStorageKey) if(doctor_id){ this.globalData.doctorId = doctor_id @@ -17,8 +27,11 @@ },500) } }else{ - this.globalData.doctorId = option.query.did + this.globalData.doctorId = did uni.setStorageSync(this.globalData.doctoridStorageKey, this.globalData.doctorId) + uni.navigateTo({ + url:'/' + }) } }, onShow: function() {}, diff --git a/manifest.json b/manifest.json index d557148..4b95eeb 100644 --- a/manifest.json +++ b/manifest.json @@ -70,7 +70,8 @@ "enable" : false }, "vueVersion" : "2", - /* "target" : "http://jasonyizherenxin.checkcopy.com",*/ + /* "target" : "http://jasonyizherenxin.checkcopy.com",*/ + /* "target" : "http://api.yizherenxin.cn",*/ "h5" : { "router" : { "mode" : "history", @@ -81,7 +82,7 @@ "disableHostCheck" : true, "proxy" : { "/api" : { - "target" : "http://api.yizherenxin.cn", + "target" : "http://jasonyizherenxin.checkcopy.com", "changeOrigin" : true, "secure" : false }