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

更新在线签名 #58

Merged
merged 1 commit into from
Feb 19, 2024
Merged

更新在线签名 #58

merged 1 commit into from
Feb 19, 2024

Conversation

xingfujiang
Copy link
Contributor

@xingfujiang xingfujiang commented Dec 7, 2023

更新在线签名功能

在线签名可以配置如下配置项

 const FormData = require('form-data')  // 安装依赖
 module.exports = {
    signOnLineConfig:{

       // 请求服务端的地址,可各自定义自己服务端的请求地址
        signOnLine: 'http://vms.xx.xyz:8080/xxxScmExternal/signRpkQuickApp.action',

       // headers是个函数,返回一个对象 ,如果需要token 可以按照如下示例返回
        headers:()=>{  
          return {
                Authorization: 'Bearer ' + '8758r8cjhsbcjbsjh39823yr89yrksjhvsvsdkvkvkkgskjvklsbvlk'
            }
        },
      
       // params是个函数,转给服务端的FormData表单,可以定制自己的一些参数,传给服务端,最后要返回FormData 对象
        params: (file, fileSizeInBytes)=>{ 
            const form = new FormData({ maxDataSize: fileSizeInBytes })
            form.append('file', file)
            // 与服务器约定好的参数,1为直接下载
            form.append('download', '1')
            return form
        }
    }
}

@JayFate JayFate merged commit 503e2ab into hapjs-platform:main Feb 19, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

3 participants