Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

全局请求头统一添加问题 #340

Open
tuqiyu opened this issue Sep 5, 2024 · 0 comments
Open

全局请求头统一添加问题 #340

tuqiyu opened this issue Sep 5, 2024 · 0 comments

Comments

@tuqiyu
Copy link

tuqiyu commented Sep 5, 2024

项目需求需要在所有的接口上加请求头,有相关的配置项么,或者需要自己封装
目前是手动加请求头
umi 3.5.20版本 "umi-serve": "^1.9.10"

import { request } from 'umi';
export const getDepartmentList = (params => {
  return request('/permission', {
    method: 'POST',
    data: params,
    headers: { 'x-flow-tenant-id': Cookies.get('id') || '' },
  });
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant