diff --git a/Cunkebao/.env.local b/Cunkebao/.env.local new file mode 100644 index 00000000..19e89e7e --- /dev/null +++ b/Cunkebao/.env.local @@ -0,0 +1 @@ +NEXT_PUBLIC_API_BASE_URL= http://yishi.com \ No newline at end of file diff --git a/Server/application/cunkebao/controller/plan/GetAddFriendPlanDetailV1Controller.php b/Server/application/cunkebao/controller/plan/GetAddFriendPlanDetailV1Controller.php index 7ec88c07..55dfaae4 100644 --- a/Server/application/cunkebao/controller/plan/GetAddFriendPlanDetailV1Controller.php +++ b/Server/application/cunkebao/controller/plan/GetAddFriendPlanDetailV1Controller.php @@ -120,7 +120,7 @@ class GetAddFriendPlanDetailV1Controller extends Controller // 解析JSON字段 $sceneConf = json_decode($plan['sceneConf'], true) ?: []; $reqConf = json_decode($plan['reqConf'], true) ?: []; - $reqConf['deveiceGroups'] = $reqConf['device']; + $reqConf['deviceGroups'] = $reqConf['device']; $msgConf = json_decode($plan['msgConf'], true) ?: []; $tagConf = json_decode($plan['tagConf'], true) ?: []; @@ -139,8 +139,8 @@ class GetAddFriendPlanDetailV1Controller extends Controller } - if (!empty($reqConf['deveiceGroups'])){ - $deveiceGroupsOptions = DeviceModel::alias('d') + if (!empty($reqConf['deviceGroups'])){ + $deviceGroupsOptions = DeviceModel::alias('d') ->field([ 'd.id', 'd.imei', 'd.memo', 'd.alive', 'l.wechatId', @@ -149,16 +149,16 @@ class GetAddFriendPlanDetailV1Controller extends Controller ->leftJoin('device_wechat_login l', 'd.id = l.deviceId and l.alive =' . DeviceWechatLoginModel::ALIVE_WECHAT_ACTIVE . ' and l.companyId = d.companyId') ->leftJoin('wechat_account a', 'l.wechatId = a.wechatId') ->order('d.id desc') - ->whereIn('d.id',$reqConf['deveiceGroups']) + ->whereIn('d.id',$reqConf['deviceGroups']) ->select(); - foreach ($deveiceGroupsOptions as &$device) { + foreach ($deviceGroupsOptions as &$device) { $curstomer = WechatCustomerModel::field('friendShip')->where(['wechatId' => $device['wechatId']])->find(); $device['totalFriend'] = $curstomer->friendShip->totalFriend ?? 0; } unset($device); - $reqConf['deveiceGroupsOptions'] = $deveiceGroupsOptions; + $reqConf['deviceGroupsOptions'] = $deviceGroupsOptions; }else{ - $reqConf['deveiceGroupsOptions'] = []; + $reqConf['deviceGroupsOptions'] = []; } diff --git a/Server/application/cunkebao/validate/Workbench.php b/Server/application/cunkebao/validate/Workbench.php index c382cfe8..ba9cb462 100644 --- a/Server/application/cunkebao/validate/Workbench.php +++ b/Server/application/cunkebao/validate/Workbench.php @@ -55,11 +55,9 @@ class Workbench extends Validate 'distributeType' => 'requireIf:type,5|in:1,2', 'maxPerDay' => 'requireIf:type,5|number|min:1', 'timeType' => 'requireIf:type,5|in:1,2', - 'startTime' => 'requireIf:type,5|dateFormat:H:i', - 'endTime' => 'requireIf:type,5|dateFormat:H:i', 'accountGroups' => 'requireIf:type,5|array|min:1', // 通用参数 - 'deveiceGroups' => 'requireIf:type,1,2,5|array', + 'deviceGroups' => 'requireIf:type,1,2,5|array', ]; /** @@ -142,8 +140,8 @@ class Workbench extends Validate 'timeType.requireIf' => '请选择时间类型', // 通用提示 - 'deveiceGroups.require' => '请选择设备', - 'deveiceGroups.array' => '设备格式错误', + 'deviceGroups.require' => '请选择设备', + 'deviceGroups.array' => '设备格式错误', 'targetGroups.require' => '请选择目标用户组', 'targetGroups.array' => '目标用户组格式错误', 'accountGroups.requireIf' => '流量分发时必须选择分发账号', @@ -155,7 +153,7 @@ class Workbench extends Validate * 验证场景 */ protected $scene = [ - 'create' => ['name', 'type', 'autoStart', 'deveiceGroups', 'targetGroups', + 'create' => ['name', 'type', 'autoStart', 'deviceGroups', 'targetGroups', 'interval', 'maxLikes', 'startTime', 'endTime', 'contentTypes', 'syncInterval', 'syncCount', 'syncType', 'pushType', 'startTime', 'endTime', 'maxPerDay', 'pushOrder', 'isLoop', 'status', 'wechatGroups', 'contentGroups', @@ -163,7 +161,7 @@ class Workbench extends Validate 'groupNameTemplate', 'maxGroupsPerDay', 'groupSizeMin', 'groupSizeMax', ], 'update_status' => ['id', 'status'], - 'edit' => ['name', 'type', 'autoStart', 'deveiceGroups', 'targetGroups', + 'edit' => ['name', 'type', 'autoStart', 'deviceGroups', 'targetGroups', 'interval', 'maxLikes', 'startTime', 'endTime', 'contentTypes', 'syncInterval', 'syncCount', 'syncType', 'pushType', 'startTime', 'endTime', 'maxPerDay', 'pushOrder', 'isLoop', 'status', 'wechatGroups', 'contentGroups', diff --git a/Touchkebao/src/pages/pc/ckbox/weChat/components/ChatWindow/components/MessageRecord/index.tsx b/Touchkebao/src/pages/pc/ckbox/weChat/components/ChatWindow/components/MessageRecord/index.tsx index db925474..d989d1ac 100644 --- a/Touchkebao/src/pages/pc/ckbox/weChat/components/ChatWindow/components/MessageRecord/index.tsx +++ b/Touchkebao/src/pages/pc/ckbox/weChat/components/ChatWindow/components/MessageRecord/index.tsx @@ -687,34 +687,27 @@ const MessageRecord: React.FC = ({ contract }) => { }; const handQuote = (messageData: ChatRecord) => { - //判断如果是用户 const isGroupUser = !!currentContract?.chatroomId; + const isSend = !!messageData.isSend; + const nickname = currentContract?.nickname || ""; + const SEPARATOR = "\n----------------------------------\n"; + + const rawContent = messageData.content || ""; - const isSend = messageData.isSend; //是否为我方发送 - const nickname = currentContract.nickname; - let sendMessageText = ""; if (isGroupUser) { - const GroupNickname = messageData.sender.nickname; - const content = messageData.content.replace( - `${messageData.sender.wechatId}:\n`, + const groupNickname = messageData?.sender?.nickname || ""; + // 群消息里,非本人消息通常以 "wechatId:\n" 开头,清理前缀 + const content = rawContent.replace( + `${messageData?.sender?.wechatId}:\n`, "", ); - if (isSend) { - sendMessageText = `${messageData.content}\n----------------------------------\n`; - } else { - console.log(messageData); - sendMessageText = `@${GroupNickname}:${content}\n----------------------------------\n`; - } - } else { - if (isSend) { - sendMessageText = `${messageData.content}\n----------------------------------\n`; - } else { - sendMessageText = `@${nickname}:${messageData.content}\n----------------------------------\n`; - } - //当前用户的昵称 + const text = isSend ? rawContent : `@${groupNickname}:${content}`; + updateQuoteMessageContent(`${text}${SEPARATOR}`); + return; } - updateQuoteMessageContent(sendMessageText); + const text = isSend ? rawContent : `@${nickname}:${rawContent}`; + updateQuoteMessageContent(`${text}${SEPARATOR}`); }; const handCommad = (action: string) => {