Skip to content

Commit 96edea2

Browse files
authored
Merge pull request #12 from leozhang2018/fix-port-missing
fix(login):fix port missing when login.
2 parents f29024a + d828cae commit 96edea2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

custom-web/static/js/main.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const hostname = window.location.hostname;
22
const protocol = window.location.protocol;
3+
const port = window.location.port;
34

45
// login();
56
var dex = new Vue({
@@ -34,7 +35,12 @@ var dex = new Vue({
3435
if (roleBinding) {
3536
const role = roleBinding.map((item) => item.role);
3637
store.set("role", role);
37-
window.location.href = `${protocol}//${hostname}/v1/projects`;
38+
if(port){
39+
window.location.href = `${protocol}//${hostname}:${port}/v1/projects`;
40+
}
41+
else{
42+
window.location.href = `${protocol}//${hostname}/v1/projects`;
43+
}
3844
}
3945
}
4046
}

0 commit comments

Comments
 (0)