junfei 6 lat temu
rodzic
commit
7df63ea309
5 zmienionych plików z 5 dodań i 35 usunięć
  1. 3 4
      app/common.php
  2. 0 19
      app/config.php
  3. 0 6
      app/database.php
  4. 0 6
      app/tags.php
  5. 2 0
      config/app.php

+ 3 - 4
app/common.php

@@ -110,10 +110,9 @@ function curl_huawei_sms($url, $data, $timeout=100){
     $headerArr[] = 'X-WSSE:UsernameToken Username="'.$username.'",PasswordDigest="' . $passwordDigest . '",Nonce="' . $nonce . '",Created="' . $created . '"';
     $headerArr[] = 'Content-Type: application/json; charset=UTF-8';
     curl_setopt($ch, CURLOPT_HTTPHEADER, $headerArr);
-    //var_dump(C('test_proxy'));exit;
-    //if(C('test_proxy')) {
-    curl_setopt($ch, CURLOPT_PROXY, '192.168.16.96:8888');
-    //}
+    if(config('app.proxy')) { //
+        curl_setopt($ch, CURLOPT_PROXY, config('app.proxy'));
+    }
     $ret = curl_exec($ch);
     if (empty($ret)) {
         var_dump(curl_error($ch)); // 查看报错信息

+ 0 - 19
app/config.php

@@ -1,19 +0,0 @@
-<?php
-return
-    [
-    'exception_handle'       => '\\rest\\common\\exception\\Notification',
-    'log'                    => [
-        'type'  => 'File',
-        'path'  => LOG_PATH,
-        'level' => ['error','sql'],
-        'file_size'=>102400000,
-    ],
-    'enable_log_request'=>true, //记录请求日志
-	 'mail'=>[
-        'username'=>'123456@qq.com',
-        'password'=>'123456',
-        'host'=>'smtp.qq.com',
-        'port'=>465,
-    ],
-];
-  

+ 0 - 6
app/database.php

@@ -1,6 +0,0 @@
-<?php
-return [
-	//其它配置...
-    'debug'       => true,
- 
-];

+ 0 - 6
app/tags.php

@@ -1,6 +0,0 @@
-<?php
-return [
-    'action_begin'=> [
-        'rest\\index\\behavior\\Trace',
-    ],
-];

+ 2 - 0
config/app.php

@@ -47,4 +47,6 @@ return [
    // 'default_return_type'=>'json'
 
     'app_debug' =>  true,
+
+    'proxy' =>Env::get('app.proxy', ''),
 ];