moshaorui 1 день тому
батько
коміт
2960608869
1 змінених файлів з 2 додано та 2 видалено
  1. 2 2
      app/Services/Smm/TwitterService.php

+ 2 - 2
app/Services/Smm/TwitterService.php

@@ -324,7 +324,7 @@ class TwitterService implements SmmPlatformInterface
      */
     public function uploadAndPost($filePaths, $tweetText) {
         try {
-            $tweetText = $this->truncateText($tweetText, 270);// 截断推文
+            $tweetText = $this->truncateText($tweetText);// 截断推文
 
             $media_ids = [];
             foreach ($filePaths as $filePath) {
@@ -462,7 +462,7 @@ class TwitterService implements SmmPlatformInterface
      * @param string $ellipsis 截断后缀(默认...)
      * @return string 处理后的文本
      */
-    function truncateText(string $text, int $maxWidth = 270, string $ellipsis = ''): string {
+    function truncateText(string $text, int $maxWidth = 250, string $ellipsis = ''): string {
         if ($maxWidth <= 0) return '';
 
         // 计算后缀的显示宽度