WeChat applet uploads files to Tencent Cloud v5
The WeChat applet only supports https requests to upload files, so we chose Tencent Cloud as the file server. In addition, Tencent Cloud provides an SDK for supporting small program development, which is convenient for calling when uploading files on WeChat.
为了例子的简洁性,这里没有使用服务器鉴权,而采用了前端鉴权
We assume (brother/girl) that you have already started developing WeChat mini programs.
Register Tencent Cloud
Go to the COS object storage console to create a bucket,
Fill in basic information such as the bucket name. For the convenience of testing, select public read and private write
Add cross-domain access rules for buckets (important)
If you are not familiar with cross-domain access settings, you can refer to the following configuration
Get your Bucket (bucket name), Region (region name) and access domain name
Go to the console key management to get your SecretId and SecretKey
Log in to the WeChat public platform settings --> Development settings, fill in the access domain name you just got into the server domain name
At this point, all preparations are completed
git clone https://github.com/piscium2010/cos-wx-upload-file.git
Edit cos-wx-upload-filepagesindexconfig.js and replace your Bucket, Region, SecretId, SecretKey
Run applet
designare-table: Enterprise-level react table component, the performance under IE11 beats Ant Design
Quickly build a React source code testing environment