加湿器可以说是目前家里比较常见的生活用品之一了,特别是爱美的女性朋友们,为了能保持容颜润泽,经常会在身旁备用一台。其实对于更多的用户来说,加湿器的主要作用还是放在空调房里,用来调节房间湿度的,因为空调房的空气非常干燥,用户长期待在房间里会产生皮肤干涩的感觉,老一辈人都是在床底下放一盆水来起到加湿作用,现在人们生活水平提高了,自然更愿意花钱购买专门的加湿器来使用了。今天给大家介绍一款来自ORICO的空气加湿器,它的体积小巧,便于搬动,而且还能当小夜灯来使用,一举两得,实用性很不错。
<?php
namespace app\engine\controller;
use app\engine\utils\ModuleGenerator;
use app\engine\utils\AdminGenerator;
class Index extends Common
{
public function index()
{
echo runtime_path()."params.txt";
return json(["status" => 200, "data" => "hello world"]);
}
public function makeAdmin()
{
//如果不是POST请求则提示错误
if (!$this->request->isPost()) return json(["status" => 411, "data" => "请求方式错误"]);
$params = $this->request->post();
$generator = new AdminGenerator($params);
$code = $generator->generateCode();
return json($code, JSON_UNESCAPED_UNICODE);
}
/**
* 生成模块代码
*/
public function makeModule()
{
//如果不是POST请求则提示错误
if (!$this->request->isPost()) return json(["status" => 411, "data" => "请求方式错误"]);
$params = $this->request->post();
//将接收到的$params 写入到文件中
file_put_contents(runtime_path()."params.txt", json_encode($params));
if (!$params) return json(["status" => 411, "data" => "参数错误"]);
$moduleGenerator = new ModuleGenerator($params);
$code = $moduleGenerator->generateCode();
return json($code);
}
}