mirror of
https://gitee.com/bookshelfplus/bookshelfplus
synced 2025-09-01 22:53:29 +08:00
更新README.md
This commit is contained in:
@@ -1,2 +0,0 @@
|
||||
# 腾讯云对象存储文件上传成功触发SCF云函数
|
||||
|
@@ -2,19 +2,23 @@
|
||||
|
||||
// 后端配置信息
|
||||
const backendApi = {
|
||||
hostname: "dev.bookshelf.plus",
|
||||
path: "/api/file/upload/cos-check-file-state",
|
||||
hostname: "此处配置您的域名",
|
||||
path: "/api/file/object/upload/cos-check-file-state",
|
||||
};
|
||||
|
||||
function postback(event, context) {
|
||||
return new Promise(function (resolve) {
|
||||
const querystring = require("querystring");
|
||||
const http = require("http");
|
||||
|
||||
const postData = querystring.stringify({
|
||||
event: JSON.stringify(event),
|
||||
context: JSON.stringify(context),
|
||||
});
|
||||
// const querystring = require("querystring");
|
||||
// const postData = querystring.stringify({
|
||||
// event: JSON.stringify(event),
|
||||
// context: JSON.stringify(context),
|
||||
// });
|
||||
const postData = new URLSearchParams({
|
||||
event: JSON.stringify(event),
|
||||
context: JSON.stringify(context),
|
||||
}).toString();
|
||||
|
||||
console.log("⭐postData");
|
||||
console.log(postData);
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 11 KiB |
Binary file not shown.
Before Width: | Height: | Size: 33 KiB |
Binary file not shown.
Before Width: | Height: | Size: 42 KiB |
Binary file not shown.
Before Width: | Height: | Size: 46 KiB |
Binary file not shown.
Before Width: | Height: | Size: 11 KiB |
Binary file not shown.
Before Width: | Height: | Size: 23 KiB |
@@ -1,41 +0,0 @@
|
||||
# 创建COS对象存储文件上传触发SCF云函数
|
||||
|
||||
|
||||
|
||||
> 腾讯云官方文档:COS 触发器说明
|
||||
> https://cloud.tencent.com/document/product/583/9707
|
||||
|
||||
创建COS存储桶的时候一定要创建在CSF可用区域:
|
||||
|
||||
- 华南地区:广州
|
||||
- 华东地区:上海
|
||||
- 华北地区:北京
|
||||
- 西南地区:成都
|
||||
|
||||
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
创建成功
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
创建成功后,建议将 `执行超时时间` 适当调大一点,特别是当服务器和腾讯云COS节点较远的情况,以减少因网络问题导致COS文件上传后网站后台不能及时感知。一般建议大于 `5秒`,此处调为 `10秒`。
|
||||
|
||||

|
Reference in New Issue
Block a user