diff --git a/.env.example b/.env.example index 32b5ab5..eac5476 100755 --- a/.env.example +++ b/.env.example @@ -2,14 +2,14 @@ debug = true [server] port=8585 -domain=www.wenjb.com +domain=www.shun777.com https=false [mysql] host =127.0.0.1 -port = 3307 -database = questionnaire -username = questionnaire -password = ba9b492bda93ad4d +port = 3306 +database = imadmin +username = imadmin +password = ejkFmaAXAHXyNXd2 charset = utf8mb4 collation = utf8mb4_general_ci prefix = wa_ @@ -18,13 +18,13 @@ engine = [mongodb] host = 127.0.0.1 port = 27017 -database = questionnaire_m -username = commie +database = imadmin_mongo +username = root password = n1e5a6s6m7 [redis] host = 127.0.0.1 port = 6379 -database = 10 +database = 0 password = n1e5a6s6m7 prefix = q_ diff --git a/app/api/controller/AddressController.php b/app/api/controller/AddressController.php index 37ab028..c5433d4 100755 --- a/app/api/controller/AddressController.php +++ b/app/api/controller/AddressController.php @@ -2,7 +2,6 @@ namespace app\api\controller; use support\Request; -use taoser\facade\Validate; use app\model\Address as AddressModel; use hg\apidoc\annotation as Apidoc; diff --git a/app/api/controller/ArticleController.php b/app/api/controller/ArticleController.php index d3ab37c..d0356f0 100755 --- a/app/api/controller/ArticleController.php +++ b/app/api/controller/ArticleController.php @@ -3,7 +3,6 @@ namespace app\api\controller; use app\model\Archives as ArchivesModel; use support\Request; -use taoser\facade\Validate; use hg\apidoc\annotation as Apidoc; /** diff --git a/app/api/controller/BaseController.php b/app/api/controller/BaseController.php index 1f6cc7f..3191a2d 100755 --- a/app/api/controller/BaseController.php +++ b/app/api/controller/BaseController.php @@ -5,7 +5,7 @@ use support\Response; use Shopwwi\WebmanFilesystem\FilesystemFactory; use Shopwwi\WebmanFilesystem\Facade\Storage; use hg\apidoc\annotation as Apidoc; -use taoser\facade\Validate; +use Tinywan\Validate\Facade\Validate; /** * 基础控制器 * @Apidoc\NotParse() @@ -40,7 +40,7 @@ class BaseController */ protected function json(int $code, string $msg = 'ok', array|object|null $data = []): Response { - return json(['code' => $code, 'data' => $data, 'msg' => $msg]); + return json(['code' => $code, 'data' => $data, 'msg' => __($msg)]); } protected function success(string $msg = '成功', array|object|null $data = []): Response diff --git a/app/api/controller/CardController.php b/app/api/controller/CardController.php index 748cf1e..e51b0de 100755 --- a/app/api/controller/CardController.php +++ b/app/api/controller/CardController.php @@ -5,7 +5,6 @@ use app\model\Card as CardModel; use app\model\Cdkey as CdkeyModel; use app\model\User as UserModel; use support\think\Db; -use taoser\facade\Validate; use hg\apidoc\annotation as Apidoc; /** diff --git a/app/api/controller/CommonController.php b/app/api/controller/CommonController.php index 8c3defb..672fbc6 100755 --- a/app/api/controller/CommonController.php +++ b/app/api/controller/CommonController.php @@ -1,7 +1,7 @@ header('lang','zh-Hans'); locale( $lang); $config = Config('site'); $disallowFields = [ diff --git a/app/api/controller/ContactController.php b/app/api/controller/ContactController.php index f9fbb2e..e289668 100755 --- a/app/api/controller/ContactController.php +++ b/app/api/controller/ContactController.php @@ -5,7 +5,6 @@ use app\model\UserRemark as UserRemarkModel; use app\model\GroupRemark as GroupRemarkModel; use support\Request; use support\Response; -use taoser\facade\Validate; use support\think\Db; use hg\apidoc\annotation as Apidoc; /** diff --git a/app/api/controller/FriendCircleController.php b/app/api/controller/FriendCircleController.php index 75b116f..70f020a 100755 --- a/app/api/controller/FriendCircleController.php +++ b/app/api/controller/FriendCircleController.php @@ -10,7 +10,6 @@ use app\model\FriendCircleLike as FriendCircleLikeModel; use app\model\FriendCircleComment as FriendCircleCommentModel; use support\Request; use support\Response; -use taoser\facade\Validate; use support\think\Db; use hg\apidoc\annotation as Apidoc; diff --git a/app/api/controller/FriendController.php b/app/api/controller/FriendController.php index ea63ac0..923d804 100755 --- a/app/api/controller/FriendController.php +++ b/app/api/controller/FriendController.php @@ -5,7 +5,6 @@ use app\model\UserRemark as UserRemarkModel; use app\model\GroupRemark as GroupRemarkModel; use support\Request; use support\Response; -use taoser\facade\Validate; use support\think\Db; use hg\apidoc\annotation as Apidoc; /** diff --git a/app/api/controller/GiftController.php b/app/api/controller/GiftController.php index 053197e..479de6c 100755 --- a/app/api/controller/GiftController.php +++ b/app/api/controller/GiftController.php @@ -5,7 +5,6 @@ use app\model\Gift as GiftModel; use app\model\GiftOrder as GiftOrderModel; use app\model\User as UserModel; use support\think\Db; -use taoser\facade\Validate; use hg\apidoc\annotation as Apidoc; /** diff --git a/app/api/controller/MessageController.php b/app/api/controller/MessageController.php index 87d80ef..2aaecce 100644 --- a/app/api/controller/MessageController.php +++ b/app/api/controller/MessageController.php @@ -3,7 +3,6 @@ namespace app\api\controller; use app\model\User as UserModel; use support\Request; use support\Response; -use taoser\facade\Validate; use support\think\Db; use hg\apidoc\annotation as Apidoc; diff --git a/app/api/controller/ProductController.php b/app/api/controller/ProductController.php index db80b24..198fe9f 100755 --- a/app/api/controller/ProductController.php +++ b/app/api/controller/ProductController.php @@ -4,7 +4,6 @@ namespace app\api\controller; use app\model\Product as ProductModel; use app\model\ProductOrder as ProductOrderModel; use support\think\Db; -use taoser\facade\Validate; use hg\apidoc\annotation as Apidoc; /** diff --git a/app/api/controller/ProductOrderController.php b/app/api/controller/ProductOrderController.php index 33080b3..659b025 100755 --- a/app/api/controller/ProductOrderController.php +++ b/app/api/controller/ProductOrderController.php @@ -5,7 +5,6 @@ use app\model\ProductOrder as ProductOrderModel; use app\model\Product as ProductModel; use app\model\User as UserModel; use support\think\Db; -use taoser\facade\Validate; use hg\apidoc\annotation as Apidoc; /** diff --git a/app/api/controller/RechargeController.php b/app/api/controller/RechargeController.php index a31540a..e7f8817 100755 --- a/app/api/controller/RechargeController.php +++ b/app/api/controller/RechargeController.php @@ -3,7 +3,6 @@ namespace app\api\controller; use support\Request; use support\think\Db; -use taoser\facade\Validate; use app\model\Recharge as RechargeModel; use app\model\User as UserModel; use hg\apidoc\annotation as Apidoc; diff --git a/app/api/controller/UserController.php b/app/api/controller/UserController.php index 9b3b211..eb16cbe 100755 --- a/app/api/controller/UserController.php +++ b/app/api/controller/UserController.php @@ -6,7 +6,6 @@ use app\model\User as UserModel; use app\model\Realname as RealnameModel; use support\Request; use support\Response; -use taoser\facade\Validate; use support\think\Db; use hg\apidoc\annotation as Apidoc; diff --git a/app/api/controller/WalletController.php b/app/api/controller/WalletController.php index feb9b1c..a9b0ccf 100755 --- a/app/api/controller/WalletController.php +++ b/app/api/controller/WalletController.php @@ -3,7 +3,6 @@ namespace app\api\controller; use app\model\User as UserModel; use support\Request; use app\model\Cdkey as CdkeyModel; -use taoser\facade\Validate; use support\think\Db; use hg\apidoc\annotation as Apidoc; diff --git a/app/api/controller/WithdrawlController.php b/app/api/controller/WithdrawlController.php index f8ba113..fd8e606 100755 --- a/app/api/controller/WithdrawlController.php +++ b/app/api/controller/WithdrawlController.php @@ -6,7 +6,6 @@ use app\model\User as UserModel; use app\model\Withdrawl as WithdrawlModel; use support\Request; use support\think\Db; -use taoser\facade\Validate; use hg\apidoc\annotation as Apidoc; /** diff --git a/app/api/middleware/Auth.php b/app/api/middleware/Auth.php index 8be195b..0b17fbf 100755 --- a/app/api/middleware/Auth.php +++ b/app/api/middleware/Auth.php @@ -29,7 +29,7 @@ class Auth implements MiddlewareInterface $response = response('',204,$headers); return $response; } - $lang = $request->input('lang','zh-Hans'); + $lang = $request->header('lang','zh-Hans'); locale($lang); if ($request->controller) { $request->client = $request->header('client',"web"); diff --git a/app/command/OpenIm.php b/app/command/OpenIm.php index f1596df..78fed84 100755 --- a/app/command/OpenIm.php +++ b/app/command/OpenIm.php @@ -14,15 +14,677 @@ class OpenIm extends Command protected static $defaultName = 'openim'; protected static $defaultDescription = 'OpenIm'; public $sdk= null; + function fixurl(){ + $sdk = $this->getSdk(); + $search = 'http://103.39.222.184:10002/object/'; + $replace = 'https://s1.shun777.com/imapi/object/'; + $users = Db::name('User') + ->whereLike('avatar','%'.$search) + ->field('avatar,id,userID') + ->select(); + foreach($users as $k=>$user){ + $avatar = str_replace($search,$replace,$user['avatar']); + Db::name('User') + ->where('id',$user['id']) + ->update(['avatar'=>$avatar]); + $sdata = [ + 'faceURL' => $avatar + ]; + $sdk->user->updateUserInfo($user['userID'],$sdata); + } + $model = new \app\model\Openim\Group(); + $list = $model->whereLike('face_url', '%'.$search)->select(); + foreach($list as $k=>$group){ + $avatar = str_replace($search,$replace,$group['face_url']); + $model->where('id',$group['id'])->update(['face_url'=>$avatar]); + } + + $model = new \app\model\Openim\Msg(); + $total = $model->count('id'); + $count = 0; + for($i=0;$i<$total;$i+=1000){ + $list = $model->limit($i,1000)->select(); + foreach($list as $item){ + if(!empty($item['msgs']) && is_array($item['msgs'])){ + $msgs = []; + foreach($item['msgs'] as $key => $msg){ + if(is_null($msg['msg'])){ + continue; + } + $msgs[] = $msg; + } + $item->msgs = $msgs; + } + $item->save(); + $count++; + } + } + return 0; + } + function convertUserID(InputInterface $input, OutputInterface $output): int + { + $userID = $input->getOption('userID'); + $this->_convertUserID($userID,$output); + return 0; + } + function _convertUserID($userID,$output): int + { + $oldUserID = \support\Encrypt::userIDEncode($userID); + $newUserID = \support\Encrypt::intEncode($userID); + + cp("开始转换用户ID: {$userID} -> {$oldUserID} -> {$newUserID}"); + // $this->convertBlackTable($oldUserID, $newUserID, $output); + // $this->convertConversationTable($oldUserID, $newUserID, $output); + // $this->convertVersionTables($oldUserID, $newUserID, $output); + // $this->convertFriendTable($oldUserID, $newUserID, $output); + // $this->convertFriendRequestTable($oldUserID, $newUserID, $output); + // $this->convertGroupTable($oldUserID, $newUserID, $output); + // $this->convertGroupMemberTable($oldUserID, $newUserID, $output); + // $this->convertGroupRequestTable($oldUserID, $newUserID, $output); + // $this->convertMsgTable($oldUserID, $newUserID, $output); + // $this->convertSeqTable($oldUserID, $newUserID, $output); + // $this->convertSeqUserTable($oldUserID, $newUserID, $output); + // $this->convertUserTable($oldUserID, $newUserID, $output); + for ($i=100006;$i<102028;$i++){ + $newUserID = \support\Encrypt::intEncode($i); + Db::name('User')->where('id',$i)->update(['userID'=>$newUserID]); + } + cp("用户ID:{$userID} -> {$newUserID} 转换完成"); + return 0; + } + protected function convertFriendTable($oldUserID, $newUserID, $output){ + $model = new \app\model\Openim\Friend(); + $list = $model->select(); + $count = 0; + foreach($list as $item){ + $savedata = []; + if($item['owner_user_id']){ + $savedata['owner_user_id'] = $this->turnID($item['owner_user_id']); + } + if($item['friend_user_id']){ + $savedata['friend_user_id'] = $this->turnID($item['friend_user_id']); + } + if($item['operator_user_id']){ + $savedata['operator_user_id'] = $this->turnID($item['operator_user_id']); + } + if(!empty($savedata)){ + $model->where('id',$item['id'])->update($savedata); + } + $count++; + } + $output->writeln("Friend 表转换完成,共 {$count} 条记录"); + } + + protected function convertFriendRequestTable($oldUserID, $newUserID, $output){ + $model = new \app\model\Openim\FriendRequest(); + $list = $model->select(); + $count = 0; + foreach($list as $item){ + $savedata = []; + if($item['from_user_id']){ + $savedata['from_user_id'] = $this->turnID($item['from_user_id']); + } + if($item['to_user_id']){ + $savedata['to_user_id'] = $this->turnID($item['to_user_id']); + } + if($item['handler_user_id']){ + $savedata['handler_user_id'] = $this->turnID($item['handler_user_id']); + } + if(!empty($savedata)){ + $model->where('id',$item['id'])->update($savedata); + } + $count++; + } + $output->writeln("FriendRequest 表转换完成,共 {$count} 条记录"); + } + protected function convertGroupTable($oldUserID, $newUserID, $output){ + $model = new \app\model\Openim\Group(); + $list = $model->select(); + $count = 0; + foreach($list as $item){ + $savedata = []; + if($item['creator_user_id']){ + $savedata['creator_user_id'] = $this->turnID($item['creator_user_id']); + } + if($item['notification_user_id']){ + $savedata['notification_user_id'] = $this->turnID($item['notification_user_id']); + } + if(!empty($savedata)){ + $model->where('id',$item['id'])->update($savedata); + } + $count++; + } + $output->writeln("Group 表转换完成,共 {$count} 条记录"); + } + + protected function convertGroupMemberTable($oldUserID, $newUserID, $output){ + $model = new \app\model\Openim\GroupMember(); + $list = $model->select(); + $count = 0; + foreach($list as $item){ + $savedata = []; + if($item['user_id']){ + $savedata['user_id'] = $this->turnID($item['user_id']); + } + if($item['inviter_user_id']){ + $savedata['inviter_user_id'] = $this->turnID($item['inviter_user_id']); + } + if($item['operator_user_id']){ + $savedata['operator_user_id'] = $this->turnID($item['operator_user_id']); + } + if(!empty($savedata)){ + $model->where('id',$item['id'])->update($savedata); + } + $count++; + } + $output->writeln("GroupMember 表转换完成,共 {$count} 条记录"); + } + + + protected function convertBlackTable($oldUserID, $newUserID, $output){ + $model = new \app\model\Openim\Black(); + $list = $model->select(); + $count = 0; + foreach($list as $item){ + $savedata = []; + if($item['block_user_id']){ + $savedata['block_user_id'] = $this->turnID($item['block_user_id']); + } + if($item['owner_user_id']){ + $savedata['owner_user_id'] = $this->turnID($item['owner_user_id']); + } + if($item['operator_user_id']){ + $savedata['operator_user_id'] = $this->turnID($item['operator_user_id']); + } + if(!empty($savedata)){ + $model->where('id',$item['id'])->update($savedata); + } + $count++; + } + $output->writeln("Black 表转换完成,共 {$count} 条记录"); + } + protected function convertConversationTable($oldUserID, $newUserID, $output){ + $model = new \app\model\Openim\Conversation(); + $list = $model->select(); + $count = 0; + foreach($list as $item){ + $savedata = []; + if($item['user_id']){ + $savedata['user_id'] = $this->turnID($item['user_id']); + } + if($item['owner_user_id']){ + $savedata['owner_user_id'] = $this->turnID($item['owner_user_id']); + } + if($item['conversation_id']){ + $savedata['conversation_id'] = $this->handlerConversationID($item['conversation_id']); + } + $model->where('id',$item['id'])->update($savedata); + //$item->save(); + $count++; + } + $output->writeln("Conversation 表转换完成,共 {$count} 条记录"); + } + + protected function convertUserTable($oldUserID, $newUserID, $output){ + $model = new \app\model\Openim\User(); + $list = $model->select(); + foreach($list as $k=>$user){ + $model->where('id',$user['id'])->update([ + 'user_id' => $this->turnID($user['user_id']) + ]); + } + } + + + protected function convertGroupRequestTable($oldUserID, $newUserID, $output){ + $model = new \app\model\Openim\GroupRequest(); + $list = $model->select(); + $count = 0; + foreach($list as $item){ + $savedata = []; + if($item['user_id']){ + $savedata['user_id'] = $this->turnID($item['user_id']); + } + if($item['handle_user_id']){ + $savedata['handle_user_id'] = $this->turnID($item['handle_user_id']); + } + if($item['inviter_user_id']){ + $savedata['inviter_user_id'] = $this->turnID($item['inviter_user_id']); + } + $model->where('id',$item['id'])->update($savedata); + $count++; + } + $output->writeln("GroupRequest 表转换完成,共 {$count} 条记录"); + } + + protected function convertSeqTable($oldUserID, $newUserID, $output){ + $model = new \app\model\Openim\Seq(); + $list = $model->select(); + $count = 0; + foreach($list as $item){ + $model->where('id',$item['id'])->update([ + 'conversation_id' => $this->handlerConversationID($item['conversation_id']) + ]); + $count++; + } + $output->writeln("Seq 表转换完成,共 {$count} 条记录"); + } + + + protected function convertSeqUserTable($oldUserID, $newUserID, $output){ + $model = new \app\model\Openim\SeqUser(); + $list = $model->select(); + //cp($model->getLastSql()); + $count = 0; + foreach($list as $item){ + $model->where('id',$item['id'])->update([ + 'user_id' => $this->turnID($item->user_id), + 'conversation_id' => $this->handlerConversationID($item['conversation_id']) + ]); + $count++; + } + if($count){ + $output->writeln("SeqUser 表转换完成,共 {$count} 条记录"); + } + } + + protected function convertVersionTables($oldUserID, $newUserID, $output){ + $this->convertConversationVersionTable($oldUserID, $newUserID, $output); + $this->convertFriendVersionTable($oldUserID, $newUserID, $output); + $this->convertGroupMemberVersionTable($oldUserID, $newUserID, $output); + $this->convertGroupJoinVersionTable($oldUserID, $newUserID, $output); + } + + protected function convertConversationVersionTable($oldUserID, $newUserID, $output){ + $model = new \app\model\Openim\ConversationVersion(); + $list = $model->select(); + $count = 0; + foreach($list as $item){ + $savedata = []; + $savedata['d_id'] = $this->turnID($item['d_id']); + if(!empty($item['logs']) && is_array($item['logs'])){ + $logs = $item['logs']; + foreach($logs as $key => $log){ + if(isset($log['e_id'])){ + $logs[$key]['e_id'] = $this->handlerConversationID($log['e_id']); + } + } + $savedata['logs'] = $logs; + } + $model->where('id',$item['id'])->update($savedata); + $count++; + } + $output->writeln("ConversationVersion 表转换完成,共 {$count} 条记录"); + } + + protected function convertFriendVersionTable($oldUserID, $newUserID, $output){ + $model = new \app\model\Openim\FriendVersion(); + $list = $model->select(); + $count = 0; + foreach($list as $item){ + $savedata = []; + $savedata['d_id'] = $this->turnID($item['d_id']); + if(!empty($item['logs']) && is_array($item['logs'])){ + $logs = $item['logs']; + foreach($logs as $key => $log){ + if(isset($log['e_id'])){ + $logs[$key]['e_id'] = $this->handlerConversationID($log['e_id']); + } + } + $savedata['logs'] = $logs; + } + $model->where('id',$item['id'])->update($savedata); + $count++; + } + $output->writeln("FriendVersion 表转换完成,共 {$count} 条记录"); + } + + protected function convertGroupMemberVersionTable($oldUserID, $newUserID, $output){ + $model = new \app\model\Openim\GroupMemberVersion(); + $list = $model->select(); + $count = 0; + foreach($list as $item){ + $savedata = []; + $savedata['d_id'] = $this->turnID($item['d_id']); + if(!empty($item['logs']) && is_array($item['logs'])){ + $logs = $item['logs']; + foreach($logs as $key => $log){ + if(isset($log['e_id'])){ + $logs[$key]['e_id'] = $this->handlerConversationID($log['e_id']); + } + } + $savedata['logs'] = $logs; + } + $model->where('id',$item['id'])->update($savedata); + $count++; + } + $output->writeln("GroupMemberVersion 表转换完成,共 {$count} 条记录"); + } + + protected function convertGroupJoinVersionTable($oldUserID, $newUserID, $output){ + $model = new \app\model\Openim\GroupJoinVersion(); + $list = $model->select(); + $count = 0; + foreach($list as $item){ + $savedata = []; + $savedata['d_id'] = $this->turnID($item['d_id']); + if(!empty($item['logs']) && is_array($item['logs'])){ + $logs = $item['logs']; + foreach($logs as $key => $log){ + if(isset($log['e_id'])){ + $logs[$key]['e_id'] = $this->handlerConversationID($log['e_id']); + } + } + $savedata['logs'] = $logs; + } + $model->where('id',$item['id'])->update($savedata); + $count++; + } + $output->writeln("GroupJoinVersion 表转换完成,共 {$count} 条记录"); + } + function turnID($id){ + if($id == 'official_team' || $id == 'officialteam'){ + return 'SystemOfficialTeam'; + } + if($id == 'group_bot'){ + return 'SystemGroupBot'; + } + if($id == 'imAdmin'){ + return 'SystemImAdmin'; + } + if($id == 'system'){ + return 'SystemAccount'; + } + try{ + return \support\Encrypt::intEncode(\support\Encrypt::userIDDecode($id)); + }catch(\Exception $e){ + return $id; + } + } + protected function convertMsgTable($oldUserID, $newUserID, $output){ + $model = new \app\model\Openim\Msg(); + $total = $model->count('id'); + $count = 0; + for($i=0;$i<$total;$i+=1000){ + $list = $model->limit($i,1000)->select(); + foreach($list as $item){ + $savedata = []; + $doc_id = explode(':',$item['doc_id']); + $doc_id[0] = $this->handlerConversationID($doc_id[0]); + $savedata['doc_id'] = $doc_id[0].':'.$doc_id[1]; + foreach($item['msgs'] as $key => $msg){ + if(isset($msg['msg']['send_id'])){ + $savedata['msgs'][$key]['msg']['send_id'] = $this->turnID($msg['msg']['send_id']); + } + if(isset($msg['msg']['recv_id'])){ + $savedata['msgs'][$key]['msg']['recv_id'] = $this->turnID($msg['msg']['recv_id']); + } + $content = []; + if($msg['msg']['content']){ + $content = json_decode($msg['msg']['content'],true); + } + if($msg['msg']['content_type'] == '101'){ + //cp($content); + //break 2; + } + if($msg['msg']['content_type'] == '102'){ + $urlFields = ['sourcePath']; + $this->handlerUrl($content,$urlFields); + if(isset($content['sourcePicture'])){ + $urlFields = ['url']; + $this->handlerUrl($content['sourcePicture'],$urlFields); + } + if(isset($content['bigPicture'])){ + $urlFields = ['url']; + $this->handlerUrl($content['bigPicture'],$urlFields); + } + if(isset($content['snapshotPicture'])){ + $urlFields = ['url']; + $this->handlerUrl($content['snapshotPicture'],$urlFields); + } + //cp($content); + //break 2; + } + if($msg['msg']['content_type'] == '103'){ + $urlFields = ['soundPath','sourceUrl']; + $this->handlerUrl($content,$urlFields); + } + if($msg['msg']['content_type'] == '104'){ + $urlFields = ['videoUrl','snapshotUrl','snapshotPath','videoPath']; + $this->handlerUrl($content,$urlFields); + //cp($content); + //break 2; + } + if($msg['msg']['content_type'] == '106'){ + if(isset($content['atUserList'])){ + foreach($content['atUserList'] as $k=>$userID){ + $content['atUserList'][$k] = $this->turnID($userID); + } + } + if(isset($content['atUsersInfo'])){ + foreach($content['atUsersInfo'] as $k=>$v){ + $content['atUsersInfo'][$k]['atUserID'] = $this->turnID($v['atUserID']); + } + } + } + if($msg['msg']['content_type'] == '108'){ + $this->handlerUserId($content,['userID']); + $this->handlerUrl($content,['faceURL']); + } + if($msg['msg']['content_type'] == '109'){ + //cp($content); + //break 2; + } + if($msg['msg']['content_type'] == '114'){ + if(isset($content['quoteMessage'])){ + $userIDFields = ['sendID','recvID']; + $this->handlerUserId($detail['quoteMessage'],$userIDFields); + $urlFields = ['senderFaceUrl']; + $this->handlerUrl($detail['quoteMessage'],$urlFields); + } + } + if($msg['msg']['content_type'] == '1201'){ + //cp($content['detail']); + $detail = json_decode($content['detail'],true); + if(isset($detail['fromToUserID'])){ + $userIDFields = ['fromUserID','toUserID']; + $this->handlerUserId($detail['fromToUserID'],$userIDFields); + } + if(isset($detail['request'])){ + $userIDFields = ['handlerUserID','fromUserID','toUserID']; + $this->handlerUserId($detail['request'],$userIDFields); + $urlFields = ['fromFaceURL','toFaceURL']; + $this->handlerUrl($detail['request'],$urlFields); + + } + $content['detail'] = json_encode($detail,JSON_UNESCAPED_UNICODE); + //cp($detail); + //break 2; + } + if(in_array($msg['msg']['content_type'],['1501','1504','1507','1508','1509','1510','1512','1513','1514','1519','1515','1520'])){ + $detail = json_decode($content['detail'],true); + + if(isset($detail['memberList'])){ + foreach($detail['memberList'] as $memberIndex => $member){ + $userIDFields = ['userID','operatorUserID','inviterUserID']; + $this->handlerUserId($member,$userIDFields); + $urlFields = ['faceURL']; + $this->handlerUrl($member,$urlFields); + $detail['memberList'][$memberIndex] = $member; + } + } + if(isset($detail['invitedUserList'])){ + foreach($detail['invitedUserList'] as $memberIndex => $member){ + $userIDFields = ['userID','operatorUserID','inviterUserID']; + $this->handlerUserId($member,$userIDFields); + $urlFields = ['faceURL']; + $this->handlerUrl($member,$urlFields); + $detail['invitedUserList'][$memberIndex] = $member; + } + } + if(isset($detail['groupOwnerUser'])){ + $userIDFields = ['userID','operatorUserID','inviterUserID']; + $this->handlerUserId($detail['groupOwnerUser'],$userIDFields); + $urlFields = ['faceURL']; + $this->handlerUrl($detail['groupOwnerUser'],$urlFields); + } + if(isset($detail['inviterUser'])){ + $userIDFields = ['userID','operatorUserID','inviterUserID']; + $this->handlerUserId($detail['inviterUser'],$userIDFields); + $urlFields = ['faceURL']; + $this->handlerUrl($detail['inviterUser'],$urlFields); + } + if(isset($detail['oldGroupOwnerInfo'])){ + $userIDFields = ['userID','operatorUserID','inviterUserID']; + $this->handlerUserId($detail['oldGroupOwnerInfo'],$userIDFields); + $urlFields = ['faceURL']; + $this->handlerUrl($detail['oldGroupOwnerInfo'],$urlFields); + } + if(isset($detail['newGroupOwner'])){ + $userIDFields = ['userID','operatorUserID','inviterUserID']; + $this->handlerUserId($detail['newGroupOwner'],$userIDFields); + $urlFields = ['faceURL']; + $this->handlerUrl($detail['newGroupOwner'],$urlFields); + } + if(isset($detail['entrantUser'])){ + $userIDFields = ['userID','operatorUserID','inviterUserID']; + $this->handlerUserId($detail['entrantUser'],$userIDFields); + $urlFields = ['faceURL']; + $this->handlerUrl($detail['entrantUser'],$urlFields); + } + if(isset($detail['mutedUser'])){ + $userIDFields = ['userID','operatorUserID','inviterUserID']; + $this->handlerUserId($detail['mutedUser'],$userIDFields); + $urlFields = ['faceURL']; + $this->handlerUrl($detail['mutedUser'],$urlFields); + } + if(isset($detail['group'])){ + $userIDFields = ['ownerUserID','creatorUserID']; + $this->handlerUserId($detail['group'],$userIDFields); + $urlFields = ['faceURL']; + $this->handlerUrl($detail['group'],$urlFields); + } + if(isset($detail['opUser'])){ + $userIDFields = ['userID','operatorUserID','inviterUserID']; + $this->handlerUserId($detail['opUser'],$userIDFields); + $urlFields = ['faceURL']; + $this->handlerUrl($detail['opUser'],$urlFields); + } + if(isset($detail['quitUser'])){ + $userIDFields = ['userID','operatorUserID','inviterUserID']; + $this->handlerUserId($detail['quitUser'],$userIDFields); + $urlFields = ['faceURL']; + $this->handlerUrl($detail['quitUser'],$urlFields); + } + if(isset($detail['kickedUserList'])){ + foreach($detail['kickedUserList'] as $memberIndex => $member){ + $userIDFields = ['userID','operatorUserID','inviterUserID']; + $this->handlerUserId($member,$userIDFields); + $urlFields = ['faceURL']; + $this->handlerUrl($member,$urlFields); + $detail['kickedUserList'][$memberIndex] = $member; + } + } + $content['detail'] = json_encode($detail,JSON_UNESCAPED_UNICODE); + //break 2; + } + if($msg['msg']['content_type'] == '1701'){ + $detail = json_decode($content['detail'],true); + $userIDFields = ['recvID','sendID']; + $this->handlerUserId($detail,$userIDFields); + if(isset($detail['conversationID'])){ + $detail['conversationID'] = $this->handlerConversationID($detail['conversationID']); + } + $content['detail'] = json_encode($detail,JSON_UNESCAPED_UNICODE); + } + if($msg['msg']['content_type'] == '2001'){ + //cp($content); + //break 2; + } + if($msg['msg']['content_type'] == '2200'){ + $detail = json_decode($content['detail'],true); + $userIDFields = ['markAsReadUserID']; + $this->handlerUserId($detail,$userIDFields); + if(isset($detail['conversationID'])){ + $detail['conversationID'] = $this->handlerConversationID($detail['conversationID']); + } + //cp($detail); + $content['detail'] = json_encode($detail,JSON_UNESCAPED_UNICODE); + //break 2; + } + if($msg['msg']['content_type'] == '2101'){ + $detail = json_decode($content['detail'],true); + $userIDFields = ['revokerUserID']; + $this->handlerUserId($detail,$userIDFields); + $detail['conversationID'] = $this->handlerConversationID($detail['conversationID']); + $content['detail'] = json_encode($detail,JSON_UNESCAPED_UNICODE); + } + $msg['msg']['content'] = json_encode($content,JSON_UNESCAPED_UNICODE); + $savedata['msgs'][$key] = $msg; + } + if(!empty($savedata)){ + $model->where('id',$item['id'])->update($savedata); + $count++; + } + } + } + //log_alert($contentTypes,'cansnow'); + //$output->writeln("Msg 表转换完成,共 {$count} 条记录"); + } + + function handlerConversationID($data){ + $data = str_replace('official_team','officialteam',$data); + $cids = explode('_',$data); + $cids[1] = $this->turnID($cids[1]); + if(count($cids) >2){ + $cids[2] = $this->turnID($cids[2]); + } + $data = implode('_',$cids); + return $data; + } + function handlerUserId(&$data,$userIDFields){ + foreach($userIDFields as $userIDField){ + if(isset($data[$userIDField]) && $data[$userIDField]){ + $data[$userIDField] = $this->turnID($data[$userIDField]); + } + } + } + function handlerUrl(&$data,$urlFields){ + foreach($urlFields as $urlField){ + if(isset($data[$urlField])){ + $data[$urlField] = $this->cdn($data[$urlField]); + } + } + } + + function cdn($url){ + if(substr(0,2) =='//'){ + $url = 'https:'.$url; + } + if(substr(0,7) =='http://'){ + $url = 'https://'.substr($url,7); + } + return $url; + } + function getUser(){ + $im = $this->getSdk(); + $data = $im->user->searchNotificationAccount(''); + cp($data); + return 0; + } /** * @return void */ protected function configure() { $this->addOption('action','a', InputArgument::OPTIONAL, '操作类型'); + $this->addOption('conversationID','c', InputArgument::OPTIONAL, '会话ID'); + $this->addOption('userID','u', InputArgument::OPTIONAL, '用户ID'); } + + /** * @param InputInterface $input * @param OutputInterface $output diff --git a/app/command/exception/Handler.php b/app/command/exception/Handler.php index 2e47922..ed412b0 100755 --- a/app/command/exception/Handler.php +++ b/app/command/exception/Handler.php @@ -37,7 +37,7 @@ class Handler extends ExceptionHandler public function render(Request $request, Throwable $exception): Response { $code = $exception->getCode(); - $json = ['code' => $code ?: 500, 'msg' => $exception->getMessage()]; + $json = ['code' => $code ?: 500, 'msg' => __($exception->getMessage())]; return new Response(200, ['Content-Type' => 'application/json'], json_encode($json, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); diff --git a/app/controller/MetricsController.php b/app/controller/MetricsController.php index e6287dc..c7eba29 100644 --- a/app/controller/MetricsController.php +++ b/app/controller/MetricsController.php @@ -281,7 +281,7 @@ class MetricsController extends Base $metrics = []; try { - $redis = \Bilulanlv\ThinkCache\facade\ThinkCache::handler(); + $redis = \support\think\Cache::handler(); $info = $redis->info(); // Redis连接状态 diff --git a/app/event/User.php b/app/event/User.php index cffcab1..f6e59d9 100755 --- a/app/event/User.php +++ b/app/event/User.php @@ -44,6 +44,7 @@ class User{ * @var \support\OpenImSdk\Client $IM */ $IM = request()->IM; + log_alert($data['userID']); $imToken = $IM->auth->getUserToken($data['userID'],Input('platform')); $data['imToken'] = $imToken['token']; return $data; diff --git a/app/functions.php b/app/functions.php index dca6541..837880d 100755 --- a/app/functions.php +++ b/app/functions.php @@ -1,5 +1,4 @@ set($name, $value, $expire); + return \support\think\Cache::tag($tag)->set($name, $value, $expire); } } } @@ -80,6 +79,19 @@ if (!function_exists('get')) { if (!function_exists('__')) { function __(string $name = '', array $parameters = [], ?string $domain = null, ?string $locale = null) { + // $locale = $locale ?: locale(); + // if(!$domain){ + // $request = Request(); + // $request->app.','.$request->plugin.','.get_controller_name(); + // $fn = '/resource/translations/'.$locale.'/'.($request->app ? $request->app .'/' : '').strtolower(get_controller_name()); + + // if($request->plugin){ + // $fn = base_path('plugin').'/'.$request->plugin.$fn; + // }else{ + // $fn = base_path($fn); + // } + // $domain = $fn; + // } return trans($name, $parameters, $domain, $locale); } } diff --git a/app/mcp/McpService.php b/app/mcp/McpService.php index 8208dcc..ef3f1b4 100755 --- a/app/mcp/McpService.php +++ b/app/mcp/McpService.php @@ -430,7 +430,7 @@ class McpService 'database' => config('thinkorm.connections.mysql.database', ''), ], 'cache' => [ - 'default' => config('plugin.bilulanlv.think-cache.app.default', 'redis'), + 'default' => config('think-cache.app.default', 'redis'), 'stores' => array_keys(config('cache.stores', [])), ] ]; @@ -650,7 +650,7 @@ class McpService case 'cache': return [ - 'default_driver' => config('plugin.bilulanlv.think-cache.app.default', 'redis'), + 'default_driver' => config('think-cache.app.default', 'redis'), 'opcache_enabled' => function_exists('opcache_get_status') && opcache_get_status() !== false, 'redis_available' => extension_loaded('redis'), 'memcached_available' => extension_loaded('memcached'), @@ -697,7 +697,7 @@ class McpService 'charset' => config('thinkorm.connections.mysql.charset', 'utf8mb4'), 'debug' => config('thinkorm.connections.mysql.trigger_sql', true), ], - 'cache' => config('plugin.bilulanlv.think-cache.app', []), + 'cache' => config('think-cache.app', []), 'session' => config('session', []), 'log' => config('log', []), ]; diff --git a/app/mcp/tpl/controller/api.tpl b/app/mcp/tpl/controller/api.tpl index 4e37dcf..55ac261 100755 --- a/app/mcp/tpl/controller/api.tpl +++ b/app/mcp/tpl/controller/api.tpl @@ -2,7 +2,7 @@ namespace app\api\controller; use think\facade\Db; use support\Request; -use taoser\facade\Validate; +use Tinywan\Validate\Facade\Validate; use support\Jwt; use hg\apidoc\annotation as Apidoc; /** diff --git a/app/validate/User.php b/app/validate/User.php index 019fad6..c6409f2 100755 --- a/app/validate/User.php +++ b/app/validate/User.php @@ -1,7 +1,7 @@ [ 'class' => Monolog\Formatter\LineFormatter::class, diff --git a/config/plugin/tinywan/validate/app.php b/config/plugin/tinywan/validate/app.php new file mode 100644 index 0000000..8f9c426 --- /dev/null +++ b/config/plugin/tinywan/validate/app.php @@ -0,0 +1,4 @@ + true, +]; \ No newline at end of file diff --git a/config/plugin/tinywan/validate/bootstrap.php b/config/plugin/tinywan/validate/bootstrap.php new file mode 100644 index 0000000..f7a4b21 --- /dev/null +++ b/config/plugin/tinywan/validate/bootstrap.php @@ -0,0 +1,4 @@ + true, // 默认缓存驱动 'default' => 'redis', // 缓存连接方式配置 @@ -15,17 +10,28 @@ return [ 'type' => 'redis', // 服务器地址 'host' => \support\Env::get('redis.host'), + // 缓存端口 + 'port' => \support\Env::get('redis.port'), + // 缓存密码 'password' => \support\Env::get('redis.password',null), - 'port' => \support\Env::get('redis.port',6379), + // 缓存数据库 + 'database' => \support\Env::get('redis.database',0), // 缓存前缀 'prefix' => \support\Env::get('redis.prefix','cache:'), - 'select' => \support\Env::get('redis.database','0'), // 默认缓存有效期 0表示永久缓存 'expire' => 0, // Thinkphp官方没有这个参数,由于生成的tag键默认不过期,如果tag键数量很大,避免长时间占用内存,可以设置一个超过其他缓存的过期时间,0为不设置 - 'tag_expire' => 86400 * 7, + 'tag_expire' => 86400 * 30, // 缓存标签前缀 'tag_prefix' => 'tag:', + // 连接池配置 + 'pool' => [ + 'max_connections' => 5, // 最大连接数 + 'min_connections' => 1, // 最小连接数 + 'wait_timeout' => 3, // 从连接池获取连接等待超时时间 + 'idle_timeout' => 60, // 连接最大空闲时间,超过该时间会被回收 + 'heartbeat_interval' => 50, // 心跳检测间隔,需要小于60秒 + ], ], // 文件缓存 'file' => [ @@ -35,4 +41,4 @@ return [ 'path' => runtime_path() . '/file/', ], ], -]; +]; \ No newline at end of file diff --git a/config/thinkorm.php b/config/thinkorm.php index 18002eb..3201d8b 100755 --- a/config/thinkorm.php +++ b/config/thinkorm.php @@ -43,6 +43,7 @@ return [ 'trigger_sql' => true, 'params' => [ 'persist' => 'mongodb_persist', // 持久化连接标识 + 'authSource' => 'admin', ], ], 'immongodb' => [ diff --git a/database.sql b/database.sql deleted file mode 100755 index 404e720..0000000 --- a/database.sql +++ /dev/null @@ -1,742 +0,0 @@ --- MySQL dump 10.13 Distrib 8.0.36, for Linux (x86_64) --- --- Host: localhost Database: imadmin --- ------------------------------------------------------ --- Server version 8.0.36 - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!50503 SET NAMES utf8mb4 */; -/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; -/*!40103 SET TIME_ZONE='+00:00' */; -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; - --- --- Table structure for table `wa_address` --- - -DROP TABLE IF EXISTS `wa_address`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `wa_address` ( - `id` int NOT NULL AUTO_INCREMENT, - `user_id` int DEFAULT NULL, - `title` varchar(100) DEFAULT NULL, - `network` varchar(10) DEFAULT 'BEP-20', - `address` varchar(80) NOT NULL, - `status` tinyint(1) DEFAULT '1', - `created_at` int NOT NULL DEFAULT '0', - `updated_at` int DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `user_id` (`user_id`), - KEY `network` (`network`), - KEY `status` (`status`) -) ENGINE=InnoDB AUTO_INCREMENT=770 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `wa_address` --- - -LOCK TABLES `wa_address` WRITE; -/*!40000 ALTER TABLE `wa_address` DISABLE KEYS */; -/*!40000 ALTER TABLE `wa_address` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `wa_admin` --- - -DROP TABLE IF EXISTS `wa_admin`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `wa_admin` ( - `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID', - `username` varchar(32) NOT NULL COMMENT '用户名', - `nickname` varchar(40) NOT NULL COMMENT '昵称', - `password` varchar(255) NOT NULL COMMENT '密码', - `avatar` varchar(255) DEFAULT '/app/admin/avatar.png' COMMENT '头像', - `email` varchar(100) DEFAULT NULL COMMENT '邮箱', - `mobile` varchar(16) DEFAULT NULL COMMENT '手机', - `totp_secret` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, - `created_at` int DEFAULT NULL, - `updated_at` int DEFAULT NULL, - `login_at` int DEFAULT NULL, - `status` tinyint DEFAULT NULL COMMENT '禁用', - PRIMARY KEY (`id`), - UNIQUE KEY `username` (`username`) -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='管理员表'; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `wa_admin` --- - -LOCK TABLES `wa_admin` WRITE; -/*!40000 ALTER TABLE `wa_admin` DISABLE KEYS */; -INSERT INTO `wa_admin` VALUES (1,'commie','超级管理员','$2y$10$CY3nucJJyF1rlTn6lAeB/.lOnkxJhKA1acGdrp6ae7EjuuhVmpipq','/app/admin/avatar.png','cansnow@msn.cn','158888888888','EJGYB7OZR2W46XRX7VB3PXHSOY4LUAWCA5GTDAVTWKHXNDAAAIIP7AQ3JSO3XZJNX5J5OTIDEQVKLYFYIYNAXSCYF4GNZ2EMA4ORA3Y',1725833089,1766382716,1766382716,1),(2,'admin','admin','$2y$10$iBbye1wy6PX4m1zUPvzieerkjb.ko7gWzzsjlPzW5mMmYrCS9SaNG','','mingchuang1000@outlook.com','15042658541','',1725939675,1725978282,NULL,1); -/*!40000 ALTER TABLE `wa_admin` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `wa_admin_access` --- - -DROP TABLE IF EXISTS `wa_admin_access`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `wa_admin_access` ( - `id` int NOT NULL AUTO_INCREMENT COMMENT '主键', - `role_id` int NOT NULL COMMENT '角色id', - `admin_id` int NOT NULL COMMENT '管理员id', - PRIMARY KEY (`id`), - UNIQUE KEY `role_admin_id` (`role_id`,`admin_id`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='管理员角色表'; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `wa_admin_access` --- - -LOCK TABLES `wa_admin_access` WRITE; -/*!40000 ALTER TABLE `wa_admin_access` DISABLE KEYS */; -INSERT INTO `wa_admin_access` VALUES (1,1,1); -/*!40000 ALTER TABLE `wa_admin_access` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `wa_admin_role` --- - -DROP TABLE IF EXISTS `wa_admin_role`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `wa_admin_role` ( - `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', - `name` varchar(80) NOT NULL COMMENT '角色组', - `rules` text COMMENT '权限', - `created_at` int DEFAULT NULL, - `updated_at` int DEFAULT NULL, - `pid` int unsigned DEFAULT NULL COMMENT '父级', - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='管理员角色'; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `wa_admin_role` --- - -LOCK TABLES `wa_admin_role` WRITE; -/*!40000 ALTER TABLE `wa_admin_role` DISABLE KEYS */; -INSERT INTO `wa_admin_role` VALUES (1,'超级管理员','*',1660407301,1671797107,NULL); -/*!40000 ALTER TABLE `wa_admin_role` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `wa_admin_rule` --- - -DROP TABLE IF EXISTS `wa_admin_rule`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `wa_admin_rule` ( - `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', - `extend` varchar(255) DEFAULT NULL, - `title` varchar(255) NOT NULL COMMENT '标题', - `icon` varchar(255) DEFAULT NULL COMMENT '图标', - `key` varchar(255) NOT NULL COMMENT '标识', - `pid` int unsigned DEFAULT '0' COMMENT '上级菜单', - `created_at` datetime DEFAULT NULL COMMENT '创建时间', - `updated_at` datetime DEFAULT NULL COMMENT '更新时间', - `href` varchar(255) DEFAULT NULL COMMENT 'url', - `type` int NOT NULL DEFAULT '1' COMMENT '类型', - `weight` int DEFAULT '0' COMMENT '排序', - `status` tinyint(1) NOT NULL DEFAULT '1', - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=291 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='权限规则'; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `wa_admin_rule` --- - -LOCK TABLES `wa_admin_rule` WRITE; -/*!40000 ALTER TABLE `wa_admin_rule` DISABLE KEYS */; -INSERT INTO `wa_admin_rule` VALUES (2,NULL,'所有表','','app\\controller\\TableController',16,'2024-09-08 22:04:42','2024-09-18 08:56:22','/table/index',1,800,0),(3,NULL,'权限管理','mdi mdi-account-settings','auth',0,'2024-09-08 22:04:42','2024-09-08 22:04:42','',0,900,1),(4,NULL,'账户管理','mdi mdi-human-child','app\\controller\\AdminController',3,'2024-09-08 22:04:42','2024-09-08 22:04:42','/admin/index',1,1000,1),(5,NULL,'角色管理','mdi mdi-account-settings','app\\controller\\AdminRoleController',3,'2024-09-08 22:04:42','2024-09-12 17:34:10','/adminrole/index',1,900,1),(6,NULL,'菜单管理','mdi mdi-menu','app\\controller\\AdminRuleController',3,'2024-09-08 22:04:42','2024-09-12 17:34:21','/adminrule/index',1,800,1),(9,NULL,'通用设置','mdi mdi-cog-outline','common',0,'2024-09-08 22:04:42','2025-11-21 06:53:39','',0,700,1),(10,NULL,'个人资料','mdi mdi-account-circle-outline','app\\controller\\AccountController',9,'2024-09-08 22:04:42','2025-11-21 06:54:17','/account/index',1,800,1),(11,NULL,'附件管理','mdi mdi-attachment','app\\controller\\FilesController',9,'2024-09-08 22:04:42','2025-12-24 04:26:05','/files/index',1,700,1),(12,NULL,'字典设置',NULL,'app\\controller\\DictController',9,'2024-09-08 22:04:42','2024-09-08 22:04:42','/dict/index',1,600,0),(13,NULL,'系统设置','mdi mdi-cogs','app\\controller\\ConfigController',9,'2024-09-08 22:04:42','2025-11-21 06:55:42','/config/index',1,500,1),(16,NULL,'开发辅助','layui-icon-fonts-code','dev',0,'2024-09-08 22:04:42','2024-09-08 22:04:42',NULL,0,500,0),(17,NULL,'表单构建',NULL,'app\\controller\\DevController',16,'2024-09-08 22:04:42','2024-09-08 22:04:42','/dev/form-build',1,800,1),(63,NULL,'分类管理','mdi mdi-multiplication','app\\controller\\CategoryController',64,NULL,'2024-09-12 18:26:09','/Category/index',1,NULL,1),(64,NULL,'内容管理','mdi mdi-content-paste','Content',0,NULL,NULL,'',0,NULL,1),(65,NULL,'用户管理','mdi mdi-account','user',0,'2024-09-12 18:03:02','2024-09-12 18:03:02','',0,NULL,1),(66,NULL,'用户管理','mdi mdi-account','app\\controller\\UserController',65,'2024-09-12 18:04:22','2024-09-12 18:04:22','/User/index',1,NULL,1),(67,NULL,'用户权限','mdi mdi-account-settings','app\\controller\\UserRuleController',65,'2024-09-12 18:05:35','2024-09-12 18:05:35','/userrule/index',1,NULL,1),(68,NULL,'用户角色','mdi mdi-account-multiple','app\\controller\\UserRoleController',65,'2024-09-12 18:06:23','2024-09-12 18:08:29','/userrole/index',1,NULL,1),(69,NULL,'插入',NULL,'app\\controller\\AdminController@insert',4,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(70,NULL,'更新',NULL,'app\\controller\\AdminController@update',4,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(71,NULL,'删除',NULL,'app\\controller\\AdminController@delete',4,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(72,NULL,'multi',NULL,'app\\controller\\AdminController@multi',4,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(73,NULL,'插入',NULL,'app\\controller\\AdminRoleController@insert',5,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(74,NULL,'更新',NULL,'app\\controller\\AdminRoleController@update',5,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(75,NULL,'删除',NULL,'app\\controller\\AdminRoleController@delete',5,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(76,NULL,'获取角色权限',NULL,'app\\controller\\AdminRoleController@rules',5,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(77,NULL,'multi',NULL,'app\\controller\\AdminRoleController@multi',5,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(78,NULL,'查询',NULL,'app\\controller\\AdminRuleController@roletree',6,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(79,NULL,'查询',NULL,'app\\controller\\AdminRuleController@select',6,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(80,NULL,'buildcache',NULL,'app\\controller\\AdminRuleController@buildcache',6,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(81,NULL,'添加',NULL,'app\\controller\\AdminRuleController@insert',6,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(82,NULL,'更新',NULL,'app\\controller\\AdminRuleController@update',6,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(83,NULL,'删除',NULL,'app\\controller\\AdminRuleController@delete',6,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(84,NULL,'multi',NULL,'app\\controller\\AdminRuleController@multi',6,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(85,NULL,'更新',NULL,'app\\controller\\AccountController@update',10,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(86,NULL,'修改密码',NULL,'app\\controller\\AccountController@password',10,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(87,NULL,'查询',NULL,'app\\controller\\AccountController@select',10,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(88,NULL,'添加',NULL,'app\\controller\\AccountController@insert',10,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(89,NULL,'删除',NULL,'app\\controller\\AccountController@delete',10,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(90,NULL,'multi',NULL,'app\\controller\\AccountController@multi',10,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(104,NULL,'更改',NULL,'app\\controller\\ConfigController@update',13,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(105,NULL,'更改',NULL,'app\\controller\\ConfigController@insert',13,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(114,NULL,'插入',NULL,'app\\controller\\UserController@insert',66,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(115,NULL,'更新',NULL,'app\\controller\\UserController@update',66,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(116,NULL,'查询',NULL,'app\\controller\\UserController@select',66,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(117,NULL,'删除',NULL,'app\\controller\\UserController@delete',66,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(118,NULL,'multi',NULL,'app\\controller\\UserController@multi',66,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(119,NULL,'权限树形','','app\\controller\\UserRuleController@roletree',67,'2024-09-12 18:23:14','2024-09-12 18:25:08','',2,0,1),(120,NULL,'查询',NULL,'app\\controller\\UserRuleController@select',67,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(121,NULL,'添加',NULL,'app\\controller\\UserRuleController@insert',67,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(122,NULL,'更新',NULL,'app\\controller\\UserRuleController@update',67,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(123,NULL,'删除',NULL,'app\\controller\\UserRuleController@delete',67,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(124,NULL,'multi',NULL,'app\\controller\\UserRuleController@multi',67,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(125,NULL,'插入',NULL,'app\\controller\\UserRoleController@insert',68,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(126,NULL,'更新',NULL,'app\\controller\\UserRoleController@update',68,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(127,NULL,'删除',NULL,'app\\controller\\UserRoleController@delete',68,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(128,NULL,'获取角色权限',NULL,'app\\controller\\UserRoleController@rules',68,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(129,NULL,'multi',NULL,'app\\controller\\UserRoleController@multi',68,'2024-09-12 18:23:14','2024-09-12 18:23:14',NULL,2,0,1),(130,NULL,'插入',NULL,'app\\controller\\CategoryController@insert',63,'2024-09-12 20:14:23','2024-09-12 20:14:23',NULL,2,0,1),(131,NULL,'更新',NULL,'app\\controller\\CategoryController@update',63,'2024-09-12 20:14:23','2024-09-12 20:14:23',NULL,2,0,1),(132,NULL,'查询',NULL,'app\\controller\\CategoryController@select',63,'2024-09-12 20:14:23','2024-09-12 20:14:23',NULL,2,0,1),(133,NULL,'删除',NULL,'app\\controller\\CategoryController@delete',63,'2024-09-12 20:14:23','2024-09-12 20:14:23',NULL,2,0,1),(134,NULL,'multi',NULL,'app\\controller\\CategoryController@multi',63,'2024-09-12 20:14:23','2024-09-12 20:14:23',NULL,2,0,1),(135,NULL,'根据类同步规则到数据库',NULL,'app\\controller\\AdminRuleController@syncRules',6,'2024-09-13 13:34:59','2024-09-13 13:34:59',NULL,2,0,1),(136,NULL,'根据类同步规则到数据库',NULL,'app\\controller\\UserRuleController@syncRules',67,'2024-09-13 13:34:59','2024-09-13 13:34:59',NULL,2,0,1),(137,NULL,'余额日志','mdi mdi-currency-jpy','app\\controller\\BalanceLogController',65,'2024-09-13 19:31:33','2024-09-13 19:31:33','/balancelog/index',1,NULL,1),(138,NULL,'插入',NULL,'app\\controller\\BalanceLogController@insert',137,'2024-09-13 19:31:37','2024-09-13 19:31:37',NULL,2,0,1),(139,NULL,'更新',NULL,'app\\controller\\BalanceLogController@update',137,'2024-09-13 19:31:37','2024-09-13 19:31:37',NULL,2,0,1),(140,NULL,'查询',NULL,'app\\controller\\BalanceLogController@select',137,'2024-09-13 19:31:37','2024-09-13 19:31:37',NULL,2,0,1),(141,NULL,'删除',NULL,'app\\controller\\BalanceLogController@delete',137,'2024-09-13 19:31:37','2024-09-13 19:31:37',NULL,2,0,1),(142,NULL,'multi',NULL,'app\\controller\\BalanceLogController@multi',137,'2024-09-13 19:31:37','2024-09-13 19:31:37',NULL,2,0,1),(143,NULL,'用户提现','mdi mdi-currency-jpy','app\\controller\\WithdrawlController',65,'2024-09-18 08:52:01','2024-09-18 08:52:01','/withdrawl/index',1,NULL,1),(145,NULL,'文章管理','mdi mdi-note-text-outline','app\\controller\\ArticleController',64,'2024-09-19 15:52:52','2025-12-23 22:13:35','/article/index',1,0,1),(156,NULL,'profile',NULL,'app\\controller\\AccountController@profile',10,'2024-09-19 15:52:57','2024-09-19 15:52:57',NULL,2,0,1),(180,NULL,'查询',NULL,'app\\controller\\WithdrawlController@select',143,'2024-09-19 15:52:57','2024-09-19 15:52:57',NULL,2,0,1),(181,NULL,'添加',NULL,'app\\controller\\WithdrawlController@insert',143,'2024-09-19 15:52:57','2024-09-19 15:52:57',NULL,2,0,1),(182,NULL,'更新',NULL,'app\\controller\\WithdrawlController@update',143,'2024-09-19 15:52:57','2024-09-19 15:52:57',NULL,2,0,1),(183,NULL,'删除',NULL,'app\\controller\\WithdrawlController@delete',143,'2024-09-19 15:52:57','2024-09-19 15:52:57',NULL,2,0,1),(184,NULL,'multi',NULL,'app\\controller\\WithdrawlController@multi',143,'2024-09-19 15:52:57','2024-09-19 15:52:57',NULL,2,0,1),(210,NULL,'卡密管理','mdi mdi-code-equal','app\\controller\\CardController',64,'2024-09-27 17:17:51','2024-09-27 17:17:51','/card/index',1,NULL,0),(226,NULL,'clearCache',NULL,'app\\controller\\CardController@clearCache',210,'2024-09-27 17:17:56','2024-09-27 17:17:56',NULL,2,0,1),(227,NULL,'查询',NULL,'app\\controller\\CardController@select',210,'2024-09-27 17:17:56','2024-09-27 17:17:56',NULL,2,0,1),(228,NULL,'添加',NULL,'app\\controller\\CardController@insert',210,'2024-09-27 17:17:56','2024-09-27 17:17:56',NULL,2,0,1),(230,NULL,'更新',NULL,'app\\controller\\CardController@update',210,'2024-09-27 17:17:56','2024-09-27 17:17:56',NULL,2,0,1),(231,NULL,'删除',NULL,'app\\controller\\CardController@delete',210,'2024-09-27 17:17:56','2024-09-27 17:17:56',NULL,2,0,1),(232,NULL,'multi',NULL,'app\\controller\\CardController@multi',210,'2024-09-27 17:17:56','2024-09-27 17:17:56',NULL,2,0,1),(234,'target=\"_blank\"','openIM文档','mdi mdi-file-document-outline','docs',235,'2024-10-18 18:22:13','2025-11-21 06:57:30','https://doc.rentsoft.cn/zh-Hans/guides/gettingStarted/quickTestServer',1,0,1),(235,'','外部工具','mdi mdi-auto-fix','extend_tools',0,'2024-10-19 22:25:49','2024-10-30 13:05:32','',0,NULL,1),(236,'target=\"_blank\"','卡盟客服','mdi mdi-account-settings','kamengkefu',235,'2024-10-19 22:26:52','2024-10-30 13:04:57','http://kefu.xcdkey.net/admin/login/index/business_id/2.html',1,NULL,1),(237,NULL,'版本管理','mdi mdi-diversify','app\\controller\\VersionController',9,'2025-11-24 02:48:55','2025-11-24 02:51:34','version/index',1,0,1),(238,NULL,'邀请码','mdi mdi-microsoft-visual-studio-code','app\\controller\\InvitecodeController',65,'2025-11-24 02:52:48','2025-11-24 02:52:48','Invitecode/index',1,0,1),(239,NULL,'单页内容','mdi mdi-file-outline','app\\controller\\SinglePageController',64,'2025-11-24 02:59:44','2025-11-24 02:59:44','SinglePage/index',1,0,1),(240,NULL,'selectpage',NULL,'app\\controller\\AdminController@selectpage',4,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(241,NULL,'tree',NULL,'app\\controller\\AdminRoleController@tree',5,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(242,NULL,'selectpage',NULL,'app\\controller\\AdminRoleController@selectpage',5,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(243,NULL,'selectpage',NULL,'app\\controller\\AdminRuleController@selectpage',6,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(244,NULL,'selectpage',NULL,'app\\controller\\AccountController@selectpage',10,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(249,NULL,'selectpage',NULL,'app\\controller\\CategoryController@selectpage',63,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(250,NULL,'team',NULL,'app\\controller\\UserController@team',66,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(251,NULL,'selectpage',NULL,'app\\controller\\UserController@selectpage',66,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(252,NULL,'selectpage',NULL,'app\\controller\\UserRuleController@selectpage',67,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(253,NULL,'tree',NULL,'app\\controller\\UserRoleController@tree',68,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(254,NULL,'selectpage',NULL,'app\\controller\\UserRoleController@selectpage',68,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(255,NULL,'selectpage',NULL,'app\\controller\\BalanceLogController@selectpage',137,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(256,NULL,'selectpage',NULL,'app\\controller\\WithdrawlController@selectpage',143,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(257,NULL,'insert',NULL,'app\\controller\\ArticleController@insert',145,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(258,NULL,'编辑',NULL,'app\\controller\\ArticleController@update',145,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(259,NULL,'销毁',NULL,'app\\controller\\ArticleController@delete',145,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(260,NULL,'查询',NULL,'app\\controller\\ArticleController@select',145,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(261,NULL,'selectpage',NULL,'app\\controller\\ArticleController@selectpage',145,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(262,NULL,'批量操作',NULL,'app\\controller\\ArticleController@multi',145,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(263,NULL,'detail',NULL,'app\\controller\\CardController@detail',210,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(264,NULL,'export',NULL,'app\\controller\\CardController@export',210,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(265,NULL,'selectpage',NULL,'app\\controller\\CardController@selectpage',210,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(266,NULL,'查询',NULL,'app\\controller\\VersionController@select',237,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(267,NULL,'selectpage',NULL,'app\\controller\\VersionController@selectpage',237,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(268,NULL,'添加',NULL,'app\\controller\\VersionController@insert',237,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(269,NULL,'更新',NULL,'app\\controller\\VersionController@update',237,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(270,NULL,'删除',NULL,'app\\controller\\VersionController@delete',237,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(271,NULL,'批量操作',NULL,'app\\controller\\VersionController@multi',237,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(272,NULL,'查询',NULL,'app\\controller\\InvitecodeController@select',238,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(273,NULL,'selectpage',NULL,'app\\controller\\InvitecodeController@selectpage',238,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(274,NULL,'添加',NULL,'app\\controller\\InvitecodeController@insert',238,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(275,NULL,'更新',NULL,'app\\controller\\InvitecodeController@update',238,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(276,NULL,'删除',NULL,'app\\controller\\InvitecodeController@delete',238,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(277,NULL,'批量操作',NULL,'app\\controller\\InvitecodeController@multi',238,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(278,NULL,'insert',NULL,'app\\controller\\SinglePageController@insert',239,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(279,NULL,'编辑',NULL,'app\\controller\\SinglePageController@update',239,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(280,NULL,'销毁',NULL,'app\\controller\\SinglePageController@delete',239,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(281,NULL,'查询',NULL,'app\\controller\\SinglePageController@select',239,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(282,NULL,'selectpage',NULL,'app\\controller\\SinglePageController@selectpage',239,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(283,NULL,'批量操作',NULL,'app\\controller\\SinglePageController@multi',239,'2025-11-24 03:00:07','2025-11-24 03:00:07',NULL,2,0,1),(284,NULL,'套餐管理','mdi mdi-vimeo','app\\controller\\ThaliController',65,'2025-12-11 23:12:18','2025-12-11 23:12:49','thali/index',1,0,1),(285,NULL,'查询',NULL,'app\\controller\\ThaliController@select',284,'2025-12-11 23:12:27','2025-12-11 23:12:27',NULL,2,0,1),(286,NULL,'selectpage',NULL,'app\\controller\\ThaliController@selectpage',284,'2025-12-11 23:12:27','2025-12-11 23:12:27',NULL,2,0,1),(287,NULL,'添加',NULL,'app\\controller\\ThaliController@insert',284,'2025-12-11 23:12:27','2025-12-11 23:12:27',NULL,2,0,1),(288,NULL,'更新',NULL,'app\\controller\\ThaliController@update',284,'2025-12-11 23:12:27','2025-12-11 23:12:27',NULL,2,0,1),(289,NULL,'删除',NULL,'app\\controller\\ThaliController@delete',284,'2025-12-11 23:12:27','2025-12-11 23:12:27',NULL,2,0,1),(290,NULL,'批量操作',NULL,'app\\controller\\ThaliController@multi',284,'2025-12-11 23:12:27','2025-12-11 23:12:27',NULL,2,0,1); -/*!40000 ALTER TABLE `wa_admin_rule` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `wa_archives` --- - -DROP TABLE IF EXISTS `wa_archives`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `wa_archives` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `type` varchar(10) NOT NULL DEFAULT 'article', - `user_id` int unsigned NOT NULL DEFAULT '0' COMMENT '会员ID', - `category_id` int DEFAULT NULL COMMENT '分类ID', - `title` varchar(255) DEFAULT '' COMMENT '文章标题', - `name` varchar(255) NOT NULL COMMENT '标识', - `flag` varchar(100) DEFAULT '' COMMENT '标志', - `style` varchar(100) DEFAULT '' COMMENT '样式', - `image` varchar(255) DEFAULT '' COMMENT '缩略图', - `images` varchar(1500) DEFAULT '' COMMENT '组图', - `tags` varchar(255) DEFAULT '' COMMENT 'TAG', - `intro` text, - `weigh` int NOT NULL DEFAULT '0' COMMENT '权重', - `views` int unsigned NOT NULL DEFAULT '0' COMMENT '浏览次数', - `created_at` int DEFAULT NULL COMMENT '创建时间', - `updated_at` int DEFAULT NULL COMMENT '更新时间', - `publishtime` int DEFAULT NULL COMMENT '发布时间', - `deleted_at` int DEFAULT NULL COMMENT '删除时间', - `memo` varchar(100) DEFAULT '' COMMENT '备注', - `status` enum('normal','hidden','rejected','pulloff') NOT NULL DEFAULT 'normal' COMMENT '状态', - PRIMARY KEY (`id`), - KEY `weigh` (`weigh`,`publishtime`) -) ENGINE=InnoDB AUTO_INCREMENT=609 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='内容表'; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `wa_archives` - --- --- Table structure for table `wa_card` --- - -DROP TABLE IF EXISTS `wa_card`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `wa_card` ( - `id` int NOT NULL AUTO_INCREMENT, - `type` int DEFAULT NULL, - `title` varchar(64) NOT NULL, - `total` int NOT NULL DEFAULT '0', - `used` int DEFAULT '0', - `expires` int NOT NULL, - `days` int NOT NULL DEFAULT '0', - `status` tinyint(1) NOT NULL DEFAULT '1', - `created_at` int NOT NULL, - `updated_at` int DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `wa_card` --- - --- --- Table structure for table `wa_category` --- - -DROP TABLE IF EXISTS `wa_category`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `wa_category` ( - `id` int NOT NULL AUTO_INCREMENT, - `title` varchar(64) NOT NULL, - `type` varchar(10) DEFAULT NULL, - `status` tinyint(1) NOT NULL DEFAULT '1', - `created_at` int DEFAULT NULL, - `updated_at` int DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `wa_category` --- - -LOCK TABLES `wa_category` WRITE; -/*!40000 ALTER TABLE `wa_category` DISABLE KEYS */; -INSERT INTO `wa_category` VALUES (1,'默认分类','attachment',1,NULL,NULL),(9,'都','default',1,1726159162,1726233771),(10,'1726130385','default',1,1726159186,1726227844); -/*!40000 ALTER TABLE `wa_category` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `wa_cdkey` --- - -DROP TABLE IF EXISTS `wa_cdkey`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `wa_cdkey` ( - `id` int NOT NULL AUTO_INCREMENT, - `type` int DEFAULT NULL, - `category_id` int DEFAULT NULL, - `account` varchar(64) NOT NULL, - `passworrd` varchar(64) DEFAULT NULL, - `days` int DEFAULT '0', - `expires` int NOT NULL, - `is_used` tinyint(1) NOT NULL DEFAULT '0', - `record_id` int DEFAULT NULL, - `use_time` int DEFAULT NULL, - `status` tinyint(1) NOT NULL DEFAULT '1', - `created_at` int NOT NULL, - `updated_at` int DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `account` (`account`) -) ENGINE=InnoDB AUTO_INCREMENT=11314 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `wa_cdkey` --- - -LOCK TABLES `wa_cdkey` WRITE; -/*!40000 ALTER TABLE `wa_cdkey` DISABLE KEYS */; -/*!40000 ALTER TABLE `wa_cdkey` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `wa_config` --- - -DROP TABLE IF EXISTS `wa_config`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `wa_config` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(30) DEFAULT '' COMMENT '变量名', - `group` varchar(30) DEFAULT '' COMMENT '分组', - `title` varchar(100) DEFAULT '' COMMENT '变量标题', - `tip` varchar(100) DEFAULT '' COMMENT '变量描述', - `type` varchar(30) DEFAULT '' COMMENT '类型:string,text,int,bool,array,datetime,date,file', - `visible` varchar(255) DEFAULT '' COMMENT '可见条件', - `is_show` tinyint NOT NULL DEFAULT '1', - `value` text COMMENT '变量值', - `content` text COMMENT '变量字典数据', - `rule` varchar(100) DEFAULT '' COMMENT '验证规则', - `extend` varchar(255) DEFAULT '' COMMENT '扩展属性', - `setting` varchar(255) DEFAULT '' COMMENT '配置', - PRIMARY KEY (`id`), - UNIQUE KEY `name` (`name`) -) ENGINE=InnoDB AUTO_INCREMENT=50 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='系统配置'; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `wa_config` --- - -LOCK TABLES `wa_config` WRITE; -/*!40000 ALTER TABLE `wa_config` DISABLE KEYS */; -INSERT INTO `wa_config` VALUES (1,'name','basic','站点名称','请填写站点名称','string','',1,'瞬聊','','required','',NULL),(2,'beian','basic','备案号','粤ICP备15000000号-1','string','',1,'','','','',NULL),(3,'cdnurl','basic','CDN地址','如果全站静态资源使用第三方云储存请配置该值','string','',1,'','','','',''),(4,'version','basic','版本','如果静态资源有变动请重新配置该值','string','',1,'1.0.6','','required','',NULL),(5,'timezone','basic','时区','','string','',1,'Asia/Shanghai','','required','',NULL),(6,'forbiddenip','basic','禁止ip','一行一条记录','text','',1,'','','','',NULL),(7,'languages','basic','语言','','array','',1,'{\"backend\":\"zh-cn\",\"frontend\":\"zh-cn\"}','','required','',NULL),(8,'fixedpage','basic','首页','请输入左侧菜单栏存在的链接','string','',1,'dashboard','','required','',NULL),(9,'categorytype','dictionary','分类类型','','array','',1,'{\"default\":\"默认\",\"page\":\"单页\",\"article\":\"文章\",\"project\":\"项目\",\"help\":\"帮助\",\"attachment\":\"附件\"}','','','',NULL),(10,'configgroup','dictionary','配置类型','','array','',1,'{\"basic\":\"基础\",\"email\":\"邮件\",\"dictionary\":\"字典\",\"user\":\"会员\",\"upload\":\"上传\",\"app\":\"应用\"}','','','',NULL),(11,'mail_type','email','邮件发送方式','选择邮件发送方式','select','',1,'1','[\"请选择\",\"SMTP\"]','','',''),(12,'mail_smtp_host','email','SMTP服务器','错误的配置发送邮件会导致服务器超时','string','',1,'smtp.qq.com','','','',''),(13,'mail_smtp_port','email','SMTP端口','(不加密默认25,SSL默认465,TLS默认587)','string','',1,'465','','','',''),(14,'mail_smtp_user','email','SMTP用户','(填写完整用户名)','string','',1,'3357005342@qq.com','','','',''),(15,'mail_smtp_pass','email','SMTP密码','(填写您的密码或授权码)','password','',1,'olejdjccfdaacgjb','','','',''),(16,'mail_verify_type','email','SMTP验证方式','(SMTP验证方式[推荐SSL])','select','',1,'2','[\"无\",\"TLS\",\"SSL\"]','','',''),(17,'mail_from','email','发件地址','','string','',1,'3357005342@qq.com','','','',''),(18,'attachment_category','dictionary','附件类型','','array','',1,'{\"project\":\"项目\",\"category\":\"分类二\",\"custom\":\"自定义\"}','','','',NULL),(19,'flagtype','dictionary','项目标识','','array','',1,'{\r\n\"recommend\": \"推荐\",\r\n\"top\": \"置顶\",\r\n\"hot\": \"热门\"\r\n}','{\"value1\":\"title1\",\"value2\":\"title2\"}','','','{\"table\":\"\",\"conditions\":\"\",\"key\":\"\",\"value\":\"\"}'),(20,'admin_login_captcha','basic','后台登录验证码','','bool','',1,'0',NULL,'','',''),(21,'upload_url','upload','上传地址','','string','',1,'/app/admin/files/upload','value1|title1\r\nvalue2|title2','','','{\"table\":\"\",\"conditions\":\"\",\"key\":\"\",\"value\":\"\"}'),(24,'upload_multiple','upload','多个文件','','switch','',1,'1','value1|title1\r\nvalue2|title2','','','{\"table\":\"\",\"conditions\":\"\",\"key\":\"\",\"value\":\"\"}'),(25,'upload_previewtpl','upload','预览模板','','text','',1,'','value1|title1\r\nvalue2|title2','','','{\"table\":\"\",\"conditions\":\"\",\"key\":\"\",\"value\":\"\"}'),(26,'upload_timeout','upload','超时','单位:秒','number','',1,'3','value1|title1\r\nvalue2|title2','','','{\"table\":\"\",\"conditions\":\"\",\"key\":\"\",\"value\":\"\"}'),(27,'upload_mimetype','upload','上传类型','','text','',1,'image/jpeg,image/png,image/webp,image/gif','value1|title1\r\nvalue2|title2','','','{\"table\":\"\",\"conditions\":\"\",\"key\":\"\",\"value\":\"\"}'),(28,'upload_maxsize','upload','上传大小','单位M','number','',1,'10','value1|title1\r\nvalue2|title2','','','{\"table\":\"\",\"conditions\":\"\",\"key\":\"\",\"value\":\"\"}'),(31,'upload_thumbstyle','upload','缩略图样式','','string','',1,'','value1|title1\r\nvalue2|title2','','','{\"table\":\"\",\"conditions\":\"\",\"key\":\"\",\"value\":\"\"}'),(32,'withdrawl_minimum','user','最小提现金额','','number','',1,'0','value1|title1\r\nvalue2|title2','','','{\"table\":\"\",\"conditions\":\"\",\"key\":\"\",\"value\":\"\"}'),(33,'api_token','basic','客户端通讯密码','','string','',1,'muNcJyt0XXV6faCGe41VSIaf0ecZeW2jXmgpL0Ak93Kbwjyr','value1|title1\r\nvalue2|title2','','','{\"table\":\"\",\"conditions\":\"\",\"key\":\"\",\"value\":\"\"}'),(34,'reward_time_limit','app','多长时间内不允许获得两次奖励','','number','',1,'250','value1|title1\r\nvalue2|title2','','','{\"table\":\"\",\"conditions\":\"\",\"key\":\"\",\"value\":\"\"}'),(35,'withdrawl_fee','user','提现手续费','','array','',1,'{\"BEP-20\":\"2\",\"TRC-20\":\"3\"}','value1|title1\r\nvalue2|title2','','','{\"table\":\"\",\"conditions\":\"\",\"key\":\"\",\"value\":\"\"}'),(36,'client_version','app','客户端版本号','','string','',1,'2.08','value1|title1\r\nvalue2|title2','','','{\"table\":\"\",\"conditions\":\"\",\"key\":\"\",\"value\":\"\"}'),(37,'client_download_url','app','客户端下载链接','','string','',1,'https://baidu.com/app/admin','value1|title1\r\nvalue2|title2','','','{\"table\":\"\",\"conditions\":\"\",\"key\":\"\",\"value\":\"\"}'),(38,'cdkey_category','dictionary','激活碼分類','','array','',1,'{\"1\":\"首次激活码\",\"2\":\"測試激活码\",\"3\":\"续费激活码\"}','value1|title1\r\nvalue2|title2','','','{\"table\":\"\",\"conditions\":\"\",\"key\":\"\",\"value\":\"\"}'),(39,'user_group','user','用戶分組','','array','',1,'{\"0\":\"普通會員\",\"1\":\"測試用戶\",\"2\":\"測試用戶(已使用)\"}','value1|title1\r\nvalue2|title2','','','{\"table\":\"\",\"conditions\":\"\",\"key\":\"\",\"value\":\"\"}'),(40,'allow_currencys','user','启用货币','','selects','',1,'[\"money\",\"score\",\"currency9\"]','{\"money\":\"money\",\"score\":\"score\",\"currency1\":\"currency1\",\"currency2\":\"currency2\",\"currency3\":\"currency3\",\"currency4\":\"currency4\",\"currency5\":\"currency5\",\"currency6\":\"currency6\",\"currency7\":\"currency7\",\"currency8\":\"currency8\",\"currency9\":\"currency9\"}','required','','{\"table\":\"\",\"conditions\":\"\",\"key\":\"\",\"value\":\"\"}'),(41,'currency_langs','user','货币名称','','array','',1,'{\"money\":\"金币\",\"score\":\"积分\",\"currency1\":\"货币1\",\"currency2\":\"货币2\",\"currency3\":\"货币3\",\"currency4\":\"货币4\",\"currency5\":\"货币5\",\"currency6\":\"货币6\",\"currency7\":\"货币7\",\"currency8\":\"货币8\",\"currency9\":\"沉淀\"}','','required','','{\"table\":\"\",\"conditions\":\"\",\"key\":\"\",\"value\":\"\"}'),(42,'allow_currency_logs','user','启用货币日志','','selects','',1,'[\"money\",\"score\",\"currency9\"]','{\"money\":\"money\",\"score\":\"score\",\"currency1\":\"currency1\",\"currency2\":\"currency2\",\"currency3\":\"currency3\",\"currency4\":\"currency4\",\"currency5\":\"currency5\",\"currency6\":\"currency6\",\"currency7\":\"currency7\",\"currency8\":\"currency8\",\"currency9\":\"currency9\"}','required','','{\"table\":\"\",\"conditions\":\"\",\"key\":\"\",\"value\":\"\"}'),(45,'user_register_way','user','用户注册方式','','selects','',1,'[\"mobile\"]','{\"username\":\"用户名\",\"email\":\"邮箱\",\"mobile\":\"手机号\"}','required','','{\"table\":\"\",\"conditions\":\"\",\"key\":\"\",\"value\":\"\"}'),(46,'website','basic','官网地址','','string','',1,'http://156.238.245.175:8585','','url','','{\"table\":\"\",\"conditions\":\"\",\"key\":\"\",\"value\":\"\"}'),(47,'role_buy_open','user','购买会员开启','','switch','',1,'0','','','','{\"table\":\"\",\"conditions\":\"\",\"key\":\"\",\"value\":\"\"}'),(48,'near_user_open','app','附近的人','','switch','',1,'0','','','','{\"table\":\"\",\"conditions\":\"\",\"key\":\"\",\"value\":\"\"}'),(49,'app_logo','app','APP Logo','','image','',1,'','','required','','{\"table\":\"\",\"conditions\":\"\",\"key\":\"\",\"value\":\"\"}'); -/*!40000 ALTER TABLE `wa_config` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `wa_content` --- - -DROP TABLE IF EXISTS `wa_content`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `wa_content` ( - `id` int NOT NULL, - `content` longtext NOT NULL, - `content1` longtext, - `content2` longtext, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='内容'; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `wa_content` --- - --- --- Table structure for table `wa_files` --- - -DROP TABLE IF EXISTS `wa_files`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `wa_files` ( - `id` int NOT NULL AUTO_INCREMENT, - `category` varchar(20) COLLATE utf8mb4_general_ci NOT NULL, - `user_id` int DEFAULT NULL COMMENT '用户ID', - `title` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '本地文件名', - `path` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '保存路径', - `size` int DEFAULT NULL COMMENT '大小', - `mime_type` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'mime类型', - `extension` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '扩展名', - `height` int DEFAULT NULL COMMENT '图片高度', - `width` int DEFAULT NULL COMMENT 'tup宽度', - `sha1` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'sha1确定文件唯一性', - `use_count` int DEFAULT NULL COMMENT '关联次数', - `created_at` int DEFAULT NULL COMMENT '创建时间', - `updated_at` int DEFAULT NULL COMMENT '更新时间', - `deleted_at` int DEFAULT NULL COMMENT '删除时间', - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `wa_files` --- - --- --- Table structure for table `wa_friend_circle` --- - -DROP TABLE IF EXISTS `wa_friend_circle`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `wa_friend_circle` ( - `id` int NOT NULL AUTO_INCREMENT COMMENT '主键ID', - `user_id` int NOT NULL COMMENT '用户ID', - `releaseType` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `body` text COLLATE utf8mb4_unicode_ci COMMENT '内容', - `files` text COLLATE utf8mb4_unicode_ci COMMENT '图片列表(JSON)', - `address` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `like_count` int NOT NULL DEFAULT '0' COMMENT '点赞数', - `comment_count` int NOT NULL DEFAULT '0' COMMENT '评论数', - `created_at` int NOT NULL COMMENT '创建时间', - `updated_at` int NOT NULL COMMENT '更新时间', - `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态(0:隐藏 1:正常)', - PRIMARY KEY (`id`), - KEY `user_id` (`user_id`), - KEY `status` (`status`), - KEY `created_at` (`created_at`) -) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='朋友圈动态表'; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `wa_friend_circle` --- - --- --- Table structure for table `wa_friend_circle_comment` --- - -DROP TABLE IF EXISTS `wa_friend_circle_comment`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `wa_friend_circle_comment` ( - `id` int NOT NULL AUTO_INCREMENT COMMENT '主键ID', - `circle_id` int NOT NULL COMMENT '朋友圈动态ID', - `user_id` int NOT NULL COMMENT '用户ID', - `reply_user_id` int NOT NULL DEFAULT '0' COMMENT '回复的用户ID(0表示直接评论)', - `body` text COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '评论内容', - `created_at` int NOT NULL COMMENT '创建时间', - `updated_at` int NOT NULL COMMENT '更新时间', - `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态(0:隐藏 1:正常)', - PRIMARY KEY (`id`), - KEY `circle_id` (`circle_id`), - KEY `user_id` (`user_id`), - KEY `reply_user_id` (`reply_user_id`), - KEY `status` (`status`), - KEY `created_at` (`created_at`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='朋友圈评论表'; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `wa_friend_circle_comment` --- - --- --- Table structure for table `wa_friend_circle_like` --- - -DROP TABLE IF EXISTS `wa_friend_circle_like`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `wa_friend_circle_like` ( - `id` int NOT NULL AUTO_INCREMENT COMMENT '主键ID', - `circle_id` int NOT NULL COMMENT '朋友圈动态ID', - `user_id` int NOT NULL COMMENT '用户ID', - `created_at` int NOT NULL COMMENT '创建时间', - PRIMARY KEY (`id`), - UNIQUE KEY `circle_user` (`circle_id`,`user_id`), - KEY `circle_id` (`circle_id`), - KEY `user_id` (`user_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='朋友圈点赞表'; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `wa_friend_circle_like` --- - - --- --- Table structure for table `wa_thali` --- - -DROP TABLE IF EXISTS `wa_thali`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `wa_thali` ( - `id` int NOT NULL AUTO_INCREMENT COMMENT 'ID', - `title` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '名称', - `price` decimal(10,2) DEFAULT NULL COMMENT '价格', - `org_price` decimal(10,2) DEFAULT NULL COMMENT '原价', - `duration` int DEFAULT NULL COMMENT '时长', - `label` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '标签', - `created_at` int DEFAULT NULL COMMENT '创建时间', - `updated_at` int DEFAULT NULL COMMENT '更新时间', - `status` tinyint DEFAULT NULL COMMENT '状态', - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `wa_thali` --- - -LOCK TABLES `wa_thali` WRITE; -/*!40000 ALTER TABLE `wa_thali` DISABLE KEYS */; -INSERT INTO `wa_thali` VALUES (1,'VIP月卡',0.00,0.00,30,'',1765466400,1765466400,1),(2,'VIP季卡',150.00,300.00,30,'热门',1765466435,1765466435,1),(3,'VIP年卡',500.00,1200.00,30,'',1765466451,1765466451,1); -/*!40000 ALTER TABLE `wa_thali` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `wa_user` --- - -DROP TABLE IF EXISTS `wa_user`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `wa_user` ( - `id` mediumint NOT NULL AUTO_INCREMENT COMMENT '主键', - `role_id` int DEFAULT NULL, - `parent_id` int DEFAULT NULL, - `group_id` tinyint NOT NULL DEFAULT '0' COMMENT '用戶分組', - `username` varchar(32) NOT NULL COMMENT '用户名', - `nickname` varchar(40) NOT NULL COMMENT '昵称', - `password` varchar(255) NOT NULL COMMENT '密码', - `trade_password` varchar(64) DEFAULT NULL, - `sex` enum('0','1') NOT NULL DEFAULT '1' COMMENT '性别', - `avatar` varchar(255) DEFAULT NULL COMMENT '头像', - `email` varchar(128) DEFAULT NULL COMMENT '邮箱', - `region` varchar(6) DEFAULT NULL COMMENT '国家', - `mobile` varchar(16) DEFAULT NULL COMMENT '手机', - `level` tinyint DEFAULT '0' COMMENT '等级', - `birthday` date DEFAULT NULL COMMENT '生日', - `bio` varchar(255) DEFAULT NULL, - `money` decimal(20,10) DEFAULT '0.0000000000' COMMENT '余额(元)', - `score` int DEFAULT '0' COMMENT '积分', - `currency1` decimal(20,10) NOT NULL DEFAULT '0.0000000000', - `currency2` decimal(20,10) NOT NULL DEFAULT '0.0000000000', - `currency3` decimal(20,10) NOT NULL DEFAULT '0.0000000000', - `currency4` decimal(20,10) NOT NULL DEFAULT '0.0000000000', - `currency5` decimal(20,10) NOT NULL DEFAULT '0.0000000000', - `currency6` decimal(20,10) NOT NULL DEFAULT '0.0000000000', - `currency7` decimal(20,10) NOT NULL DEFAULT '0.0000000000', - `currency8` decimal(20,10) NOT NULL DEFAULT '0.0000000000', - `currency9` decimal(20,10) NOT NULL DEFAULT '0.0000000000', - `maxsuccessions` tinyint NOT NULL DEFAULT '0', - `successions` tinyint NOT NULL DEFAULT '0', - `loginfailure` tinyint NOT NULL DEFAULT '0', - `prev_time` int DEFAULT NULL, - `last_time` int DEFAULT NULL COMMENT '登录时间', - `last_ip` varchar(50) DEFAULT NULL COMMENT '登录ip', - `join_time` int DEFAULT NULL COMMENT '注册时间', - `join_ip` varchar(50) DEFAULT NULL COMMENT '注册ip', - `token` varchar(50) DEFAULT NULL COMMENT 'token', - `invite_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, - `expire_at` int NOT NULL COMMENT '过期时间', - `status` tinyint NOT NULL DEFAULT '0' COMMENT '禁用', - `created_at` int DEFAULT NULL, - `updated_at` int DEFAULT NULL, - `deleted_at` int DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `username` (`username`), - KEY `join_time` (`join_time`), - KEY `mobile` (`mobile`), - KEY `email` (`email`) -) ENGINE=InnoDB AUTO_INCREMENT=100006 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户表'; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `wa_user` --- - -LOCK TABLES `wa_user` WRITE; -/*!40000 ALTER TABLE `wa_user` DISABLE KEYS */; -INSERT INTO `wa_user` VALUES (100001,0,NULL,0,'test1@msn.cn','test1@msn.cn','$2y$10$6VwCibrAp6cdZES.aeLLDuzEOHazjhgxUM3qqs.MdL9b47Haky/pq',NULL,'1','/static/img/avatar.png','test1@msn.cn',NULL,'',1,NULL,NULL,0.0000000000,0,0.0000000000,0.0000000000,0.0000000000,0.0000000000,0.0000000000,0.0000000000,0.0000000000,0.0000000000,0.0000000000,0,0,0,NULL,1763927350,'110.186.65.88',1763917306,'110.186.65.88',NULL,'GZPDLVKF',0,0,1,1763917306,1763927350,NULL),(100002,0,NULL,0,'commiu@outlook.com','commiu@outlook.com','$2y$10$cUHJFg5AHj6sKkHef6oFWustFfQvm9LEEsW3OsqfMe0/cIULQA..W',NULL,'1','/static/img/avatar.png','commiu@outlook.com',NULL,'',1,NULL,NULL,0.0000000000,0,0.0000000000,0.0000000000,0.0000000000,0.0000000000,0.0000000000,0.0000000000,0.0000000000,0.0000000000,0.0000000000,0,0,0,NULL,1764036242,'139.202.158.3',1763922665,'110.186.65.88',NULL,'PAWETWXE',0,0,1,1763922665,1764036242,NULL),(100003,0,NULL,0,'13122222222','2222','$2y$10$z1A0YO7z9lMX04izHmSBAeDmZEcq0nth4WiCD44jn7P22EgwvLe8S',NULL,'1','http://www.axzc.xyz/object/100003/1766513249197_plus_logo_web_2.png',NULL,'86','13122222222',1,NULL,NULL,0.0000000000,0,0.0000000000,0.0000000000,0.0000000000,0.0000000000,0.0000000000,0.0000000000,0.0000000000,0.0000000000,0.0000000000,0,0,0,NULL,1766420177,'139.202.182.54',1764100199,'139.202.158.3',NULL,'WBDFAQSL',0,0,1,1764100199,1766513581,NULL),(100004,0,NULL,0,'13111111111','131****1111','$2y$10$Ms2ebedLNYPPqQpDN1QJq.yNIn4zccMDUcaPOrcSd8gF1kYcaywOe',NULL,'1','/static/img/avatar.png',NULL,'86','13111111111',1,NULL,NULL,0.0000000000,0,0.0000000000,0.0000000000,0.0000000000,0.0000000000,0.0000000000,0.0000000000,0.0000000000,0.0000000000,0.0000000000,0,0,0,NULL,1764361116,'139.202.158.3',1764102825,'139.202.158.3',NULL,'DCLGHRES',0,0,1,1764102825,1764361116,NULL),(100005,2,NULL,0,'13144444444','131****4444','$2y$10$gDt3UNa0uDlmiKNVQVLkQuC9t/J.dIw5kdEm2m72RMMez5k1ergVa',NULL,'1','/static/img/avatar.png','','86','13144444444',1,'2025-12-22',NULL,0.0000000000,0,0.0000000000,0.0000000000,0.0000000000,0.0000000000,0.0000000000,0.0000000000,0.0000000000,0.0000000000,0.0000000000,0,0,0,NULL,1766416624,'39.144.144.0',1764102974,'139.202.158.3',NULL,'LDTHQKSY',0,1766332800,1,1764102974,1766416624,NULL); -/*!40000 ALTER TABLE `wa_user` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `wa_user_extend` --- - -DROP TABLE IF EXISTS `wa_user_extend`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `wa_user_extend` ( - `user_id` int NOT NULL, - `direct_total` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL, - `team_total` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL, - `consume` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL, - `sales` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL, - PRIMARY KEY (`user_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `wa_user_extend` --- - -LOCK TABLES `wa_user_extend` WRITE; -/*!40000 ALTER TABLE `wa_user_extend` DISABLE KEYS */; -INSERT INTO `wa_user_extend` VALUES (100000,'0','0','0','0'),(100001,'0','0','0','0'),(100002,'0','0','0','0'),(100003,'0','0','0','0'),(100004,'0','0','0','0'),(100005,'0','0','0','0'); -/*!40000 ALTER TABLE `wa_user_extend` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `wa_user_role` --- - -DROP TABLE IF EXISTS `wa_user_role`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `wa_user_role` ( - `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', - `pid` int unsigned DEFAULT NULL COMMENT '父级', - `name` varchar(80) NOT NULL COMMENT '角色组', - `rules` text COMMENT '权限', - `max_send_msg_count` int DEFAULT NULL COMMENT '最大消息数量', - `max_friend_count` int DEFAULT NULL COMMENT '最大好友数量', - `max_group_join_count` int DEFAULT NULL COMMENT '最大加入的群组数量', - `max_gourp_create_count` int DEFAULT NULL COMMENT '最大创建的群组数量', - `created_at` int DEFAULT NULL COMMENT '创建时间', - `updated_at` int DEFAULT NULL COMMENT '更新时间', - `status` tinyint DEFAULT NULL COMMENT '状态', - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='管理员角色'; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `wa_user_role` --- - -LOCK TABLES `wa_user_role` WRITE; -/*!40000 ALTER TABLE `wa_user_role` DISABLE KEYS */; -INSERT INTO `wa_user_role` VALUES (1,NULL,'普通用户','*',NULL,NULL,NULL,NULL,1660407301,1671797107,NULL),(2,0,'VIP','*',NULL,NULL,NULL,NULL,1765465778,1765465778,NULL); -/*!40000 ALTER TABLE `wa_user_role` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `wa_user_rule` --- - -DROP TABLE IF EXISTS `wa_user_rule`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `wa_user_rule` ( - `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', - `title` varchar(255) NOT NULL COMMENT '标题', - `icon` varchar(255) DEFAULT NULL COMMENT '图标', - `key` varchar(255) NOT NULL COMMENT '标识', - `pid` int unsigned DEFAULT '0' COMMENT '上级菜单', - `created_at` int DEFAULT NULL, - `updated_at` int DEFAULT NULL, - `href` varchar(255) DEFAULT NULL COMMENT 'url', - `type` int NOT NULL DEFAULT '1' COMMENT '类型', - `weight` int DEFAULT '0' COMMENT '排序', - `status` tinyint(1) NOT NULL DEFAULT '1', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='权限规则'; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `wa_user_team` --- - -DROP TABLE IF EXISTS `wa_user_team`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `wa_user_team` ( - `descendant_id` int NOT NULL, - `ancestor_id` int NOT NULL, - `depth` int DEFAULT NULL, - `status` tinyint DEFAULT '0' -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `wa_user_team` --- - --- --- Table structure for table `wa_version` --- - -DROP TABLE IF EXISTS `wa_version`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `wa_version` ( - `id` int NOT NULL, - `type` tinyint DEFAULT '2', - `platform` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL, - `version` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL, - `version_wgt` int DEFAULT NULL, - `content` text COLLATE utf8mb4_general_ci, - `force` tinyint DEFAULT NULL, - `source` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL, - `status` tinyint DEFAULT '1', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `wa_version` --- - -LOCK TABLES `wa_version` WRITE; -/*!40000 ALTER TABLE `wa_version` DISABLE KEYS */; -/*!40000 ALTER TABLE `wa_version` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `wa_withdrawl` --- - -DROP TABLE IF EXISTS `wa_withdrawl`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `wa_withdrawl` ( - `id` int NOT NULL AUTO_INCREMENT, - `user_id` int NOT NULL DEFAULT '0', - `deduction_amount` decimal(20,10) DEFAULT '0.0000000000', - `recive_amount` decimal(20,10) NOT NULL DEFAULT '0.0000000000', - `fee` decimal(20,10) NOT NULL DEFAULT '0.0000000000', - `created_at` int DEFAULT NULL, - `updated_at` int DEFAULT NULL, - `network` varchar(10) DEFAULT NULL, - `address` varchar(80) DEFAULT NULL, - `status` tinyint(1) NOT NULL DEFAULT '0', - `memo` varchar(200) DEFAULT NULL, - `transfer_at` int DEFAULT NULL, - `txid` varchar(100) DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `user_id` (`user_id`) -) ENGINE=InnoDB AUTO_INCREMENT=1120 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping events for database 'imadmin' --- - --- --- Dumping routines for database 'imadmin' --- -/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; - -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; - --- Dump completed on 2025-12-24 5:43:14 diff --git a/database/friend_circle_tables.sql b/database/friend_circle_tables.sql deleted file mode 100755 index a105674..0000000 --- a/database/friend_circle_tables.sql +++ /dev/null @@ -1,49 +0,0 @@ --- 朋友圈功能数据库表结构 - --- 朋友圈动态表 -CREATE TABLE IF NOT EXISTS `friend_circle` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键ID', - `user_id` int(11) NOT NULL COMMENT '用户ID', - `body` text COMMENT '内容', - `files` text COMMENT '图片列表(JSON)', - `like_count` int(11) NOT NULL DEFAULT '0' COMMENT '点赞数', - `comment_count` int(11) NOT NULL DEFAULT '0' COMMENT '评论数', - `created_at` int(11) NOT NULL COMMENT '创建时间', - `updated_at` int(11) NOT NULL COMMENT '更新时间', - `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态(0:隐藏 1:正常)', - PRIMARY KEY (`id`), - KEY `user_id` (`user_id`), - KEY `status` (`status`), - KEY `created_at` (`created_at`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='朋友圈动态表'; - --- 朋友圈点赞表 -CREATE TABLE IF NOT EXISTS `friend_circle_like` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键ID', - `circle_id` int(11) NOT NULL COMMENT '朋友圈动态ID', - `user_id` int(11) NOT NULL COMMENT '用户ID', - `created_at` int(11) NOT NULL COMMENT '创建时间', - PRIMARY KEY (`id`), - UNIQUE KEY `circle_user` (`circle_id`,`user_id`), - KEY `circle_id` (`circle_id`), - KEY `user_id` (`user_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='朋友圈点赞表'; - --- 朋友圈评论表 -CREATE TABLE IF NOT EXISTS `friend_circle_comment` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键ID', - `circle_id` int(11) NOT NULL COMMENT '朋友圈动态ID', - `user_id` int(11) NOT NULL COMMENT '用户ID', - `reply_user_id` int(11) NOT NULL DEFAULT '0' COMMENT '回复的用户ID(0表示直接评论)', - `body` text NOT NULL COMMENT '评论内容', - `created_at` int(11) NOT NULL COMMENT '创建时间', - `updated_at` int(11) NOT NULL COMMENT '更新时间', - `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态(0:隐藏 1:正常)', - PRIMARY KEY (`id`), - KEY `circle_id` (`circle_id`), - KEY `user_id` (`user_id`), - KEY `reply_user_id` (`reply_user_id`), - KEY `status` (`status`), - KEY `created_at` (`created_at`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='朋友圈评论表'; - diff --git a/database/mysql.zip b/database/mysql.zip new file mode 100644 index 0000000..0c158c1 Binary files /dev/null and b/database/mysql.zip differ diff --git a/plugin/admin/app/controller/FilesController.php b/plugin/admin/app/controller/FilesController.php index f0a16f2..52903ce 100755 --- a/plugin/admin/app/controller/FilesController.php +++ b/plugin/admin/app/controller/FilesController.php @@ -6,7 +6,7 @@ use Exception; use support\Request; use support\Response; use support\think\Db; -use taoser\facade\Validate; +use Tinywan\Validate\Facade\Validate; use Shopwwi\WebmanFilesystem\Facade\Storage; /** diff --git a/public/.user.ini b/public/.user.ini deleted file mode 100755 index a89eb12..0000000 --- a/public/.user.ini +++ /dev/null @@ -1 +0,0 @@ -open_basedir=/www/wwwroot/openim/admin/:/tmp/ \ No newline at end of file diff --git a/readme.md b/readme.md index a7d1688..23ab85b 100755 --- a/readme.md +++ b/readme.md @@ -70,5 +70,12 @@ docker run -p 3306:3306 \ 7b0fa3686a4f0adf SELECT * FROM information_schema.`INNODB_TRX`; ``` +docker compose up -d +docker compose --profile m up -d +go env -w GO111MODULE=on +go env -w GOPROXY=https://goproxy.cn,direct - +bash bootstrap.sh +mage +mage start +docker exec -it mongo mongorestore --uri="mongodb://openIM:n1e5a6s6m7@172.18.0.1:37017/openim_v3" /data/backup/3/openim_v3 diff --git a/resource/translations/zh-Hans/api/common.php b/resource/translations/zh-Hans/api/common.php index 146f978..bda2a27 100755 --- a/resource/translations/zh-Hans/api/common.php +++ b/resource/translations/zh-Hans/api/common.php @@ -1,19 +1,20 @@ '邮箱地址不正确', - 'Mobile is incorrect' => '手机号不正确', - 'Invalid trade password' => '交易密码无效', - 'Invalid invite code' => '无效邀请码', - 'Sign up successful' => '注册成功', - 'Invalid username or password' => '无效的用户名或密码', - 'Password must be 6 to 30 characters' => '密码长度为6 ~ 30个字符', - 'Trade password must be 6 characters' => '交易密码长度为6个字符', - 'User not found' => '未找到用户', - 'Reset password successful' => '重置密码成功', - 'Reset Trade password successful' => '重置交易密码成功', - 'Only one verification code can be sent within %second% seconds' => '在%秒%秒内只能发送一个验证码', - 'Email sent successfully' => '邮件发送成功', - 'Mt email code' => 'Mt email code', - '错误的邀请码' => '错误的邀请码', - 'Incoret param' => 'Incoret param', +return array( + "Account is incorrect" => "账号不正确", + 'Email is incorrect' => '邮箱地址不正确', + 'Mobile is incorrect' => '手机号不正确', + 'Invalid trade password' => '交易密码无效', + 'Invalid invite code' => '无效邀请码', + 'Sign up successful' => '注册成功', + 'Invalid username or password' => '无效的用户名或密码', + 'Password must be 6 to 30 characters' => '密码长度为6 ~ 30个字符', + 'Trade password must be 6 characters' => '交易密码长度为6个字符', + 'User not found' => '未找到用户', + 'Reset password successful' => '重置密码成功', + 'Reset Trade password successful' => '重置交易密码成功', + 'Only one verification code can be sent within %second% seconds' => '在%秒%秒内只能发送一个验证码', + 'Email sent successfully' => '邮件发送成功', + 'Mt email code' => 'Mt email code', + '错误的邀请码' => '错误的邀请码', + 'Incoret param' => 'Incoret param', ); \ No newline at end of file diff --git a/resource/translations/zh-Hans/messages.php b/resource/translations/zh-Hans/messages.php index a439575..8b7cc95 100755 --- a/resource/translations/zh-Hans/messages.php +++ b/resource/translations/zh-Hans/messages.php @@ -1,6 +1,7 @@ app; +$request = Request(); +$app = $request->app; $controller =get_controller_name(); $langs = []; $fn= __DIR__.'/'.($app?$app.'/' : '').strtolower($controller).'.php'; @@ -10,4 +11,5 @@ if(file_exists($fn)){ $langs = []; } } -return array_merge($common,$langs); \ No newline at end of file +$res = array_merge($common,$langs); +return $res; \ No newline at end of file diff --git a/resource/translations/zh/api/address.php b/resource/translations/zh-Hant/api/address.php old mode 100755 new mode 100644 similarity index 100% rename from resource/translations/zh/api/address.php rename to resource/translations/zh-Hant/api/address.php diff --git a/resource/translations/zh/api/article.php b/resource/translations/zh-Hant/api/article.php old mode 100755 new mode 100644 similarity index 100% rename from resource/translations/zh/api/article.php rename to resource/translations/zh-Hant/api/article.php diff --git a/resource/translations/zh/api/balancelog.php b/resource/translations/zh-Hant/api/balancelog.php old mode 100755 new mode 100644 similarity index 100% rename from resource/translations/zh/api/balancelog.php rename to resource/translations/zh-Hant/api/balancelog.php diff --git a/resource/translations/zh/api/base.php b/resource/translations/zh-Hant/api/base.php old mode 100755 new mode 100644 similarity index 100% rename from resource/translations/zh/api/base.php rename to resource/translations/zh-Hant/api/base.php diff --git a/resource/translations/zh/api/card.php b/resource/translations/zh-Hant/api/card.php old mode 100755 new mode 100644 similarity index 100% rename from resource/translations/zh/api/card.php rename to resource/translations/zh-Hant/api/card.php diff --git a/resource/translations/zh/api/chat.php b/resource/translations/zh-Hant/api/chat.php old mode 100755 new mode 100644 similarity index 100% rename from resource/translations/zh/api/chat.php rename to resource/translations/zh-Hant/api/chat.php diff --git a/resource/translations/zh/api/common.php b/resource/translations/zh-Hant/api/common.php old mode 100755 new mode 100644 similarity index 100% rename from resource/translations/zh/api/common.php rename to resource/translations/zh-Hant/api/common.php diff --git a/resource/translations/zh/api/gift.php b/resource/translations/zh-Hant/api/gift.php old mode 100755 new mode 100644 similarity index 100% rename from resource/translations/zh/api/gift.php rename to resource/translations/zh-Hant/api/gift.php diff --git a/resource/translations/zh/api/index.php b/resource/translations/zh-Hant/api/index.php old mode 100755 new mode 100644 similarity index 100% rename from resource/translations/zh/api/index.php rename to resource/translations/zh-Hant/api/index.php diff --git a/resource/translations/zh/api/product.php b/resource/translations/zh-Hant/api/product.php old mode 100755 new mode 100644 similarity index 100% rename from resource/translations/zh/api/product.php rename to resource/translations/zh-Hant/api/product.php diff --git a/resource/translations/zh/api/productorder.php b/resource/translations/zh-Hant/api/productorder.php old mode 100755 new mode 100644 similarity index 100% rename from resource/translations/zh/api/productorder.php rename to resource/translations/zh-Hant/api/productorder.php diff --git a/resource/translations/zh/api/questionnaire.php b/resource/translations/zh-Hant/api/questionnaire.php old mode 100755 new mode 100644 similarity index 100% rename from resource/translations/zh/api/questionnaire.php rename to resource/translations/zh-Hant/api/questionnaire.php diff --git a/resource/translations/zh/api/recharge.php b/resource/translations/zh-Hant/api/recharge.php old mode 100755 new mode 100644 similarity index 100% rename from resource/translations/zh/api/recharge.php rename to resource/translations/zh-Hant/api/recharge.php diff --git a/resource/translations/zh/api/role.php b/resource/translations/zh-Hant/api/role.php old mode 100755 new mode 100644 similarity index 100% rename from resource/translations/zh/api/role.php rename to resource/translations/zh-Hant/api/role.php diff --git a/resource/translations/zh/api/server.php b/resource/translations/zh-Hant/api/server.php old mode 100755 new mode 100644 similarity index 100% rename from resource/translations/zh/api/server.php rename to resource/translations/zh-Hant/api/server.php diff --git a/resource/translations/zh/api/signin.php b/resource/translations/zh-Hant/api/signin.php old mode 100755 new mode 100644 similarity index 100% rename from resource/translations/zh/api/signin.php rename to resource/translations/zh-Hant/api/signin.php diff --git a/resource/translations/zh/api/team.php b/resource/translations/zh-Hant/api/team.php old mode 100755 new mode 100644 similarity index 100% rename from resource/translations/zh/api/team.php rename to resource/translations/zh-Hant/api/team.php diff --git a/resource/translations/zh/api/user.php b/resource/translations/zh-Hant/api/user.php old mode 100755 new mode 100644 similarity index 100% rename from resource/translations/zh/api/user.php rename to resource/translations/zh-Hant/api/user.php diff --git a/resource/translations/zh/api/v4.php b/resource/translations/zh-Hant/api/v4.php old mode 100755 new mode 100644 similarity index 100% rename from resource/translations/zh/api/v4.php rename to resource/translations/zh-Hant/api/v4.php diff --git a/resource/translations/zh/api/validate.php b/resource/translations/zh-Hant/api/validate.php old mode 100755 new mode 100644 similarity index 100% rename from resource/translations/zh/api/validate.php rename to resource/translations/zh-Hant/api/validate.php diff --git a/resource/translations/zh/api/wallet.php b/resource/translations/zh-Hant/api/wallet.php old mode 100755 new mode 100644 similarity index 100% rename from resource/translations/zh/api/wallet.php rename to resource/translations/zh-Hant/api/wallet.php diff --git a/resource/translations/zh/api/withdrawl.php b/resource/translations/zh-Hant/api/withdrawl.php old mode 100755 new mode 100644 similarity index 100% rename from resource/translations/zh/api/withdrawl.php rename to resource/translations/zh-Hant/api/withdrawl.php diff --git a/resource/translations/zh/base.php b/resource/translations/zh-Hant/base.php old mode 100755 new mode 100644 similarity index 100% rename from resource/translations/zh/base.php rename to resource/translations/zh-Hant/base.php diff --git a/resource/translations/zh/common.php b/resource/translations/zh-Hant/common.php old mode 100755 new mode 100644 similarity index 100% rename from resource/translations/zh/common.php rename to resource/translations/zh-Hant/common.php diff --git a/resource/translations/zh/crud.php b/resource/translations/zh-Hant/crud.php old mode 100755 new mode 100644 similarity index 100% rename from resource/translations/zh/crud.php rename to resource/translations/zh-Hant/crud.php diff --git a/resource/translations/zh/doc.php b/resource/translations/zh-Hant/doc.php old mode 100755 new mode 100644 similarity index 100% rename from resource/translations/zh/doc.php rename to resource/translations/zh-Hant/doc.php diff --git a/resource/translations/zh/git.php b/resource/translations/zh-Hant/git.php old mode 100755 new mode 100644 similarity index 100% rename from resource/translations/zh/git.php rename to resource/translations/zh-Hant/git.php diff --git a/resource/translations/zh/index.php b/resource/translations/zh-Hant/index.php old mode 100755 new mode 100644 similarity index 100% rename from resource/translations/zh/index.php rename to resource/translations/zh-Hant/index.php diff --git a/resource/translations/zh/messages.php b/resource/translations/zh-Hant/messages.php old mode 100755 new mode 100644 similarity index 100% rename from resource/translations/zh/messages.php rename to resource/translations/zh-Hant/messages.php diff --git a/resource/translations/zh/pay.php b/resource/translations/zh-Hant/pay.php old mode 100755 new mode 100644 similarity index 100% rename from resource/translations/zh/pay.php rename to resource/translations/zh-Hant/pay.php diff --git a/resource/translations/zh/testproductbuy.php b/resource/translations/zh-Hant/testproductbuy.php old mode 100755 new mode 100644 similarity index 100% rename from resource/translations/zh/testproductbuy.php rename to resource/translations/zh-Hant/testproductbuy.php diff --git a/resource/translations/zh/testrolebuy.php b/resource/translations/zh-Hant/testrolebuy.php old mode 100755 new mode 100644 similarity index 100% rename from resource/translations/zh/testrolebuy.php rename to resource/translations/zh-Hant/testrolebuy.php diff --git a/resource/translations/zh/utils.php b/resource/translations/zh-Hant/utils.php old mode 100755 new mode 100644 similarity index 100% rename from resource/translations/zh/utils.php rename to resource/translations/zh-Hant/utils.php diff --git a/resource/translations/en/validate.php b/resource/translations/zh-Hant/validate.php old mode 100755 new mode 100644 similarity index 100% rename from resource/translations/en/validate.php rename to resource/translations/zh-Hant/validate.php diff --git a/resource/translations/zh/validate.php b/resource/translations/zh/validate.php deleted file mode 100755 index 0388859..0000000 --- a/resource/translations/zh/validate.php +++ /dev/null @@ -1,147 +0,0 @@ - -// +---------------------------------------------------------------------- - -// 核心中文语言包 -return [ - // 系统错误提示 - 'Undefined variable' => '未定义变量', - 'Undefined index' => '未定义数组索引', - 'Undefined offset' => '未定义数组下标', - 'Parse error' => '语法解析错误', - 'Type error' => '类型错误', - 'Fatal error' => '致命错误', - 'syntax error' => '语法错误', - - // 框架核心错误提示 - 'dispatch type not support' => '不支持的调度类型', - 'method param miss' => '方法参数错误', - 'method not exists' => '方法不存在', - 'function not exists' => '函数不存在', - 'app not exists' => '应用不存在', - 'controller not exists' => '控制器不存在', - 'class not exists' => '类不存在', - 'property not exists' => '类的属性不存在', - 'template not exists' => '模板文件不存在', - 'illegal controller name' => '非法的控制器名称', - 'illegal action name' => '非法的操作名称', - 'url suffix deny' => '禁止的URL后缀访问', - 'Undefined cache config' => '缓存配置未定义', - 'Route Not Found' => '当前访问路由未定义或不匹配', - 'Undefined db config' => '数据库配置未定义', - 'Undefined log config' => '日志配置未定义', - 'Undefined db type' => '未定义数据库类型', - 'variable type error' => '变量类型错误', - 'PSR-4 error' => 'PSR-4 规范错误', - 'not support type' => '不支持的分页索引字段类型', - 'not support total' => '简洁模式下不能获取数据总数', - 'not support last' => '简洁模式下不能获取最后一页', - 'error session handler' => '错误的SESSION处理器类', - 'not allow php tag' => '模板不允许使用PHP语法', - 'not support' => '不支持', - 'database config error' => '数据库配置信息错误', - 'redisd master' => 'Redisd 主服务器错误', - 'redisd slave' => 'Redisd 从服务器错误', - 'must run at sae' => '必须在SAE运行', - 'memcache init error' => '未开通Memcache服务,请在SAE管理平台初始化Memcache服务', - 'KVDB init error' => '没有初始化KVDB,请在SAE管理平台初始化KVDB服务', - 'fields not exists' => '数据表字段不存在', - 'where express error' => '查询表达式错误', - 'no data to update' => '没有任何数据需要更新', - 'miss data to insert' => '缺少需要写入的数据', - 'miss complex primary data' => '缺少复合主键数据', - 'miss update condition' => '缺少更新条件', - 'model data Not Found' => '模型数据不存在', - 'table data not Found' => '表数据不存在', - 'delete without condition' => '没有条件不会执行删除操作', - 'miss relation data' => '缺少关联表数据', - 'tag attr must' => '模板标签属性必须', - 'tag error' => '模板标签错误', - 'cache write error' => '缓存写入失败', - 'sae mc write error' => 'SAE mc 写入错误', - 'route name not exists' => '路由标识不存在(或参数不够)', - 'invalid request' => '非法请求', - 'bind attr has exists' => '模型的属性已经存在', - 'relation data not exists' => '关联数据不存在', - 'relation not support' => '关联不支持', - 'chunk not support order' => 'Chunk不支持调用order方法', - 'route pattern error' => '路由变量规则定义错误', - 'route behavior will not support' => '路由行为废弃(使用中间件替代)', - 'closure not support cache(true);' => '使用闭包查询不支持cache(true);,请指定缓存Key', - - // 上传错误信息 - 'unknown upload error' => '未知上传错误!', - 'file write error' => '文件写入失败!', - 'upload temp dir not found' => '找不到临时文件夹!', - 'no file to uploaded' => '没有文件被上传!', - 'only the portion of file is uploaded' => '文件只有部分被上传!', - 'upload File size exceeds the maximum value' => '上传文件大小超过了最大值!', - 'upload write error' => '文件上传保存错误!', - 'has the same filename: {:filename}' => '存在同名文件:{:filename}', - 'upload illegal files' => '非法上传文件', - 'illegal image files' => '非法图片文件', - 'extensions to upload is not allowed' => '上传文件后缀不允许', - 'mimetype to upload is not allowed' => '上传文件MIME类型不允许!', - 'filesize not match' => '上传文件大小不符!', - 'directory {:path} creation failed' => '目录 {:path} 创建失败!', - - 'The middleware must return Response instance' => '中间件方法必须返回Response对象实例', - 'The queue was exhausted, with no response returned' => '中间件队列为空', - // Validate Error Message - ':attribute require' => ':attribute不能为空', - ':attribute must' => ':attribute必须', - ':attribute must be numeric' => ':attribute必须是数字', - ':attribute must be integer' => ':attribute必须是整数', - ':attribute must be float' => ':attribute必须是浮点数', - ':attribute must be bool' => ':attribute必须是布尔值', - ':attribute not a valid email address' => ':attribute格式不符', - ':attribute not a valid mobile' => ':attribute格式不符', - ':attribute must be a array' => ':attribute必须是数组', - ':attribute must be yes,on or 1' => ':attribute必须是yes、on或者1', - ':attribute not a valid datetime' => ':attribute不是一个有效的日期或时间格式', - ':attribute not a valid file' => ':attribute不是有效的上传文件', - ':attribute not a valid image' => ':attribute不是有效的图像文件', - ':attribute must be alpha' => ':attribute只能是字母', - ':attribute must be alpha-numeric' => ':attribute只能是字母和数字', - ':attribute must be alpha-numeric, dash, underscore' => ':attribute只能是字母、数字和下划线_及破折号-', - ':attribute not a valid domain or ip' => ':attribute不是有效的域名或者IP', - ':attribute must be chinese' => ':attribute只能是汉字', - ':attribute must be chinese or alpha' => ':attribute只能是汉字、字母', - ':attribute must be chinese,alpha-numeric' => ':attribute只能是汉字、字母和数字', - ':attribute must be chinese,alpha-numeric,underscore, dash' => ':attribute只能是汉字、字母、数字和下划线_及破折号-', - ':attribute not a valid url' => ':attribute不是有效的URL地址', - ':attribute not a valid ip' => ':attribute不是有效的IP地址', - ':attribute must be dateFormat of :rule' => ':attribute必须使用日期格式 :rule', - ':attribute must be in :rule' => ':attribute必须在 :rule 范围内', - ':attribute be notin :rule' => ':attribute不能在 :rule 范围内', - ':attribute must between :1 - :2' => ':attribute只能在 :1 - :2 之间', - ':attribute not between :1 - :2' => ':attribute不能在 :1 - :2 之间', - 'size of :attribute must be :rule' => ':attribute长度不符合要求 :rule', - 'max size of :attribute must be :rule' => ':attribute长度不能超过 :rule', - 'min size of :attribute must be :rule' => ':attribute长度不能小于 :rule', - ':attribute cannot be less than :rule' => ':attribute日期不能小于 :rule', - ':attribute cannot exceed :rule' => ':attribute日期不能超过 :rule', - ':attribute not within :rule' => '不在有效期内 :rule', - 'access IP is not allowed' => '不允许的IP访问', - 'access IP denied' => '禁止的IP访问', - ':attribute out of accord with :2' => ':attribute和确认字段:2不一致', - ':attribute cannot be same with :2' => ':attribute和比较字段:2不能相同', - ':attribute must greater than or equal :rule' => ':attribute必须大于等于 :rule', - ':attribute must greater than :rule' => ':attribute必须大于 :rule', - ':attribute must less than or equal :rule' => ':attribute必须小于等于 :rule', - ':attribute must less than :rule' => ':attribute必须小于 :rule', - ':attribute must equal :rule' => ':attribute必须等于 :rule', - ':attribute has exists' => ':attribute已存在', - ':attribute not conform to the rules' => ':attribute不符合指定规则', - 'invalid Request method' => '无效的请求类型', - 'invalid token' => '令牌数据无效', - 'not conform to the rules' => '规则错误', - 'record has update' => '记录已经被更新了', -]; diff --git a/resource/translations/zh_CN/validate.php b/resource/translations/zh_CN/validate.php deleted file mode 100644 index d3f26f3..0000000 --- a/resource/translations/zh_CN/validate.php +++ /dev/null @@ -1,147 +0,0 @@ - -// +---------------------------------------------------------------------- - -// 核心中文语言包 -return [ - // 系统错误提示 - 'Undefined variable' => '未定义变量', - 'Undefined index' => '未定义数组索引', - 'Undefined offset' => '未定义数组下标', - 'Parse error' => '语法解析错误', - 'Type error' => '类型错误', - 'Fatal error' => '致命错误', - 'syntax error' => '语法错误', - - // 框架核心错误提示 - 'dispatch type not support' => '不支持的调度类型', - 'method param miss' => '方法参数错误', - 'method not exists' => '方法不存在', - 'function not exists' => '函数不存在', - 'app not exists' => '应用不存在', - 'controller not exists' => '控制器不存在', - 'class not exists' => '类不存在', - 'property not exists' => '类的属性不存在', - 'template not exists' => '模板文件不存在', - 'illegal controller name' => '非法的控制器名称', - 'illegal action name' => '非法的操作名称', - 'url suffix deny' => '禁止的URL后缀访问', - 'Undefined cache config' => '缓存配置未定义', - 'Route Not Found' => '当前访问路由未定义或不匹配', - 'Undefined db config' => '数据库配置未定义', - 'Undefined log config' => '日志配置未定义', - 'Undefined db type' => '未定义数据库类型', - 'variable type error' => '变量类型错误', - 'PSR-4 error' => 'PSR-4 规范错误', - 'not support type' => '不支持的分页索引字段类型', - 'not support total' => '简洁模式下不能获取数据总数', - 'not support last' => '简洁模式下不能获取最后一页', - 'error session handler' => '错误的SESSION处理器类', - 'not allow php tag' => '模板不允许使用PHP语法', - 'not support' => '不支持', - 'database config error' => '数据库配置信息错误', - 'redisd master' => 'Redisd 主服务器错误', - 'redisd slave' => 'Redisd 从服务器错误', - 'must run at sae' => '必须在SAE运行', - 'memcache init error' => '未开通Memcache服务,请在SAE管理平台初始化Memcache服务', - 'KVDB init error' => '没有初始化KVDB,请在SAE管理平台初始化KVDB服务', - 'fields not exists' => '数据表字段不存在', - 'where express error' => '查询表达式错误', - 'no data to update' => '没有任何数据需要更新', - 'miss data to insert' => '缺少需要写入的数据', - 'miss complex primary data' => '缺少复合主键数据', - 'miss update condition' => '缺少更新条件', - 'model data Not Found' => '模型数据不存在', - 'table data not Found' => '表数据不存在', - 'delete without condition' => '没有条件不会执行删除操作', - 'miss relation data' => '缺少关联表数据', - 'tag attr must' => '模板标签属性必须', - 'tag error' => '模板标签错误', - 'cache write error' => '缓存写入失败', - 'sae mc write error' => 'SAE mc 写入错误', - 'route name not exists' => '路由标识不存在(或参数不够)', - 'invalid request' => '非法请求', - 'bind attr has exists' => '模型的属性已经存在', - 'relation data not exists' => '关联数据不存在', - 'relation not support' => '关联不支持', - 'chunk not support order' => 'Chunk不支持调用order方法', - 'route pattern error' => '路由变量规则定义错误', - 'route behavior will not support' => '路由行为废弃(使用中间件替代)', - 'closure not support cache(true)' => '使用闭包查询不支持cache(true),请指定缓存Key', - - // 上传错误信息 - 'unknown upload error' => '未知上传错误!', - 'file write error' => '文件写入失败!', - 'upload temp dir not found' => '找不到临时文件夹!', - 'no file to uploaded' => '没有文件被上传!', - 'only the portion of file is uploaded' => '文件只有部分被上传!', - 'upload File size exceeds the maximum value' => '上传文件大小超过了最大值!', - 'upload write error' => '文件上传保存错误!', - 'has the same filename: {:filename}' => '存在同名文件:{:filename}', - 'upload illegal files' => '非法上传文件', - 'illegal image files' => '非法图片文件', - 'extensions to upload is not allowed' => '上传文件后缀不允许', - 'mimetype to upload is not allowed' => '上传文件MIME类型不允许!', - 'filesize not match' => '上传文件大小不符!', - 'directory {:path} creation failed' => '目录 {:path} 创建失败!', - - 'The middleware must return Response instance' => '中间件方法必须返回Response对象实例', - 'The queue was exhausted, with no response returned' => '中间件队列为空', - // Validate Error Message - ':attribute require' => ':attribute不能为空', - ':attribute must' => ':attribute必须', - ':attribute must be numeric' => ':attribute必须是数字', - ':attribute must be integer' => ':attribute必须是整数', - ':attribute must be float' => ':attribute必须是浮点数', - ':attribute must be bool' => ':attribute必须是布尔值', - ':attribute not a valid email address' => ':attribute格式不符', - ':attribute not a valid mobile' => ':attribute格式不符', - ':attribute must be a array' => ':attribute必须是数组', - ':attribute must be yes,on or 1' => ':attribute必须是yes、on或者1', - ':attribute not a valid datetime' => ':attribute不是一个有效的日期或时间格式', - ':attribute not a valid file' => ':attribute不是有效的上传文件', - ':attribute not a valid image' => ':attribute不是有效的图像文件', - ':attribute must be alpha' => ':attribute只能是字母', - ':attribute must be alpha-numeric' => ':attribute只能是字母和数字', - ':attribute must be alpha-numeric, dash, underscore' => ':attribute只能是字母、数字和下划线_及破折号-', - ':attribute not a valid domain or ip' => ':attribute不是有效的域名或者IP', - ':attribute must be chinese' => ':attribute只能是汉字', - ':attribute must be chinese or alpha' => ':attribute只能是汉字、字母', - ':attribute must be chinese,alpha-numeric' => ':attribute只能是汉字、字母和数字', - ':attribute must be chinese,alpha-numeric,underscore, dash' => ':attribute只能是汉字、字母、数字和下划线_及破折号-', - ':attribute not a valid url' => ':attribute不是有效的URL地址', - ':attribute not a valid ip' => ':attribute不是有效的IP地址', - ':attribute must be dateFormat of :rule' => ':attribute必须使用日期格式 :rule', - ':attribute must be in :rule' => ':attribute必须在 :rule 范围内', - ':attribute be notin :rule' => ':attribute不能在 :rule 范围内', - ':attribute must between :1 - :2' => ':attribute只能在 :1 - :2 之间', - ':attribute not between :1 - :2' => ':attribute不能在 :1 - :2 之间', - 'size of :attribute must be :rule' => ':attribute长度不符合要求 :rule', - 'max size of :attribute must be :rule' => ':attribute长度不能超过 :rule', - 'min size of :attribute must be :rule' => ':attribute长度不能小于 :rule', - ':attribute cannot be less than :rule' => ':attribute日期不能小于 :rule', - ':attribute cannot exceed :rule' => ':attribute日期不能超过 :rule', - ':attribute not within :rule' => '不在有效期内 :rule', - 'access IP is not allowed' => '不允许的IP访问', - 'access IP denied' => '禁止的IP访问', - ':attribute out of accord with :2' => ':attribute和确认字段:2不一致', - ':attribute cannot be same with :2' => ':attribute和比较字段:2不能相同', - ':attribute must greater than or equal :rule' => ':attribute必须大于等于 :rule', - ':attribute must greater than :rule' => ':attribute必须大于 :rule', - ':attribute must less than or equal :rule' => ':attribute必须小于等于 :rule', - ':attribute must less than :rule' => ':attribute必须小于 :rule', - ':attribute must equal :rule' => ':attribute必须等于 :rule', - ':attribute has exists' => ':attribute已存在', - ':attribute not conform to the rules' => ':attribute不符合指定规则', - 'invalid Request method' => '无效的请求类型', - 'invalid token' => '令牌数据无效', - 'not conform to the rules' => '规则错误', - 'record has update' => '记录已经被更新了', -]; diff --git a/support/Encrypt.php b/support/Encrypt.php index d184620..9541410 100644 --- a/support/Encrypt.php +++ b/support/Encrypt.php @@ -26,15 +26,40 @@ class Encrypt */ static function userIDencode($userID,$key=0):string{ if(!is_numeric(($userID))){ - return $userID; + return $userID.''; } $userID = intval($userID); if($userID<=100234){ return $userID.''; } + if($userID == '100235'){ + return 'JWrb5JPm3E'; + } if($userID<=102028){ return id_encode($userID); } + return self::intEncode($userID,$key); + } + /** + * 解密非连续数字ID为原始连续ID + * @param int $encryptedId 加密后的非连续ID(8位数) + * @param int $userKey 可选的额外密钥 + * @return int 原始连续ID + */ + static function userIDDecode($userID,$key=0):string{ + if($userID == 'JWrb5JPm3E'){ + return '100235'; + } + if(!is_numeric(($userID))){ + return id_decode($userID.''); + } + if($userID<=100234){ + return $userID.''; + } + + return self::intDecode($userID,$key); + } + static function intEncode($userID,$key=0){ $key = intval($key); $plainId = abs(intval($userID)) % self::$maxId; @@ -55,19 +80,8 @@ class Encrypt // 确保结果是8位数(10000000 - 99999999) return (self::$baseValue + $encrypted).''; } - /** - * 解密非连续数字ID为原始连续ID - * @param int $encryptedId 加密后的非连续ID(8位数) - * @param int $userKey 可选的额外密钥 - * @return int 原始连续ID - */ - static function userIDDecode($userID,$key=0):string{ - if(!is_numeric(($userID))){ - return id_decode($userID.''); - } - if($userID<=100234){ - return $userID.''; - } + static function intDecode($userID,$key=0): string{ + $key = intval($key); // 去除基数,得到原始混淆值 $cipherId = ($userID - self::$baseValue + self::$maxId) % self::$maxId; @@ -88,7 +102,6 @@ class Encrypt return $plainId.''; } - /** * 使用扩展欧几里得算法计算模逆元 * 返回 x 使得 (a * x) % m = 1 diff --git a/support/Exception.php b/support/Exception.php index 7abcf2b..bdf34a1 100755 --- a/support/Exception.php +++ b/support/Exception.php @@ -9,18 +9,7 @@ declare(strict_types=1); namespace support; -use FastRoute\BadRouteException; -use think\db\exception\DataNotFoundException; -use think\db\exception\DbException; -use think\db\exception\ModelNotFoundException; use Throwable; -use Tinywan\ExceptionHandler\Event\DingTalkRobotEvent; -use Tinywan\ExceptionHandler\Exception\BaseException; -use Tinywan\ExceptionHandler\Exception\ServerErrorHttpException; -use Tinywan\Jwt\Exception\JwtRefreshTokenExpiredException; -use Tinywan\Jwt\Exception\JwtTokenException; -use Tinywan\Jwt\Exception\JwtTokenExpiredException; -use Tinywan\Validate\Exception\ValidateException; use Webman\Exception\ExceptionHandler; use Webman\Http\Request; use Webman\Http\Response; diff --git a/support/OpenImSdk/Core/Utils.php b/support/OpenImSdk/Core/Utils.php index f48f129..0885562 100755 --- a/support/OpenImSdk/Core/Utils.php +++ b/support/OpenImSdk/Core/Utils.php @@ -69,7 +69,10 @@ class Utils if ($token) { $options[RequestOptions::HEADERS]['token'] = $token; } - + return post($uri,$data,[ + "token: {$token}", + "operationID: {$options[RequestOptions::HEADERS]['operationID']}", + ]); return $client->post($uri, $options)->getBody()->getContents(); } @@ -88,10 +91,10 @@ class Utils $token = $token ? $token : Utils::getAdminToken(); } $url = Url::buildUrl($path); - //log_alert($url); - //log_alert($data); + //cp($url); + //cp($data); $res = self::request($url, $data, $token); - //log_alert($res); + //cp($res); $res = json_decode($res, true); if($res['errCode'] !==0 ){ throw new \Exception($res['errMsg'],$res['errCode']);