license setting

This commit is contained in:
kuaifan
2023-03-16 12:47:58 +08:00
parent 809c6769f6
commit 4260549f72
9 changed files with 260 additions and 14 deletions

View File

@@ -513,6 +513,41 @@ class SystemController extends AbstractController
return Base::retSuccess('success', $setting);
}
/**
* @api {post} api/system/license 08. License
*
* @apiDescription 获取License信息、保存License(限管理员)
* @apiVersion 1.0.0
* @apiGroup system
* @apiName license
*
* @apiParam {String} type
* - get: 获取
* - save: 保存
* @apiParam {String} license License 原文
*
* @apiSuccess {Number} ret 返回状态码(1正确、0错误)
* @apiSuccess {String} msg 返回信息(错误描述)
* @apiSuccess {Object} data 返回数据
*/
public function license()
{
User::auth('admin');
//
$type = trim(Request::input('type'));
if ($type == 'save') {
$license = Base::getPostValue('license');
Doo::licenseSave($license);
}
//
return Base::retSuccess('success', [
'license' => Doo::licenseContent(),
'info' => Doo::license(),
'macs' => Doo::macs(),
'user_count' => User::whereBot(0)->whereNull('disable_at')->count(),
]);
}
/**
* @api {get} api/system/get/info 10. 获取终端详细信息
*