Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

WeChat small program cloud development multi-end support


May 20, 2021 WeChat Mini Program Development Document


Table of contents


Multi-end support

In addition to supporting small-side SDK and cloud-side SDK access, cloud-side SDK access is supported from 06/04.

Web SDK

The Web SDK is used in the web, has access to cloud development resources, currently only supports unsigned-in mode access, and does not support getting login status on the web at this time.

APIs are similar

The Web SDK API is basically the same as the small terminal API, with the following differences:

cloud.init

cloud.init adds parameter appids, which must be called with a small program appid, such as:

cloud.init({
  appid: 'wx123456789',
  env: 'release-xxx',
})

uploadFile

The small terminal is the incoming temporary file address as the source file uploaded, and the web side requires the incoming file parameter, the type File.

downloadFile

The small terminal saves the downloaded file as a local temporary file, and the web side returns the content as arraybuffer in the field data.

Document

API documentation is in the SDK API documentation, and APIs that support web-side use are labeled.

Update the log

Precautions for using unsigned-in mode

  1. For security reasons, the cloud environment does not support unsigned-in access by default and needs to be turned on first in Cloud Development Console - Settings - Global Settings (developer tools 1.03.2006042 or above)
  2. Unsigned-in mode must be used with security rules, and if the permissions of the database and storage are set to a simple permission configuration instead of a security rule configuration, unsigned-in users will not be able to access cloud resources
  3. When accessed in unsigned-in mode, the auth variable of the security rule will be empty to determine the unsigned-in request

CdN address list