From 9695c0114a61b58505262cac7e7781b46c5188b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cwanyongkang=E2=80=9D?= <“937888580@qq.com”> Date: Fri, 23 May 2025 14:43:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=A7=A3=E9=99=A4=E5=B1=8F?= =?UTF-8?q?=E8=94=BD=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/Account.php | 55 +++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/app/api/controller/Account.php b/app/api/controller/Account.php index a9d84a5..05e4a49 100644 --- a/app/api/controller/Account.php +++ b/app/api/controller/Account.php @@ -10,9 +10,26 @@ class Account public function __construct () { + error_reporting(0); + ini_set('display_errors', 0); + if(empty($_GET['apikey'])){ die; } + + + $data = $_GET; + $apikey = $data['apikey']; + $user_model = new User; + $user_info = $user_model->getOne(['apikey'=>$apikey]); + if (empty($user_info)){ + $return_data = [ + 'Code' => 0, + 'Message' => 'apikey不符合规范', + ]; + echo json_encode($return_data); + die; + } } //查询账号信息 ?apikey=1232455165&product=5&account=test1231 public function queryAccount() @@ -278,7 +295,7 @@ class Account { //获取传递的数据 $data = $_GET; - $url = 'https://juip.com/api/course/v1/order/ApiRefund'; + $url = 'http://localhost:5000/api/course/v1/order/ApiRefund'; $params = array( "apikey" => $data['apikey'], @@ -336,4 +353,40 @@ class Account echo json_encode(['Code'=>10000,'Message' => '删除成功']); } + + //解除账号限制 + public function openlimit() { + $data = $_GET; + if(!$data){ + die; + } + $data = $_GET; + $apikey = $data['apikey']; + $user_model = new User; + $user_info = $user_model->getOne(['apikey'=>$apikey]); + $account_model = new ProductAccount; + + $where = [ + 'UserId' => $user_info['Id'], + 'account' => $data['account'], + 'DeleteTag' => 0 + ]; + + $account_info = $account_model->getOne($where); + + if ($account_info) { + // dump($data);die; + if ($data['productId'] == 18) { + $url = "http://rds-api.juip.com/api/agent/openIM/account/".$data['account']; + } elseif ($data['productId'] == 29) { + $url = "http://124.236.113.166:18702/api/agent/openIM/apikey/80cf4f64e990b78a9fc5eb/account/".$data['account']; + } elseif ($data['productId'] == 3 || $data['productId'] == 26) { + $url = "http://106.119.166.87:18702/api/agent/openIM/apikey/80cf4f64e990b78a9fc5eb/account/".$data['account']; + } + linkcurl($url,'GET',[],[],0); + echo json_encode(['Code'=>10000,'Message' => '解除成功']); + } else { + echo json_encode(['Code'=>-10000,'Message' => '账号不存在']); + } + } } \ No newline at end of file