vue中修改接口请求头的方法

import api from "../request/index.js";
export const updateUserImg = (params) =>
  api({
    url: "/api/xxx/xxxxxxx",
    method: "post",
    data: params,
    headers: {
      'Content-Type': "text/plain"
    },
  });

直接在headers中修改就可以

猜你喜欢

转载自blog.csdn.net/weixin_45294459/article/details/127264511