+ Add api for zdisk.

This commit is contained in:
zhujinyong
2021-09-29 14:47:41 +08:00
parent 1cf925a37c
commit 533c559b0c
10 changed files with 265 additions and 2 deletions
+31
View File
@@ -98,6 +98,8 @@ class api extends router
$this->version = $subPos ? substr($this->path, 1, $subPos - 1) : '';
$this->path = $subPos ? substr($this->path, $subPos) : $this->path;
$this->loadApiLang();
}
/**
@@ -202,6 +204,35 @@ class api extends router
call_user_func_array(array($entry, $this->action), $this->params);
}
/**
* 加载配置文件
*
* Load config file of api.
*
* @param configPath
* @access public
* @return void
*/
public function loadApiConfig($configPath)
{
global $config;
include($this->appRoot . "api/$this->version/config/$configPath.php");
}
/**
* 加载语言文件
*
* Load lang file of api.
*
* @access public
* @return void
*/
public function loadApiLang()
{
global $lang;
include($this->appRoot . "api/$this->version/lang/$this->clientLang.php");
}
/**
* 格式化旧版本API响应数据
*