You've already forked guangan
信息
This commit is contained in:
25
app/custom/controller/api/Auth.php
Normal file
25
app/custom/controller/api/Auth.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace app\custom\controller\api;
|
||||
|
||||
use plugin\account\controller\api\Auth as AuthController;
|
||||
use think\exception\HttpResponseException;
|
||||
|
||||
class Auth extends AuthController
|
||||
{
|
||||
/**
|
||||
* 控制器初始化
|
||||
* @return void
|
||||
*/
|
||||
protected function initialize()
|
||||
{
|
||||
try {
|
||||
parent::initialize();
|
||||
$this->checkUserStatus(false);
|
||||
} catch (HttpResponseException $exception) {
|
||||
throw $exception;
|
||||
} catch (\Exception $exception) {
|
||||
$this->error($exception->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
22
app/custom/controller/api/auth/Message.php
Normal file
22
app/custom/controller/api/auth/Message.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace app\custom\controller\api\auth;
|
||||
|
||||
use app\custom\controller\api\Auth;
|
||||
use app\custom\model\CustomMessage;
|
||||
|
||||
class Message extends Auth
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$pageData = CustomMessage::query()->where('user_id', $this->usid)->paginate();
|
||||
$this->success('获取消息列表', $pageData);
|
||||
}
|
||||
|
||||
public function read()
|
||||
{
|
||||
$id = $this->request->post('id');
|
||||
CustomMessage::query()->where('user_id', $this->usid)->where('id', $id)->update(['status' => 1]);
|
||||
$this->success('已读');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user