- 明天会更好 {success: false, code: 874883, msg: "系统异常,请稍候再试", rid: "a72b5a58"}
- code: 874883msg: "系统异常,请稍候再试"rid: "a72b5a58"success: falsehasOwnProperty: (...)isPrototypeOf: (...)propertyIsEnumerable: (...)toLocaleString: (...)toString: (...)valueOf: (...)__defineGetter__: (...)__defineSetter__: (...)__lookupGetter__: (...)__lookupSetter__: (...)__proto__: Object
let event = {
type: 'Init'
}
wx.cloud.callFunction({
name: 'getDialog',
data: event
}).then(res => {
console.log('初始化后台成功', res.result)
//初始化插件
plugin.init({
appid: "wx5aec2993ee8aab5b",
openid: openid, //res.result.openid, //用户的openid,必填项
success: (res) => {
console.log('chatbot 初始化成功.openid,plugin:', plugin)
that.globalData.chatPlugin = plugin
plugin.send({
query: "播放歌曲明天会更好",
success: (res) => {
console.log('明天会更好',res);
},
fail: (error) => {
console.log('播放错误')
},
});
}, //非必填
fail: (error) => {
console.log('chatbot 初始化失败', error)
}, //非必填
});
}).catch(res => {
console.log('初始化后台失败', res)
})
这个appid太短了 应该是错的
要用对话平台那个pluginid
遇到了一样的错误码,请问楼主解决了吗?
请检查小程序插件版本是否升级到了 1.2.12
然后清空编辑器缓存后重新尝试
补充
var plugin = requirePlugin("chatbot");
这里的plugin是注册openaiwidget组件
https://mp.weixin.qq.com/wxopen/pluginbasicprofile?action=intro&appid=wx8c631f7e9f2465e1&token=1926529443&lang=zh_CN