---
title: "公文顶部部分按钮隐藏"
publicId: "0f05b47e-4593-4c12-af35-c410c0374375"
source: "https://weapp.eteams.cn/build/techdoc/wdoc/index.html#/public/doc/0f05b47e-4593-4c12-af35-c410c0374375"
---
拦截/api/odoc/flowForm/loadOdocTextSetting接口修复返回值

```typescript
/**
 * 隐藏公文部分按钮
 * 案例代码 请参考具体业务调整 
 */
axios.interceptors.response.use(
  function (response) {
    // 对响应数据进行操作
    const {config={},data={} } = response
    const {url} = config;  
    if(data && data.status && url.indexOf("/api/odoc/flowForm/loadOdocTextSetting") != -1){
      let buttonLists = data?.data?.buttonList || []
      const hideBtnKeys = ["DOWNLOAD_TEXT"]//隐藏按钮集合 如下载
      if(buttonLists && hideBtnKeys){
        let newBtns = buttonLists.filter(item=>{
          return hideBtnKeys.indexOf(item.odocBtnType) == -1
        })
        data.data.buttonList = newBtns;
      }
    }
    return response;
  },
  function (error) {
    // 对响应错误进行操作
    return Promise.reject(error);
  }
); 

```
