我去 我也是这样 本地调试 报[图片] 云端测试 就报 参数不合法 我调的是这个接口storage.setUserStorage
云调用服务端API storage.setUserInteractiveData 报错本地调试接口 storage.setUserInteractiveData, 提示错误信息 errCode: -604104 | errMsg: system error: error code: -604104 at new CloudSDKError (... ...\node_modules\wx-server-sdk\index.js:6389:28) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 上传后,在云端测试,提示错误信息: Error: errCode: -501007 invalid parameters | errMsg: storage.setUserInteractiveData:fail Invalid request param at new CloudSDKError (/var/user/node_modules/wx-server-sdk/index.js:6389:28 请问该API 正确的使用方式? ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 代码片段: const result = await cloud.openapi.storage.setUserInteractiveData({ openid: "XXXXXXXXXXXX", kvList: [{ key: '1', value: 49 }] }) .catch(err => { console.error(err); return { errMsg: err.errMsg }; }) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 目的:后台可以设置用户的互动数据
2020-04-21我是调用setUserStorage 本地调试也报这个
【求助】云函数调用setUserInteractiveData报错index.js: // 云函数入口文件 const cloud = require('wx-server-sdk') cloud.init( {env: "server-pyoo2"} ) // 云函数入口函数 exports.main = async (event, context) => { const wxContext = cloud.getWXContext() return new Promise ((resolve, reject) => { cloud.openapi.storage.setUserInteractiveData({ openid: wxContext.OPENID, kvList: [{ key: '1', value: 0, }] }) }) } config.json: { "permissions": { "openapi": [ "storage.setUserInteractiveData" ] } } 本地调试报错: node.js:1 [error] Unhandled Rejection at: Promise {<rejected>: Error: errCode: -604104 | errMsg: system error: error code: -604104 at Object.callWXOpenAPI (D…}__proto__: Promise[[PromiseStatus]]: "rejected"[[PromiseValue]]: Error: errCode: -604104 | errMsg: system error: error code: -604104 at Object.callWXOpenAPI (D:\Project\build\wechatgame\functions\getID\node_modules\wx-server-sdk\index.js:418:23) at processTicksAndRejections (internal/process/task_queues.js:85:5) at async callWXOpenAPI (D:\Project\build\wechatgame\functions\getID\node_modules\wx-server-sdk\index.js:2234:28)errCode: -604104errMsg: "system error: error code: -604104"message: "errCode: -604104 | errMsg: system error: error code: -604104"stack: "Error: errCode: -604104 | errMsg: system error: error code: -604104↵ at Object.callWXOpenAPI (D:\Project\build\wechatgame\functions\getID\node_modules\wx-server-sdk\index.js:418:23)↵ at processTicksAndRejections (internal/process/task_queues.js:85:5)↵ at async callWXOpenAPI (D:\Project\build\wechatgame\functions\getID\node_modules\wx-server-sdk\index.js:2234:28)"get message: ƒ get()set message: ƒ set(msg)__proto__: Error reason: Error: errCode: -604104 | errMsg: system error: error code: -604104 at Object.callWXOpenAPI (D:\Project\build\wechatgame\functions\getID\node_modules\wx-server-sdk\index.js:418:23) at processTicksAndRejections (internal/process/task_queues.js:85:5) at async callWXOpenAPI (D:\Project\build\wechatgame\functions\getID\node_modules\wx-server-sdk\index.js:2234:28) _@node.js:1(anonymous)@node.js:1emit@events.js:203processPromiseRejections@internal/process/promises.js:201processTicksAndRejections@internal/process/task_queues.js:86 internal/process/warning.js:27 (node:45592) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. writeOut@internal/process/warning.js:27onWarning@internal/process/warning.js:79emit@events.js:203(anonymous)@internal/process/warning.js:52processTicksAndRejections@internal/process/task_queues.js:75TickObject (async)init@internal/inspector_async_hook.js:21emitInitNative@internal/async_hooks.js:134emitInitScript@internal/async_hooks.js:341TickObject@internal/process/task_queues.js:102nextTick@internal/process/task_queues.js:130emitWarning@internal/process/warning.js:130emitDeprecationWarning@internal/process/promises.js:153processPromiseRejections@internal/process/promises.js:204processTicksAndRejections@internal/process/task_queues.js:86 按照文档操作,本地调试报错
2020-04-21