Commit 5958eb98 authored by Ylg's avatar Ylg

delete interceptors

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