Remove the accessToken from the URL. (#12353)
This commit is contained in:
parent
47d913de05
commit
a6047fae45
@ -517,6 +517,7 @@ const request = (function(_global) {
|
|||||||
|
|
||||||
const _LOGINPAGE_ENABLED = localStorage.getItem(LOGINPAGE_ENABLED);
|
const _LOGINPAGE_ENABLED = localStorage.getItem(LOGINPAGE_ENABLED);
|
||||||
|
|
||||||
|
let accessTokenInHeader = '';
|
||||||
if (_LOGINPAGE_ENABLED !== 'false') {
|
if (_LOGINPAGE_ENABLED !== 'false') {
|
||||||
let token = {};
|
let token = {};
|
||||||
try {
|
try {
|
||||||
@ -526,7 +527,7 @@ const request = (function(_global) {
|
|||||||
goLogin();
|
goLogin();
|
||||||
}
|
}
|
||||||
const { accessToken = '' } = token;
|
const { accessToken = '' } = token;
|
||||||
params.push(`accessToken=${accessToken}`);
|
accessTokenInHeader = accessToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $.ajax(
|
return $.ajax(
|
||||||
@ -540,6 +541,7 @@ const request = (function(_global) {
|
|||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: localStorage.getItem('token'),
|
Authorization: localStorage.getItem('token'),
|
||||||
|
AccessToken: accessTokenInHeader,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
).then(
|
).then(
|
||||||
|
@ -49,7 +49,6 @@ const request = () => {
|
|||||||
goLogin();
|
goLogin();
|
||||||
}
|
}
|
||||||
const { accessToken = '', username = '' } = token;
|
const { accessToken = '', username = '' } = token;
|
||||||
config.params.accessToken = accessToken;
|
|
||||||
// support #3548 and fix #5835
|
// support #3548 and fix #5835
|
||||||
if (!url.includes('auth')) {
|
if (!url.includes('auth')) {
|
||||||
config.params.username = username;
|
config.params.username = username;
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
<link rel="stylesheet" type="text/css" href="console-ui/public/css/icon.css">
|
<link rel="stylesheet" type="text/css" href="console-ui/public/css/icon.css">
|
||||||
<link rel="stylesheet" type="text/css" href="console-ui/public/css/font-awesome.css">
|
<link rel="stylesheet" type="text/css" href="console-ui/public/css/font-awesome.css">
|
||||||
<!-- 第三方css结束 -->
|
<!-- 第三方css结束 -->
|
||||||
<link href="./css/main.css?50300f41fe7e73539edb" rel="stylesheet"></head>
|
<link href="./css/main.css?ae6bcb8479aa5e5c3c24" rel="stylesheet"></head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div id="root" style="overflow:hidden"></div>
|
<div id="root" style="overflow:hidden"></div>
|
||||||
@ -56,6 +56,6 @@
|
|||||||
<script src="console-ui/public/js/merge.js"></script>
|
<script src="console-ui/public/js/merge.js"></script>
|
||||||
<script src="console-ui/public/js/loader.js"></script>
|
<script src="console-ui/public/js/loader.js"></script>
|
||||||
<!-- 第三方js结束 -->
|
<!-- 第三方js结束 -->
|
||||||
<script type="text/javascript" src="./js/main.js?50300f41fe7e73539edb"></script></body>
|
<script type="text/javascript" src="./js/main.js?ae6bcb8479aa5e5c3c24"></script></body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user