|
@@ -66,7 +66,7 @@ class Platform
|
|
} else {
|
|
} else {
|
|
Dever::error('account error');
|
|
Dever::error('account error');
|
|
}
|
|
}
|
|
- $this->field = new Field($field);
|
|
|
|
|
|
+ $this->field = Dever::load(Field::class)->init($field);
|
|
$this->field->setPlatformId($this->platform['id']);
|
|
$this->field->setPlatformId($this->platform['id']);
|
|
$this->field->setApid($this->info['id']);
|
|
$this->field->setApid($this->info['id']);
|
|
$this->field->setHost($this->platform['host']);
|
|
$this->field->setHost($this->platform['host']);
|
|
@@ -90,7 +90,7 @@ class Platform
|
|
$url = $this->url();
|
|
$url = $this->url();
|
|
}
|
|
}
|
|
$method = $this->method();
|
|
$method = $this->method();
|
|
- $request = new Request($this->field, $this->platform['id'], $this->type, $this->info['id']);
|
|
|
|
|
|
+ $request = Dever::load(Request::class)->init($this->field, $this->platform['id'], $this->type, $this->info['id']);
|
|
$body = $request->body();
|
|
$body = $request->body();
|
|
$header = $request->header();
|
|
$header = $request->header();
|
|
$json = $this->info['post_method'] == 3 ? true : false;
|
|
$json = $this->info['post_method'] == 3 ? true : false;
|
|
@@ -99,7 +99,7 @@ class Platform
|
|
$response_body = $curl->result();
|
|
$response_body = $curl->result();
|
|
$response_header = $curl->header();
|
|
$response_header = $curl->header();
|
|
$response_config = ['id' => $this->platform['id'], 'type' => $this->platform['response_type']];
|
|
$response_config = ['id' => $this->platform['id'], 'type' => $this->platform['response_type']];
|
|
- $response = new Response($response_body, $response_header, $this->field, $response_config, $this->type, $this->info['id']);
|
|
|
|
|
|
+ $response = Dever::load(Response::class)->init($response_body, $response_header, $this->field, $response_config, $this->type, $this->info['id']);
|
|
$result = $response->out();
|
|
$result = $response->out();
|
|
$log = [];
|
|
$log = [];
|
|
$log['platform_id'] = $this->platform['id'];
|
|
$log['platform_id'] = $this->platform['id'];
|
|
@@ -129,7 +129,7 @@ class Platform
|
|
$url = $this->url();
|
|
$url = $this->url();
|
|
}
|
|
}
|
|
$method = $this->method();
|
|
$method = $this->method();
|
|
- $request = new Request($this->field, $this->platform['id'], $this->type, $this->info['id']);
|
|
|
|
|
|
+ $request = Dever::load(Request::class)->init($this->field, $this->platform['id'], $this->type, $this->info['id']);
|
|
$request->body();
|
|
$request->body();
|
|
$url .= '?';
|
|
$url .= '?';
|
|
foreach ($this->field->body as $k => $v) {
|
|
foreach ($this->field->body as $k => $v) {
|