check duplicate khi đồng bộ
This commit is contained in:
@@ -236,12 +236,18 @@ class ListManagementController extends Controller {
|
||||
public function actionFormSync() {
|
||||
if (Yii::$app->request->post()) {
|
||||
$data = Yii::$app->request->post();
|
||||
$results = file_get_contents("http://" . $data['ip'] . "/api/data");
|
||||
$results = json_decode(file_get_contents("http://" . $data['ip'] . "/api/data", false, stream_context_create([
|
||||
'http' => [
|
||||
'header' => "Content-Type: application/json",
|
||||
'method' => "POST",
|
||||
'content' => json_encode(ListManagement::nameArray())
|
||||
]
|
||||
])), true);
|
||||
Yii::$app->response->format = "json";
|
||||
return [
|
||||
"title" => $data['ip'],
|
||||
"form" => $this->renderPartial("list", [
|
||||
"results" => json_decode($results, true),
|
||||
"results" => $results,
|
||||
"typeArray" => ListManagement::$typeArray,
|
||||
"ip" => $data['ip']
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user