const redis = uniCloud.redis()
await redis.set(key, value, 'EX', expiredSeconds)
- 发布:2024-07-15 16:06
- 更新:2024-07-15 16:45
- 阅读:155
产品分类: uniCloud/支付宝小程序云
示例代码:
操作步骤:
const redis = uniCloud.redis()
await redis.set(key, value, 'EX', expiredSeconds)
const redis = uniCloud.redis()
await redis.set(key, value, 'EX', expiredSeconds)
预期结果:
不报错,正常对redis存取字符串
不报错,正常对redis存取字符串
实际结果:
redis.set报错,函数不允许调用
16:01:16.437 [本地调试]Error: [DCloud-clientDB]: 函数不允许调用
16:01:16.438 [本地调试] at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
16:01:16.438 [本地调试] at async ce.saveSecureNetworkCache (D:\Sync\Project\my-project\uni_modules\uni-id-pages\uniCloud\cloudfunctions\uni-id-co\lib\utils\weixin.js:121:5)
16:01:16.438 [本地调试] at async global.__tempModuleExports.module.exports (D:\Sync\Project\my-project\uni_modules\uni-id-pages\uniCloud\cloudfunctions\uni-id-co\module\utils\secure-network-handshake-by-weixin.js:59:3)
redis.set报错,函数不允许调用
16:01:16.437 [本地调试]Error: [DCloud-clientDB]: 函数不允许调用
16:01:16.438 [本地调试] at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
16:01:16.438 [本地调试] at async ce.saveSecureNetworkCache (D:\Sync\Project\my-project\uni_modules\uni-id-pages\uniCloud\cloudfunctions\uni-id-co\lib\utils\weixin.js:121:5)
16:01:16.438 [本地调试] at async global.__tempModuleExports.module.exports (D:\Sync\Project\my-project\uni_modules\uni-id-pages\uniCloud\cloudfunctions\uni-id-co\module\utils\secure-network-handshake-by-weixin.js:59:3)
bug描述:
本地调试无法使用redis,redis.set报错,函数不允许调用
已确认,package里已经添加"extensions": {
"uni-cloud-jql": {},
"uni-cloud-redis": {}
}了,所以不是依赖问题。
c***@163.com (作者)
嗯嗯,尽快修复,感谢感谢
2024-07-15 17:19