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

bpm 模块 设计流程表单, select 组件数据,从后台获取数据,能不能自动添加 header #498

Closed
tianbocheng opened this issue Apr 29, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@tianbocheng
Copy link

问题:Authorization header 能不能自动添加呢

image
image

@tianbocheng
Copy link
Author

找个一个解决办法

image

在 src/plugins/formCreate/index.ts 中设置 formCreate.fetch

// 第一个是原fetch用到的option,第二个没找到源码中引用的地方不知道有什么用
const overrideFetch = (option: any, effectArgs: any) => {
  // console.log('--fetch option--', option)
  service({
    url: option.action,
    method: option.method,
    data: option.data,
    headers: option.headers,
    withCredentials: option.withCredentials
  })
    .then((res) => {
      try {
        if (option._parse) {
          // 使用内置 api 处理解析函数字符串转化为 函数类型
          const parseFn = formCreate.parseFn(option._parse)
          res.data = parseFn(res)
        }
      } catch (e) {
        console.log('--parseFn error--', e)
      }
      option.onSuccess?.(res)
    })
    .catch((e) => {
      option.onError?.(e)
    })

  return option
}



// 参考 http://www.form-create.com/v3/element-ui/auto-import.html 文档
export const setupFormCreate = (app: App<Element>) => {
  components.forEach((component) => {
    app.component(component.name, component)
  })
  formCreate.use(install)
  formCreate.fetch = overrideFetch
  app.use(formCreate)
  app.use(FcDesigner)
}



参考链接:https://blog.csdn.net/lister1005/article/details/131306732

@YunaiV
Copy link
Owner

YunaiV commented Apr 29, 2024

收到,我们正在搞哈

@YunaiV YunaiV added the question Further information is requested label Apr 29, 2024
@tianbocheng
Copy link
Author

tianbocheng commented Apr 30, 2024

还有个问题是 @YunaiV 保存 解析函数 无法没有保存

  • 下拉框组件,点击 修改解析函数,点击保存
  • 第二次进入,重新编辑查看,没有将解析函数保存
image
  • 在 vue debug 插件下是有这个参数的
image

@YunaiV
Copy link
Owner

YunaiV commented May 11, 2024

还有个问题是 @YunaiV 保存 解析函数 无法没有保存

  • 下拉框组件,点击 修改解析函数,点击保存
  • 第二次进入,重新编辑查看,没有将解析函数保存
image * 在 vue debug 插件下是有这个参数的 image

#499 重复,统一跟进

@YunaiV YunaiV closed this as completed May 11, 2024
@YunaiV YunaiV added enhancement New feature or request and removed question Further information is requested labels May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants