Skip to content

Commit 6600ae6

Browse files
committed
跳转路径错误
1 parent 0e349f4 commit 6600ae6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

template/js/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
this.root_path = (function(){
1212
var elm_path = $$('current_path');
1313
var url = window.location.origin+window.location.pathname;
14-
return elm_path?url.replace(elm_path.value,''):'';
14+
return elm_path?url.replace(elm_path.value,'').replace(/\/$/,''):'';
1515
})();
1616

1717
this.query = ''; //
@@ -29,7 +29,7 @@
2929
goToIndex:function(){
3030
var elma = document.getElementsByTagName('A');
3131
for (var i = 0; i < elma.length; i++) {
32-
if(elma[i].pathname==='/') elma[i].href = this.root_path.replace(/\/$/,'')+'/';
32+
if(elma[i].pathname==='/') elma[i].href = this.root_path+'/';
3333
}
3434
},
3535
bindEvent:function(elm,type,handle){

0 commit comments

Comments
 (0)