CabloyJS WeChat module and enterprise WeChat module have been released

CabloyJS WeChat module and enterprise WeChat module have been released

Preface

When the Cabloy-企业微信module is completed, plus the previously completed Cabloy-微信module, 微信/企业微信the task of docking in CabloyJS has been completed. The goal of these modules is to simply fill in the parameters of various services, you can directly enter the specific business development, so as to achieve 开箱即用the effect

background analysis

1. Account System

微信/企业微信Development, there are many pit, and the pit is the largest of 账户体系the

  • First of all, 微信and 企业微信is a different account system
  • Among them 微信, openid is a unique identifier to identify a user. If 微信开放平台it is activated, then openids scattered in different services such as 微信公共号, 微信小程序etc. can be associated through unionid to identify the same user. So, how to connect openid with the user system in the system? If unionid is activated, how to connect? Can the old accounts before unionid be opened smoothly?
  • In 企业微信, each company member is identified by userid. The 微信difference is that 企业微信through the 部门树management of members, so as to 资源授权和分配provide organizational basis. Then, the first step in our system initialization is to 部门和成员synchronize the company's system to the system and implement 双向查找functions

2. Miscellaneous

In addition to the complicated and complicated account system docking tasks, we also have to face some small problems that we encounter at any time during development. Because there are many scenarios, concepts and terms involved in WeChat/Enterprise WeChat development, it is often necessary to read through official documents. However, the official documents did not specify the expressions of some concepts, so I had to write code to verify some guesses, and then review the documents again. After the project is completed this time, if there is a new project, it is likely to have to go again. Here are just a few frequently-occurring problems:

  • JSON and XML: The message push system of WeChat public account uses XML as the data format, and the applet must support both XML and JSON. At the same time, there are differences in plaintext mode, compatibility mode, and security mode.
  • openid/unionid and openId/unionId: During account login, the WeChat public account returns Yes openid/unionid, while the applet returns openId/unionId. If you don’t pay attention, you will fall into the pit
  • 企业微信Support different applications: built-in applications, third-party applications, self-built applications, associated applets, etc. How to structure these applications to provide a unified and convenient API call model
  • 企业微信小程序The ontology is 微信小程序, and then linked to 企业微信become an enterprise WeChat application. Only when you understand these concepts and relationships can you accurately connect

Core target

1. Common WeChat API SDK problems

You can find the corresponding WeChat API SDK for different development languages. However, these WeChat API SDKs often encapsulate the official http api at a language level, and rarely go further. For example, through the WeChat API SDK, we can easily obtain AccessToken and user information, but how to connect the obtained User to the system and how to deal with the association between openid and unionid still requires our own design and development.

For another example, you can easily obtain the departments and members of the enterprise WeChat through the WeChat API SDK. But how to interface with the roles and users in the system, and support different scenarios and login methods, still has a lot of work to be done

2. Out of the box

The CabloyJS 微信/企业微信module 核心目标provides 开箱即用the effect. Only need to configure the parameters, all the docking work is automatically completed, so that we can step through the complicated details in one step and directly enter the specific business development. Of course, CabloyJS's 微信/企业微信module is complete 开源, and we can still clearly see these details and the processing method from it.

Why can CabloyJS achieve 开箱即用the effect? Since the whole stack is CabloyJS NodeJS frame, can be 前端组件, 后端服务, 数据存储与访问, etc., organic combination

For example, the CabloyJS module directly realizes the synchronization between the department and users in the enterprise WeChat through the cooperation of these front and back ends, and even SocketIOrealizes the real-time display of the front-end synchronization progress through the mechanism provided by the bottom layer of CabloyJS

Two highlights

Based on the features provided by the CabloyJS full-stack business development framework itself, the Cabloy-企业微信module has the following two notable highlights:

1. PC, Mobile adaptive

Many enterprise WeChat applications have such a problem: only a part of the functions can be used on the Mobile side, and other more functions need to be logged in to the PC system for operation

The CabloyJS framework Cabloy-企业微信allows all business functions to support PC and Mobile at the same time. At the same time, the following two points can be guaranteed:

  1. Through the role authority system, control different users to use different functions
  2. The front-end page adopts an asynchronous loading strategy to adapt to the development of large projects
  • Mobile effect
  • PC effect

2. Data islands

Companies purchasing different corporate WeChat applications from different service providers will inevitably lead to 数据孤岛the emergence, and these data are scattered in the backends of different service providers, lacking data linkage and sharing mechanisms

The CabloyJS framework itself is based on 业务模块construction. The modules built by the enterprise or the third-party modules are all integrated into a CabloyJS project and deployed privately. This fundamentally solves the 数据孤岛problem, not only can realize data linkage and sharing, but also can carry out data more flexibly Acquisition, processing and analysis

In the final analysis, data and procedures are in your own hands

characteristic

Based on the convenience and flexibility provided by the CabloyJS full-stack framework, the Cabloy-企业微信main features are as follows:

1. One-stop integration

The interfaces of 企业微信自建应用and 企业微信小程序are currently integrated , as follows:

Scenes

name

Description

Self-built application

Message Push System

Automatically complete interface docking and authenticate users

Self-built application

Web login

Automatically jump to WeChat login and authenticate users

Self-built application

Web JSSDK

Automatically inject JSSDK and automatically complete the configuration

Applets

Background login interface

Automatically complete interface docking and authenticate users

Applets

Frontend SDK

Provide SDK, which is convenient for the front end of enterprise WeChat applet to directly access CabloyJS back end API

2. Out of the box

Only need to configure the company WeChat account parameters, all interfaces automatically complete the docking

3. Multiple Mini Programs Support

企业微信Can be associated with multiple 企业微信小程序, therefore, the module also provides support for multiple applets

4. Multi-site support

Through the features provided by CabloyJS 多实例, it can be realized 多站点支持, such as providing enterprise WeChat services for different enterprises. See: EggBornJS: Multiple instances

Reference link

Reference: https://cloud.tencent.com/developer/article/1650948 CabloyJS WeChat module and enterprise WeChat module are available-Cloud + Community-Tencent Cloud