增加日志记录

This commit is contained in:
lingling 2024-04-20 16:03:56 +08:00
parent 7b65a35f5a
commit 82db3d35fb
1 changed files with 11 additions and 2 deletions

View File

@ -3,12 +3,12 @@
namespace app\controller; namespace app\controller;
use support\Request; use support\Request;
use support\Db;
use app\result\Result; use app\result\Result;
use Carbon\Carbon; use Carbon\Carbon;
use app\model\Timetable; use app\model\Timetable;
use support\Log; use support\Log;
use Curl\Curl;
class IndexController class IndexController
{ {
public function index(Request $request) public function index(Request $request)
@ -18,6 +18,7 @@ class IndexController
$readme = '700'; $readme = '700';
// $readme = file_get_contents(base_path('README.md')); // $readme = file_get_contents(base_path('README.md'));
} }
Log::info('log test');
return $readme; return $readme;
} }
@ -56,7 +57,15 @@ class IndexController
} }
return Result::show(200,'ok',''); return Result::show(200,'ok','');
} }
public function send_msg($title, $body) public function send_msg($title='', $body='')
{ {
$brak_key='';
$curl = new Curl();
$curl->get('https://www.example.com/'.$title.'/'.$body);
if ($curl->error) {
$curl->diagnose();
Log::info('消息发送失败', $curl->errorMessage);
}
return Result::show(200,'ok','');
} }
} }