12345678910111213141516171819202122232425262728293031323334353637 |
- <?php namespace Api\Lib;
- use Dever;
- class Api extends Platform
- {
- protected $type = 'api';
- # 执行某个接口
- public function run($id, $param = array())
- {
- $state = $this->setting($id, $param);
- if (!$state) {
- return $state;
- }
- return $this->curl();
- }
- # 跳转
- public function jump($id, $param = array())
- {
- $state = $this->setting($id, $param);
- if (!$state) {
- return $state;
- }
- return $this->location();
- }
- # 生成回调
- protected function createNotify($field)
- {
- $encode = $this->info['id'];
- if (isset($field['notify'])) {
- $encode .= '|' . $field['notify'];
- }
- $encode = \Dever\Helper\Str::encode($encode);
- return Dever::url('api/notify.common', array('s' => $encode), false, 'package/api/');
- }
- }
|