Skip to content

Commit d828cae

Browse files
committed
fix(login):fix port missing when login.
Signed-off-by: leozhang2018 <[email protected]>
1 parent f29024a commit d828cae

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)