From 612bb07bec34c4d7aece371a47ed5b0a42aaf702 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=8D=8E=E6=B8=85?= <18691022700@163.com> Date: Thu, 29 Jan 2026 16:24:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=81=E7=A6=81=20=E5=BC=BA=E5=88=B6?= =?UTF-8?q?=E9=80=80=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/adminapi/controller/User.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/application/adminapi/controller/User.php b/application/adminapi/controller/User.php index 71d1a110..5436638e 100644 --- a/application/adminapi/controller/User.php +++ b/application/adminapi/controller/User.php @@ -857,6 +857,7 @@ class User extends adminApi $type = input('type', 1); $type_text = input('type_text', ''); $block_time = input('block_time', 0); + $ban_eason = input('ban_eason', 0); $admin_id = Session::get('admin_id'); //插入fa_block 表 $res = Db::name('block')->insert([ @@ -865,10 +866,27 @@ class User extends adminApi 'type_text' => $type_text, 'block_time' => strtotime($block_time), 'createtime' => time(), + 'ban_eason' => $ban_eason, ]); if (!$res) { return V(0, "添加失败"); } + //1账号, 2设备, 3ip 4禁言 + if($type == 1){ + $user_id = db::name('user')->where('user_code', $type_text)->value('id'); + } + if($type == 2){ + $user_id = db::name('user')->where('login_device', $type_text)->value('id'); + } + if($type == 3){ + $user_id = db::name('user')->where('loginip', $type_text)->value('id'); + } + if(isset($user_id)){ + $token = db::name('user_token')->where('user_id', $user_id)->value('token'); + // 删除这个Token,使其失效 + TokenLib::delete($token); + } + return V(1,"添加成功", null); } /*