update config permission

This commit is contained in:
2020-05-25 11:42:14 +07:00
parent e77c1416f5
commit 7bdb458b78
8 changed files with 196 additions and 153 deletions

View File

@@ -152,9 +152,15 @@ class ConfigController extends Controller {
'method' => "POST"
]
];
$apiConfig = json_decode(file_get_contents("http://localhost:4004/ReadAPIConfig", false, stream_context_create($options)), true);
$ip = "192.168.0.42";
$tempConfig = json_decode(file_get_contents("http://localhost:4004/ReadAPIConfig", false, stream_context_create($options)), true);
if ($tempConfig['status']) {
$t = json_decode($tempConfig['data'], true);
$temp = explode(":", $t['servermqtt']);
$ip = $temp[0];
}
return $this->render('index', [
"apiConfig" => $apiConfig
"ip" => $ip
]);
}