33 lines
729 B
PHP
33 lines
729 B
PHP
![]() |
<?php
|
||
|
|
||
|
namespace app\api\controller;
|
||
|
|
||
|
use app\BaseController;
|
||
|
use app\common\model\UserPolicy;
|
||
|
use app\constant\ResponseCode;
|
||
|
use support\Request;
|
||
|
use think\Exception;
|
||
|
|
||
|
class UserPolicyController extends BaseController
|
||
|
{
|
||
|
protected $noNeedLogin = ['*'];
|
||
|
public function getPolicy(Request $e)
|
||
|
{
|
||
|
try {
|
||
|
$policy = UserPolicy::where('id', 1)->findOrEmpty();
|
||
|
|
||
|
return json([
|
||
|
'code' => ResponseCode::SUCCESS,
|
||
|
'data' => $policy,
|
||
|
'msg' => 'success',
|
||
|
]);
|
||
|
} catch (Exception $e) {
|
||
|
return json([
|
||
|
'code' => ResponseCode::FAIL,
|
||
|
'msg' => $e->getMessage()
|
||
|
]);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|