Giter Site home page Giter Site logo

h5app-approve-demo's Introduction

h5app-approve-demo

功能介绍

开发环境准备

钉钉开放平台环境准备

  1. 需要有一个钉钉注册企业,如果没有可以创建:https://oa.dingtalk.com/register_new.htm?source=1008_OA&lwfrom=2018122711522903000&succJump=oa#/

  2. 成为钉钉开发者,参考文档:https://developers.dingtalk.com/document/app/become-a-dingtalk-developer

  3. 登录钉钉开放平台后台创建一个H5应用: https://open-dev.dingtalk.com/#/index

  4. 配置应用

    配置开发管理,参考文档:https://developers.dingtalk.com/document/app/configure-orgapp

    配置事件订阅,配置回调接口时需要启动服务,参考文档:https://developers.dingtalk.com/document/app/configure-event-subcription

    image

    image-20210625173933467

    配置免登相关权限:https://developers.dingtalk.com/document/app/address-book-permissions

    image-20210628161245415

    配置智能工作流相关的权限 参考文档:https://developers.dingtalk.com/document/app/permission-application-and-basic-concepts

    image-20210628161245415

  5. 创建审批单,demo使用的是物品领用审表单,参考文档:https://developers.dingtalk.com/document/app/workflow-overview

获取H5钉钉应用的参数
#钉钉组织ID
corpId=xxxxx
#H5应用Key
appKey=xxxx
#H5应用秘钥
appSecret=xxxxxx
#数据加密密钥。用于回调数据的加密
aesKey=xxxxx
#加解密需要用到的token
token=xxxxx
#审批模板唯一标识,可以在审批管理后台找到 物品领用模板
processCode=xxxxx
钉钉应用参数需要登陆开发者后台
  1. 首页获取corpId https://open-dev.dingtalk.com/#/index
  2. 进入应用-基础信息获取appKey、appSecret
  3. 进入应用-事件订阅获取aesKey、token
  4. 审批管理后台processCode,参考文档:https://developers.dingtalk.com/document/app/workflow-overview

克隆代码仓库到本地

git clone

https://github.com/open-dingtalk/h5app-approve-demo.git

修改前端页面

使用命令行安装依赖&打包

cd frontend/

image-20210617180814765

npm install

image-20210617180910689

npm run build

image-20210617181053688

将打包好的静态资源文件放入后端服务

img

启动服务 钉钉移动端访问页面

lADPDhYBQpgaHe3NBQDNAkA_576_1280.jpg_720x720g

lADPDhmOwTzgnbvNDIDNBaA_1440_3200.jpg_720x720g

参考文档

  1. 智能工作流权限申请,文档链接:https://developers.dingtalk.com/document/app/logon-free-process?spm=ding_open_doc.document.0.0.6dbdad29INJCRg#topic-2025319
  2. 工作流审批表单,文档链接:https://developers.dingtalk.com/document/app/workflow-overview
  3. 发起审批实例,文档链接:https://developers.dingtalk.com/document/app/initiate-approval
  4. 获取实例详情,文档链接:https://developers.dingtalk.com/document/app/obtains-the-details-of-a-single-approval-instance
  5. 事件回调,文档链接:https://developers.dingtalk.com/document/app/callback-overview

h5app-approve-demo's People

Contributors

wanzhiqiang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.