Commit 5958eb98 authored by Ylg's avatar Ylg

delete interceptors

parent 5dfd8de6
......@@ -35,7 +35,7 @@ const Chat: React.FC = () => {
const [selectSiderTabs, setSelectSiderTabs] = useState('');
const [open, setOpen] = useState(false);
const tabShow = showSider && isMobile;
const tabShow = showSider;
useEffect(() => {
let token = '';
......
......@@ -5,25 +5,29 @@ interface ILoginParams {
password: string;
}
request.interceptors.request.use((url, options) => {
let { token } = JSON.parse(localStorage.getItem('user') || '');
if (null === token) {
token = '';
}
const authHeader = {
Authorization: `Bearer ${token}`,
'Content-Type': 'application/json',
'__tenant': '3a0a90fe-9a0d-70f4-200d-a80a41fb6195' // 用户id
};
return {
url: url,
options: { ...options, interceptors: true, headers: authHeader },
};
});
// request.interceptors.request.use((url, options) => {
// let { token } = JSON.parse(localStorage.getItem('user') || '');
// if (null === token) {
// token = '';
// }
// const authHeader = {
// Authorization: `Bearer ${token}`,
// 'Content-Type': 'application/json',
// '__tenant': '3a0a90fe-9a0d-70f4-200d-a80a41fb6195' // 用户id
// };
// return {
// url: url,
// options: { ...options, interceptors: true, headers: authHeader },
// };
// });
export function loginChatGLM(options: ILoginParams) {
return request('https://glm-mangement-api.baibaomen.com/api/app/account/login', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'__tenant': '3a0a90fe-9a0d-70f4-200d-a80a41fb6195'
},
data: options
})
}
......
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