Commit d663bdb6 authored by 张伯涛's avatar 张伯涛

接口调用传token的时候加上Bearer

parent b91b53d9
......@@ -158,9 +158,7 @@ const transform: AxiosTransform = {
const token = getToken();
if (token && (config as Recordable)?.requestOptions?.withToken !== false) {
// jwt token
(config as Recordable).headers.Authorization = options.authenticationScheme
? `${options.authenticationScheme} ${token}`
: token;
(config as Recordable).headers.Authorization = 'Bearer ' + token;
}
return config;
},
......@@ -230,8 +228,6 @@ function createAxios(opt?: Partial<CreateAxiosOptions>) {
{
// See https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication#authentication_schemes
// authentication schemes,e.g: Bearer
// authenticationScheme: 'Bearer',
authenticationScheme: '',
timeout: 10 * 1000,
// 基础接口地址
// baseURL: globSetting.apiUrl,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment