feat: 初始化工程

This commit is contained in:
2026-08-20 15:26:19 +08:00
commit c099e4a743
659 changed files with 113041 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
# 云函数调用
## 官方文档
参考官方文档https://doc.dcloud.net.cn/uniCloud/cf-functions.html
## 前端调用示例
```javascript
uniCloud.callFunction({
name: 'getUser',
data: { userId: '123' }
}).then(res => {
console.log(res.result)
})
```
## 参考资源
- https://doc.dcloud.net.cn/uniCloud/cf-functions.html

View File

@@ -0,0 +1,25 @@
# 云函数创建
## 官方文档
参考官方文档https://doc.dcloud.net.cn/uniCloud/cf-functions.html
## 创建云函数
1. 在项目根目录创建 `cloudfunctions/`
2. 新建函数目录(如 `getUser`)。
3. 编写 `index.js` 入口。
```javascript
'use strict'
exports.main = async (event, context) => {
return {
code: 0,
data: 'Hello uniCloud'
}
}
```
## 参考资源
- https://doc.dcloud.net.cn/uniCloud/cf-functions.html