有没有人帮忙看看啊
云函数调用报SyntaxError: Unexpected token '(' 为什么是“(”?// 云函数入口文件 const cloud = require('wx-server-sdk') const mysql = require('mysql2/promise') cloud.init() // 使用当前云环境 // 云函数入口函数 exports.main = async (event, context) => { const wxContext=cloud.getWXContext() try{ const connection =await mysql.createConnection({ host:"", database:"xxs", user:"root", password:"", port:"3306" }) const[rows,fields]=await connection.execute("INSERT INTO integral_list (open_id,create_time) VALUES('"+ wxContext.OPENID +"' ,NOW() ) ") const[rows1,fields1]=await connection.execute("UPDATE sys_customer SET integral = integral+1 WHERE open_id='"+ wxContext.OPENID +"' ") connection.end(); return rows; } catch(err){ console.log("连接错误!",err) return err; } } 这是代码,调用报错,实在找不到语法哪里有错误 WAServiceMainContext.js?t=wechat&s=1692146197700&v=2.33.0:1 Error: cloud.callFunction:fail Error: errCode: -504002 functions execute fail | errMsg: Runtime.UserCodeSyntaxError: SyntaxError: Unexpected token '(' at Object.module.exports.load (:35115/var/runtime/node12/UserFunction.js:32) at Runtime.handleOnce (:35115/var/runtime/node12/Runtime.engine.js:99) at Timeout._onTimeout (:35115/var/runtime/node12/Runtime.engine.js:56) at listOnTimeout (:35115/appservice/internal/timers.js:549) at processTimers (:35115/appservice/internal/timers.js:492) (callId: 1692165600795-0.494791146595986) (trace: 14:0:0 start->14:0:1 system error (Error: errCode: -504002 functions execute fail | errMsg: Runtime.UserCodeSyntaxError: SyntaxError: Unexpected token '(' at Object.module.exports.load (:35115/var/runtime/node12/UserFunction.js:32) at Runtime.handleOnce (:35115/var/runtime/node12/Runtime.engine.js:99) at Timeout._onTimeout (:35115/var/runtime/node12/Runtime.engine.js:56) at listOnTimeout (:35115/appservice/internal/timers.js:549) at processTimers (:35115/appservice/internal/timers.js:492)), abort) at O (<anonymous>:1:163208) at <anonymous>:1:195232(env: Windows,mp,1.06.2306020; lib: 2.33.0)
2023-08-16[图片]
cloudfunctionRoot创建不了云开发的目录?我在 project.config.json中配置了"cloudfunctionRoot": "cloud/",然后重新编译没有生成文件
2023-02-14我是用云开发做的支付功能,现在退款要用后台去退。
退款一直报签名错误?<xml> <nonce_str>88630f9a9e9c4b33b064d0afe42e03c3</nonce_str> <out_trade_no>33513711643181625117</out_trade_no> <out_refund_no>33513711643181625117</out_refund_no> <appid>wxfc5c98bc94248dd4</appid> <refund_fee>100</refund_fee> <total_fee>100</total_fee> <sign>3CEB59A0D616DC44D7BA6EB211A41350</sign> <mch_id>1800008281</mch_id> <sub_mch_id>1619744204</sub_mch_id> </xml> https://api.mch.weixin.qq.com/secapi/pay/refund 服务商模式调用的这个退款接口,一直报签名错误
2022-01-27