dever 2 년 전
부모
커밋
f56189b839
1개의 변경된 파일18개의 추가작업 그리고 9개의 파일을 삭제
  1. 18 9
      lib/Base.php

+ 18 - 9
lib/Base.php

@@ -65,20 +65,29 @@ class Base
             parse_str($content, $param);
         }
 
-        if ($this->config['sdk'] != 'url') {
-            $result = Dever::load('sms/lib/' . $this->config['sdk'] . '.send', $param, $this->config);
-        } else {
-            if (!$this->config['url']) {
-                $result = 'url error';
+        $debug = false;
+        $mobileCode = Dever::config('base', 'project')->mobileCode;
+        if ($mobileCode && isset($mobileCode['debug'])) {
+            $debug = $mobileCode['debug'];
+        }
+        if (!$debug) {
+            if ($this->config['sdk'] != 'url') {
+                $result = Dever::load('sms/lib/' . $this->config['sdk'] . '.send', $param, $this->config);
             } else {
-                $json = false;
-                if ($this->config['json'] == 1) {
-                    $json = true;
+                if (!$this->config['url']) {
+                    $result = 'url error';
                 } else {
                     $json = false;
+                    if ($this->config['json'] == 1) {
+                        $json = true;
+                    } else {
+                        $json = false;
+                    }
+                    $result = Dever::curl($this->config['url'], $param, $this->config['method'], $json, $this->config['header']);
                 }
-                $result = Dever::curl($this->config['url'], $param, $this->config['method'], $json, $this->config['header']);
             }
+        } else {
+            $result = 'debug true';
         }
 
         # 记录当前的短信信息