fix error in wait function

This commit is contained in:
root
2021-08-26 10:09:57 +00:00
parent b6860e373a
commit bdfee2c81b
6 changed files with 30 additions and 20 deletions
+8 -3
View File
@@ -185,14 +185,14 @@ function install()
return message($html, $title, 400);
} else {
/*$html = '<script>
var status = "' . $response['status'] . '";
var status = "' . $response['DplStatus'] . '";
var expd = new Date();
expd.setTime(expd.getTime()+1000);
var expires = "expires="+expd.toGMTString();
document.cookie=\'language=; path=/; \'+expires;
</script>';
return message($html, $title, 201, 1);*/
$data["dplId"] = $response['status'];
$data["dplId"] = $response['DplStatus'];
return output(json_encode($data), 201);
}
}
@@ -353,7 +353,7 @@ function VercelUpdate($appId, $token, $sourcePath = "")
$response = curl("POST", $url, json_encode($data), $header);
//echo json_encode($response, JSON_PRETTY_PRINT) . " ,res<br>";
$result = json_decode($response["body"], true);
$result['status'] = $result['id'];
$result['DplStatus'] = $result['id'];
return json_encode($result);
}
@@ -431,6 +431,11 @@ function OnekeyUpate($auth = 'qkqpttgf', $project = 'OneManager-php', $branch =
}
function WaitFunction($deployid) {
if ($buildId=='1') {
$tmp['stat'] = 400;
$tmp['body'] = 'id must provided.';
return $tmp;
}
$header["Authorization"] = "Bearer " . getConfig('APIKey');
$header["Content-Type"] = "application/json";
$url = "https://api.vercel.com/v11/now/deployments/" . $deployid;