【getunlimited】部署后测试调用无法正常
- 当前 Bug 的表现(可附上截图)
{“errCode”:-501007,“errMsg”:“openapi.wxacode.getUnlimited:fail Invalid request param”}
- 预期表现
正常和本地调试一样返回官方正常数据
- 复现路径
- 提供一个最简复现 Demo
const cloud = require( "wx-server-sdk" ); cloud.init(); exports.main = async event => { const { scene, page, width, autoColor, lineColor, isHyaline } = event; // console.log('[ event ====] ',event); // 检验sence是否正确 if (!scene || !/^[! #$&'()*+,/:;=?@\-._~0-9a-zA-Z]{1,32}$/.test(scene)){ console.log('[ error scene ] ', scene); return { ret:4, error:' error scene ', msg:' 错误的scene' }; } try { const result = await cloud.openapi.wxacode.getUnlimited({ scene: "a=1" , }); return result; } catch (err) { return err; } }; |