Browse Source

打开医生的链接在微信上获取不到链接后面的get 参数did

master
kuaileWu 6 months ago
parent
commit
1227785bcd
  1. 17
      App.vue
  2. 5
      manifest.json

17
App.vue

@ -6,7 +6,17 @@
}, },
onLaunch: function(option) { onLaunch: function(option) {
console.log(option,'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) var doctor_id = uni.getStorageSync(this.globalData.doctoridStorageKey)
if(doctor_id){ if(doctor_id){
this.globalData.doctorId = doctor_id this.globalData.doctorId = doctor_id
@ -17,8 +27,11 @@
},500) },500)
} }
}else{ }else{
this.globalData.doctorId = option.query.did this.globalData.doctorId = did
uni.setStorageSync(this.globalData.doctoridStorageKey, this.globalData.doctorId) uni.setStorageSync(this.globalData.doctoridStorageKey, this.globalData.doctorId)
uni.navigateTo({
url:'/'
})
} }
}, },
onShow: function() {}, onShow: function() {},

5
manifest.json

@ -70,7 +70,8 @@
"enable" : false "enable" : false
}, },
"vueVersion" : "2", "vueVersion" : "2",
/* "target" : "http://jasonyizherenxin.checkcopy.com",*/ /* "target" : "http://jasonyizherenxin.checkcopy.com",*/
/* "target" : "http://api.yizherenxin.cn",*/
"h5" : { "h5" : {
"router" : { "router" : {
"mode" : "history", "mode" : "history",
@ -81,7 +82,7 @@
"disableHostCheck" : true, "disableHostCheck" : true,
"proxy" : { "proxy" : {
"/api" : { "/api" : {
"target" : "http://api.yizherenxin.cn", "target" : "http://jasonyizherenxin.checkcopy.com",
"changeOrigin" : true, "changeOrigin" : true,
"secure" : false "secure" : false
} }

Loading…
Cancel
Save