mirror of
https://gitee.com/apiadmin/ApiAdmin.git
synced 2025-04-06 03:58:00 +08:00
modified 文档部分兼容普通模式和加密模式
This commit is contained in:
parent
cbdfab5f52
commit
aa5e714ceb
@ -15,7 +15,7 @@ class BuildToken extends Base {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 构建AccessToken
|
* 构建AccessToken
|
||||||
* @return \think\response\Json
|
* @return array
|
||||||
* @throws \think\db\exception\DataNotFoundException
|
* @throws \think\db\exception\DataNotFoundException
|
||||||
* @throws \think\db\exception\ModelNotFoundException
|
* @throws \think\db\exception\ModelNotFoundException
|
||||||
* @throws \think\exception\DbException
|
* @throws \think\exception\DbException
|
||||||
@ -23,9 +23,6 @@ class BuildToken extends Base {
|
|||||||
*/
|
*/
|
||||||
public function getAccessToken() {
|
public function getAccessToken() {
|
||||||
$param = $this->request->param();
|
$param = $this->request->param();
|
||||||
if (empty($param['app_id'])) {
|
|
||||||
return $this->buildFailed(ReturnCode::EMPTY_PARAMS, '缺少app_id');
|
|
||||||
}
|
|
||||||
$appInfo = (new AdminApp())->where(['app_id' => $param['app_id'], 'app_status' => 1])->find();
|
$appInfo = (new AdminApp())->where(['app_id' => $param['app_id'], 'app_status' => 1])->find();
|
||||||
if (empty($appInfo)) {
|
if (empty($appInfo)) {
|
||||||
return $this->buildFailed(ReturnCode::INVALID, '应用ID非法');
|
return $this->buildFailed(ReturnCode::INVALID, '应用ID非法');
|
||||||
|
@ -154,12 +154,18 @@ class Api extends Base {
|
|||||||
$groupInfo->hot = $groupInfo->hot + 1;
|
$groupInfo->hot = $groupInfo->hot + 1;
|
||||||
$groupInfo->save();
|
$groupInfo->save();
|
||||||
|
|
||||||
|
if ($apiList['hash_type'] === 1) {
|
||||||
|
$url = $this->request->domain() . '/api/' . $apiList['api_class'];
|
||||||
|
} else {
|
||||||
|
$url = $this->request->domain() . '/api/' . $hash;
|
||||||
|
}
|
||||||
|
|
||||||
return $this->buildSuccess([
|
return $this->buildSuccess([
|
||||||
'request' => $request,
|
'request' => $request,
|
||||||
'response' => $response,
|
'response' => $response,
|
||||||
'dataType' => $dataType,
|
'dataType' => $dataType,
|
||||||
'apiList' => $apiList,
|
'apiList' => $apiList,
|
||||||
'url' => $this->request->domain() . '/api/' . $hash,
|
'url' => $url,
|
||||||
'co' => config('apiadmin.APP_NAME') . ' ' . config('apiadmin.APP_VERSION')
|
'co' => config('apiadmin.APP_NAME') . ' ' . config('apiadmin.APP_VERSION')
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user