160 lines
4.5 KiB
PHP
160 lines
4.5 KiB
PHP
<?php
|
|
|
|
/**
|
|
* @author Any
|
|
* @description KISS
|
|
* @date 2020-11-5
|
|
* @version 1.0.0
|
|
*
|
|
* _____LOG_____
|
|
*
|
|
*/
|
|
namespace app\modules\admin\controllers;
|
|
|
|
use app\modules\admin\behaviors\LoginBehavior;
|
|
use app\modules\admin\models\UserListForm;
|
|
use app\modules\admin\models\UserActionForm;
|
|
use app\components\EncryptHelper;
|
|
|
|
|
|
class UserController extends Controller
|
|
{
|
|
public function behaviors()
|
|
{
|
|
return array_merge(parent::behaviors(), [
|
|
'login' => [
|
|
'class' => LoginBehavior::className(),
|
|
],
|
|
]);
|
|
}
|
|
|
|
public function actionIndex()
|
|
{
|
|
if(\Yii::$app->request->isAjax){
|
|
$form = new UserListForm();
|
|
$form->attributes = \Yii::$app->request->get();
|
|
$form->is_admin = 0;
|
|
$data = $form->search();
|
|
return $this->responseHandler($data);
|
|
}
|
|
return $this->render('index');
|
|
}
|
|
|
|
public function actionAdmin()
|
|
{
|
|
if(\Yii::$app->request->isAjax){
|
|
$form = new UserListForm();
|
|
$form->attributes = \Yii::$app->request->get();
|
|
$form->is_admin = 1;
|
|
$data = $form->search();
|
|
return $this->responseHandler($data);
|
|
}
|
|
return $this->render('admin');
|
|
}
|
|
|
|
public function actionForbidden()
|
|
{
|
|
if(!\Yii::$app->request->isPost){
|
|
$data = $this->invaildRequest();
|
|
return $this->responseHandler($data);
|
|
}
|
|
$form = new UserActionForm();
|
|
$form->attributes = \Yii::$app->request->post();
|
|
$data = $form->forbidden();
|
|
return $this->responseHandler($data);
|
|
}
|
|
|
|
public function actionCancelForbidden()
|
|
{
|
|
if(!\Yii::$app->request->isPost){
|
|
$data = $this->invaildRequest();
|
|
return $this->responseHandler($data);
|
|
}
|
|
$form = new UserActionForm();
|
|
$form->attributes = \Yii::$app->request->post();
|
|
$data = $form->cancel_forbidden();
|
|
return $this->responseHandler($data);
|
|
}
|
|
|
|
public function actionHangup()
|
|
{
|
|
if(!\Yii::$app->request->isPost){
|
|
$data = $this->invaildRequest();
|
|
return $this->responseHandler($data);
|
|
}
|
|
$form = new UserActionForm();
|
|
$form->attributes = \Yii::$app->request->post();
|
|
$data = $form->hangup();
|
|
return $this->responseHandler($data);
|
|
}
|
|
|
|
public function actionCancelHangup()
|
|
{
|
|
if(!\Yii::$app->request->isPost){
|
|
$data = $this->invaildRequest();
|
|
return $this->responseHandler($data);
|
|
}
|
|
$form = new UserActionForm();
|
|
$form->attributes = \Yii::$app->request->post();
|
|
$data = $form->cancel_hangup();
|
|
return $this->responseHandler($data);
|
|
}
|
|
|
|
public function actionAccountLogout()
|
|
{
|
|
if(!\Yii::$app->request->isPost){
|
|
$data = $this->invaildRequest();
|
|
return $this->responseHandler($data);
|
|
}
|
|
$form = new UserActionForm();
|
|
$form->attributes = \Yii::$app->request->post();
|
|
$data = $form->account_logout();
|
|
return $this->responseHandler($data);
|
|
}
|
|
|
|
public function actionLogoutReview()
|
|
{
|
|
if(\Yii::$app->request->isAjax){
|
|
$form = new UserListForm();
|
|
$form->attributes = \Yii::$app->request->get();
|
|
$form->is_admin = 0;
|
|
$data = $form->logout_review();
|
|
return $this->responseHandler($data);
|
|
}
|
|
return $this->render('logout');
|
|
}
|
|
|
|
//记录方式注销
|
|
public function actionLogout()
|
|
{
|
|
if(!\Yii::$app->request->isPost){
|
|
$data = $this->invaildRequest();
|
|
return $this->responseHandler($data);
|
|
}
|
|
$form = new UserActionForm();
|
|
$form->attributes = \Yii::$app->request->post();
|
|
$data = $form->logout();
|
|
return $this->responseHandler($data);
|
|
}
|
|
|
|
//驳回
|
|
public function actionAccountLogoutReview()
|
|
{
|
|
if(!\Yii::$app->request->isPost){
|
|
$data = $this->invaildRequest();
|
|
return $this->responseHandler($data);
|
|
}
|
|
$form = new UserActionForm();
|
|
$form->attributes = \Yii::$app->request->post();
|
|
$data = $form->account_logout_review();
|
|
return $this->responseHandler($data);
|
|
}
|
|
|
|
// 变更为为观看视频
|
|
public function actionEditIsView(){
|
|
$form = new UserActionForm();
|
|
$form->attributes = \Yii::$app->request->post();
|
|
$data = $form->actionEditIsView();
|
|
return $this->responseHandler($data);
|
|
}
|
|
} |