解决无returnUrl的问题

This commit is contained in:
daihh
2023-03-02 14:13:35 +08:00
parent 6c00f96a0d
commit c2af365ad8

View File

@@ -15,16 +15,19 @@
},
onLoad(options) {
this.toUrl=options.returnUrl;
var pvArray=Object.keys(options);
var params='';
pvArray.forEach(pv=>{
if(pv!='returnUrl'){
params+='&'+pv+'='+options[pv];
if(this.toUrl){
if(this.toUrl=='/'){
this.toUrl='';
}
});
this.toUrl=this.toUrl+params;
var pvArray=Object.keys(options);
var params='';
pvArray.forEach(pv=>{
if(pv!='returnUrl'){
params+='&'+pv+'='+options[pv];
}
});
this.toUrl=this.toUrl+params;
}
console.log(this.toUrl,'options.returnUrl');
},
mounted() {
@@ -60,7 +63,6 @@
// })
uni.setStorageSync("boe_new_login",1);//记录新登录
let openUrl=$this.toUrl;
console.log(openUrl);
//http://localhost:8081/mobile/pages/login/loading?returnUrl=/pages/study/courseStudy?id=1028700304503054336
if(openUrl){
//如果openUrl的页面不存在或不对就会出现跳转不动的问题这个情况