From 2c40596f8d280c81f6ef6acbbdb6979dbf3d3785 Mon Sep 17 00:00:00 2001 From: DCloud__JSON Date: Mon, 15 May 2023 14:56:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E7=A7=AF=E5=88=86?= =?UTF-8?q?=E4=B8=8D=E8=B6=B3=E5=BA=94=E5=BD=93=E6=98=AF=E7=A7=AF=E5=88=86?= =?UTF-8?q?=E4=B8=8D=E5=A4=9F=E6=89=A3=E8=80=8C=E4=B8=8D=E6=98=AF=E7=A7=AF?= =?UTF-8?q?=E5=88=86=E5=B0=8F=E4=BA=8E0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uniCloud-aliyun/cloudfunctions/uni-ai-chat/index.obj.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/uniCloud-aliyun/cloudfunctions/uni-ai-chat/index.obj.js b/uniCloud-aliyun/cloudfunctions/uni-ai-chat/index.obj.js index c1f6839..4d55b79 100644 --- a/uniCloud-aliyun/cloudfunctions/uni-ai-chat/index.obj.js +++ b/uniCloud-aliyun/cloudfunctions/uni-ai-chat/index.obj.js @@ -45,9 +45,8 @@ module.exports = { /* 判断剩余多少积分:拒绝对话、扣除配置的积分数 */ let {data:[{score}]} = await userscollection.doc(this.current_uid).field({'score':1}).get() console.log('score----',score); - // 如果积分数小于等于0 则抛出错误提醒客户端 - // 注意需要判断小于0 因为特殊的情况下可能花超过 - if(score == 0 || score < 0){ + // 如果积分不足 则抛出错误提醒客户端 + if(score < config.spentScore){ throw "insufficientScore" } // 扣除对应的积分值 -- GitLab