Quellcode durchsuchen

增加微信模块更新

Anyon vor 4 Jahren
Ursprung
Commit
371ea59465

+ 1 - 0
app/wechat/module/change/2020.08.28.01.md

@@ -0,0 +1 @@
+代码优化调整

+ 1 - 1
app/wechat/module/module.json

@@ -1,6 +1,6 @@
 {
   "name": "wechat",
   "author": "Anyon",
-  "version": "2020.08.03.01",
+  "version": "2020.08.28.01",
   "content": "ThinkAdmin 微信基础模块"
 }

+ 6 - 6
app/wechat/service/MediaService.php

@@ -65,21 +65,21 @@ class MediaService extends Service
     {
         $map = ['md5' => md5($url), 'appid' => WechatService::instance()->getAppid()];
         if (($mediaId = $this->app->db->name('WechatMedia')->where($map)->value('media_id'))) return $mediaId;
-        $result = WechatService::WeChatMedia()->addMaterial(self::getServerPath($url), $type, $video);
+        $result = WechatService::WeChatMedia()->addMaterial(self::_buildCurlFile($url), $type, $video);
         data_save('WechatMedia', [
-            'local_url' => $url, 'md5' => $map['md5'], 'appid' => $map['appid'], 'type' => $type,
-            'media_url' => isset($result['url']) ? $result['url'] : '', 'media_id' => $result['media_id'],
+            'local_url' => $url, 'md5' => $map['md5'], 'type' => $type, 'appid' => $map['appid'],
+            'media_url' => $result['url'] ?? '', 'media_id' => $result['media_id'],
         ], 'type', $map);
         return $result['media_id'];
     }
 
     /**
-     * 文件位置处理
-     * @param string $local
+     * 创建 CURL 文件对象
+     * @param string $local 文件路径或网络地址
      * @return string
      * @throws \WeChat\Exceptions\LocalCacheException
      */
-    private function getServerPath($local)
+    private function _buildCurlFile($local)
     {
         if (file_exists($local)) {
             return new MyCurlFile($local);

Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 0
public/static/plugs/require/require.js


Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.