未登录跳转,url进行编码处理

This commit is contained in:
daihh
2022-10-16 17:54:05 +08:00
parent 02b5d5834f
commit fe22454311
2 changed files with 6 additions and 2 deletions

View File

@@ -70,8 +70,8 @@ router.beforeEach((to, from, next) => {
//store.commit('portal/SetBackUrl',location.href);
//console.log(location.href,'location.href');
//let urlPre=window.location.protocol+'//'+window.location.host;
//let backUrl=location.href.substring(urlPre.length);
location.href=process.env.VUE_APP_LOGIN_URL+"?returnUrl="+location.href;
//let backUrl=location.href.substring(urlPre.length); encodeURIComponent()
location.href=process.env.VUE_APP_LOGIN_URL+"?returnUrl="+encodeURIComponent(location.href);
NProgress.done()
}

View File

@@ -24,6 +24,10 @@ import portalFooter from "@/components/PortalFooter.vue";
this.id = this.$route.query.id;
this.type = this.$route.query.type;
let urlPre=window.location.protocol+'//'+window.location.host;
let params='detailId='+this.id+'&inner=1';
params=encodeURIComponent(params);
//console.log(urlPre,'urlPre');
if(this.type == 20 || this.type=='online-course') {//在线课
this.url= `${urlPre}/web/onlineClass?detailId=${this.id}&inner=1`