From 61c519201898d86ed9dcde811585cd0cb122bf4f Mon Sep 17 00:00:00 2001 From: commie Date: Mon, 12 Jan 2026 12:42:08 +0800 Subject: [PATCH] 8 --- .gitignore | 3 +- app/api/controller/CommonController.php | 42 +- app/api/controller/FriendCircleController.php | 100 +- app/api/controller/MessageController.php | 31 + app/api/controller/UserController.php | 2 +- app/controller/CommonController.php | 31 + app/controller/HookController.php | 2 +- app/controller/IndexController.php | 41 +- app/functions.php | 12 +- app/queue/redis/Sms.php | 4 +- app/view/common/register.html | 978 ++++++++++++++++++ app/view/common/siglepage.html | 10 + config/route.php | 5 +- plugin/admin/app/controller/Crud.php | 4 +- .../admin/app/controller/FilesController.php | 1 + .../admin/app/controller/UserController.php | 8 +- .../app/controller/VersionController.php | 6 + plugin/admin/app/view/user/update.html | 12 + plugin/admin/app/view/version/update.html | 8 +- plugin/admin/public/js/user.js | 20 +- plugin/admin/public/js/version.js | 15 +- plugin/admin/public/libs/require-form.js | 2 +- public/favicon.ico | Bin 0 -> 15406 bytes public/index.html | 24 +- support/Jwt.php | 16 +- support/OpenImSdk/Api/Friend.php | 10 +- support/OpenImSdk/Api/Message.php | 8 +- 27 files changed, 1283 insertions(+), 112 deletions(-) create mode 100644 app/api/controller/MessageController.php create mode 100644 app/controller/CommonController.php create mode 100644 app/view/common/register.html create mode 100644 app/view/common/siglepage.html create mode 100644 public/favicon.ico diff --git a/.gitignore b/.gitignore index 29fca42..7e13f14 100755 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ config/site.php app/command/Test.php .env runtime -vendor \ No newline at end of file +vendor +public/shunliao.apk diff --git a/app/api/controller/CommonController.php b/app/api/controller/CommonController.php index a774368..5a27bc2 100755 --- a/app/api/controller/CommonController.php +++ b/app/api/controller/CommonController.php @@ -57,6 +57,7 @@ class CommonController extends BaseController{ $config['recharge_status_list'] = \app\enum\RechargeStatus::toArray(); $config['withdrawl_status_list'] = \app\enum\WithdrawlStatus::toArray(); $config['server_status_list'] = \app\enum\ServerStatus::toArray(); + //$config['getFriendList'] = $request->IM->friend->getFriendList('100006'); return $this->success(__('successful'), $config); } @@ -144,20 +145,28 @@ class CommonController extends BaseController{ // }else{ // $extends['trade_password'] = \plugin\admin\app\common\Util::passwordHash($trade_password); // } + //邀请码 - if ($invite_code) - { + //$invite_code = 'TEAJXLEE'; + $extends = [ + 'role_id' => 1, + 'group_id' => 0, + 'region' => '86', + 'nickname' => input('nickname'), + 'avatar' => '/static/img/avatar.png', + ]; + if ($invite_code) { if(strlen($invite_code) == 12){ //系统生产的一次性推荐吗 $inviteModel = \app\model\Invitecode::where('code',$invite_code)->find(); if(!$inviteModel){ return $this->error(__('错误的邀请码')); } - $extends['group'] = 2; + $extends['group_id'] = 2; $extends['role_id'] = 1; $extends['parent_id'] = 0; }else{ - $inviter_user = UserModel::where('invite_code',$invite_code)->field('group,id')->find(); + $inviter_user = UserModel::where('invite_code',$invite_code)->field('group_id,id')->find(); if(!$inviter_user){ return $this->error(__('Invalid invite code')); } @@ -166,12 +175,6 @@ class CommonController extends BaseController{ }else{ //return $this->error(__('Invalid invite code')); } - $extends = [ - 'role_id' => 1, - 'group_id' => 0, - 'nickname' => input('nickname'), - 'avatar' => '/static/img/avatar.png', - ]; // validate(\app\validate\User::class) // ->scene('edit') // ->check([ @@ -209,26 +212,28 @@ class CommonController extends BaseController{ $email = input('email'); $password = input('password'); $type = input(param: 'type'); - if (!$password) { - return $this->fail(__('Invalid username or password').'0'); - } if($type == 'mobile'){ if (!$mobile ) { - return $this->fail(__('Invalid username or password').'1'); + return $this->fail(__('Invalid username or password')); } $username = $mobile; }else if($type == 'email'){ if (!$email ) { - return $this->fail(__('Invalid username or password').'2'); + return $this->fail(__('Invalid username or password')); } $username = $email; }else{ if (!$username ) { - return $this->fail(__('Invalid username or password').'3'); + return $this->fail(__('Invalid username or password')); } } try{ - $user = \support\Jwt::login($username, $password,$type); + if ($password) { + //return $this->fail(__('Invalid username or password')); + $user = \support\Jwt::login($username, $password,$type); + }else{ + $user = \support\Jwt::login($username, $password,$type,'code'); + } if($user === false){ return $this->fail(\support\Jwt::getError()); } @@ -421,7 +426,8 @@ class CommonController extends BaseController{ $key = 'captcha_'.$event.'_'.$mobile; $list = cache($key); $list = $list ?:[]; - $expris = 60; + $expris = 300; + if(cache('?exp_'.$key)){ if(cache('exp_'.$key)+$expris > time()){ return $this->fail(__('Only one verification code can be sent within %second% seconds',['%second%'=>$expris])); diff --git a/app/api/controller/FriendCircleController.php b/app/api/controller/FriendCircleController.php index 2cba832..cbb4c5a 100755 --- a/app/api/controller/FriendCircleController.php +++ b/app/api/controller/FriendCircleController.php @@ -1,5 +1,6 @@ fail('请先登录'); + } $res = $this->newcount($request); $response = $res->rawBody(); $json = json_decode($response,true); $json['data']['settings'] = [ 'bg' => '', ]; - $json['data']['last_unread_item'] = [ - 'user_id' => '1', - 'avatar' => '', - 'nickname' => '', - ]; + $top_unread_items = FriendCircleModel::whereIn('id',$json['data']['unread_item_ids']) + ->with(['user' => function($query) { + $query->field('id,nickname,avatar'); + }]) + ->order('id', 'desc') + ->limit(0,3) + ->select(); + $json['data']['top_unread_items'] = $top_unread_items ?: []; $res->withBody(json_encode($json)); return $res; } @@ -56,11 +64,14 @@ class FriendCircleController extends BaseController{ */ function list(Request $request): Response { + $current_user = \support\Jwt::getUser(); + $current_user_id = $current_user ? $current_user->id : 0; $page = (int)$request->get('page', 1); $limit = (int)$request->get('limit', 10); $user_id = $request->get('user_id', 0); $query = FriendCircleModel::where('status', 1) + ->whereIn('user_id',$this->getFriendUserIds($current_user_id)) ->with(['user' => function($query) { $query->field('id,nickname,avatar'); }]) @@ -75,30 +86,33 @@ class FriendCircleController extends BaseController{ 'list_rows' => $limit, 'page' => $page, ]); + cache('circle_last_read_id',$list[0]['id']); - $current_user = \support\Jwt::getUser(); - $current_user_id = $current_user ? $current_user->id : 0; // 处理每条朋友圈数据 $items = $list->items(); $list->each(function($item) use ($current_user_id){ // 获取点赞列表 - $likes = FriendCircleLikeModel::where('circle_id', $item->id) - ->with(['user' => function($query) { - $query->field('id,nickname,avatar'); - }]) - ->order('created_at', 'desc') + $likes = Db::name('friend_circle')->alias('f') + ->join('user u','u.id=f.user_id') + ->where('f.id', $item->id) + ->field('f.*,u.avatar,u.nickname') + ->order('f.created_at', 'desc') ->limit(20) ->select(); - + $likes = $likes ? $likes->toArray() : []; // 检查当前用户是否已点赞 $is_liked = false; if ($current_user_id > 0) { - $is_liked = FriendCircleLikeModel::where('circle_id', $item->id) - ->where('user_id', $current_user_id) - ->count() > 0; + $is_liked = null !== array_find($likes,function($item)use($current_user_id){ + return $item['user_id'] == $current_user_id; + }); + // FriendCircleLikeModel::where('circle_id', $item->id) + // ->where('user_id', $current_user_id) + // ->count() > 0; } + // 获取评论列表(最新10条) $comments = FriendCircleCommentModel::where('circle_id', $item->id) ->where('status', 1) @@ -137,8 +151,8 @@ class FriendCircleController extends BaseController{ // 处理点赞用户头像 foreach ($item->likes as $like) { - if ($like->user && $like->user->avatar) { - $like->user->avatar = cdnurl($like->user->avatar); + if ($like->user) { + $like->avatar = cdnurl($like->avatar); } } @@ -169,24 +183,19 @@ class FriendCircleController extends BaseController{ return $this->fail('请先登录'); } - $last_see = $request->post('last_see'); - if (empty($last_see)) { - $last_see = cache('last_see_' . $user->id); - } - - if (empty($last_see)) { - $last_see = time() - 86400; // 默认24小时前 - } else { - // 保存最后查看时间 - cache('last_see_' . $user->id, $last_see); - } - + $circle_last_read_id = cache('circle_last_read_id') ?: 0; // 统计从上次查看时间到现在新增的朋友圈数量 - $count = FriendCircleModel::where('status', 1) - ->where('created_at', '>', $last_see) - ->count(); + $unread_item_ids = FriendCircleModel::where('status', 1) + ->whereIn('user_id',$this->getFriendUserIds($user->id)) + ->where('id', '>', $circle_last_read_id) + ->order('id', 'desc') + ->column('id'); - return $this->success('ok', ['count' => $count]); + + return $this->success('ok', [ + 'unread_count' => count($unread_item_ids), + 'unread_item_ids'=>$unread_item_ids + ]); } /** @@ -301,8 +310,12 @@ class FriendCircleController extends BaseController{ ->where('status', 1) ->count(); $circle->save(); - - return $this->success('评论成功', ['id' => $comment->id]); + $comment->user = Db::name('user')->where('id',$comment->user_id)->find(); + $comment->replyUser=null; + if($comment->reply_user_id){ + $comment->replyUser = Db::name('user')->where('id',$comment->reply_user_id)->find(); + } + return $this->success('评论成功', $comment); } /** @@ -354,4 +367,19 @@ class FriendCircleController extends BaseController{ return $this->success('点赞成功', ['is_liked' => true]); } } + protected function getFriendUserIds($user_id):array{ + if (!$user_id) { + return []; + } + $result = cache('friend_id_list') ?: []; + if(count($result) === 0){ + $res = request()->IM->friend->getFriendList($user_id.''); + $friendsInfo = $res['friendsInfo']; + foreach($friendsInfo as $k=>$v){ + array_push($result,$v['friendUser']['userID']); + } + cache('friend_id_list',$result,3600); + } + return $result; + } } \ No newline at end of file diff --git a/app/api/controller/MessageController.php b/app/api/controller/MessageController.php new file mode 100644 index 0000000..019628a --- /dev/null +++ b/app/api/controller/MessageController.php @@ -0,0 +1,31 @@ +IM; + $data = $im->message->sendBusinessNotification('system',100007,[ + 'contentType' => 101, + 'textElem' => [ + 'content' => '欢迎使用4'.Config('site.name') + ] + ],'group'); + return $this->success('ok'); + } +} \ No newline at end of file diff --git a/app/api/controller/UserController.php b/app/api/controller/UserController.php index 28ee0a6..f36bcb0 100755 --- a/app/api/controller/UserController.php +++ b/app/api/controller/UserController.php @@ -42,7 +42,7 @@ class UserController extends BaseController{ if($nickname){ $save_data['nickname'] = $nickname; } - if($gender){ + if($gender!=null){ $save_data['sex'] = $gender; } if($faceURL){ diff --git a/app/controller/CommonController.php b/app/controller/CommonController.php new file mode 100644 index 0000000..c2dd397 --- /dev/null +++ b/app/controller/CommonController.php @@ -0,0 +1,31 @@ + Config('site'), + 'invite_code' => $code + ]); + }else{ + return $this->fail('404'); + } + } + +} diff --git a/app/controller/HookController.php b/app/controller/HookController.php index c5e458a..8b9bddb 100755 --- a/app/controller/HookController.php +++ b/app/controller/HookController.php @@ -28,7 +28,7 @@ class HookController{ 'host' => 'http://127.0.0.1:10002', // OpenIM API地址 'secret' => 'n1e5a6s6m7', // OpenIM密钥 ]); - $im->message->sendBusinessNotification('system',$userID,[ + $im->message->sendBusinessNotification('official_team',$userID,[ 'contentType' => 101, 'textElem' => [ 'content' => '欢迎使用'.Config('site.name') diff --git a/app/controller/IndexController.php b/app/controller/IndexController.php index 765c724..abe2bb1 100755 --- a/app/controller/IndexController.php +++ b/app/controller/IndexController.php @@ -2,15 +2,11 @@ namespace app\controller; -use app\model\Order; -use app\model\Withdrawl as WithdrawlModel; -use app\model\Address as AddressModel; use support\exception\BusinessException; use support\Request; use support\Response; -use Throwable; -use Web3\Contracts\Types\Address as TypesAddress; -use Workerman\Worker; +use Exception; +use app\model\Archives as ArchivesModel; class IndexController extends Crud { @@ -19,12 +15,11 @@ class IndexController extends Crud * 后台主页 * @param Request $request * @return Response - * @throws BusinessException|Throwable + * @throws BusinessException|Exception */ public function index(Request $request) { - return 'ok'; - return view(base_path().'/public/index.html'); + return view('public/index.html'); } public function user(Request $request,$code) { @@ -37,4 +32,32 @@ class IndexController extends Crud return 'group'; } + public function privacy_policy(Request $request) + { + return $this->siglepage($request); + } + + public function aboutus(Request $request) + { + return $this->siglepage($request); + } + function siglepage($request){ + $name = $request->action; + if(!$name){ + return $this->error(__("Article does not exist")); + } + /** @var ArchivesModel $vo */ + $vo = ArchivesModel::where('name',$name)->find(); + if(!$vo) { + return $this->error(__("Article does not exist")); + } + $addon = \app\model\Content::where('id', $vo->id)->find()->toArray(); + if ($addon) { + $vo->setAddonData($addon); + } + return view('common/siglepage',[ + 'vo' => $vo + ]); + } + } diff --git a/app/functions.php b/app/functions.php index 55eee4c..7ed643b 100755 --- a/app/functions.php +++ b/app/functions.php @@ -853,7 +853,17 @@ if(!function_exists('get_user_rights')){ } return $result; } - +} +if(!function_exists('array_find')){ + function array_find(array $array,callable $callbcak):mixed{ + foreach ($array as $key => $value) { + if ($callbcak($value, $key)) { + return $value; + } + } + + return null; + } } if(!function_exists('__my__template_inputs')){ function __my__template_inputs(&$template, &$vars, &$app, &$plugin){ diff --git a/app/queue/redis/Sms.php b/app/queue/redis/Sms.php index 40eab15..7d0376b 100755 --- a/app/queue/redis/Sms.php +++ b/app/queue/redis/Sms.php @@ -22,7 +22,7 @@ class Sms implements Consumer }else{ $body = $this->getTemplate($data); } - $url = 'http://api.smsbao.com/sms?u=shunliao&p='.md5('Aaa1231232').'&m='.$data['mobile'].'&c='.urlencode($body); + $url = 'http://api.smsbao.com/sms?u=shunliao&p='.md5('Aaa123123@').'&m='.$data['mobile'].'&c='.urlencode($body); $statusStr = array( "0" => "短信发送成功", "-1" => "参数不全", @@ -47,7 +47,7 @@ class Sms implements Consumer //var_export($data); // 输出 ['to' => 'tom@gmail.com', 'content' => 'hello'] } function getTemplate($data){ - $str = '【瞬聊】验证码:{$code},该验证码在5分钟内输入有效,若非您本人操作请尽快修改登录密码'; + $str = '【瞬聊科技】验证码:{$code},该验证码在5分钟内有效,如非本人操作,请忽略本短信。'; foreach($data as $k=>$v){ $str = str_replace('{$'.$k.'}',$v,$str); } diff --git a/app/view/common/register.html b/app/view/common/register.html new file mode 100644 index 0000000..0ce77bf --- /dev/null +++ b/app/view/common/register.html @@ -0,0 +1,978 @@ + + + + + + + 用户注册 - {$config.name} + + + {literal} + + {/literal} + + + +
+
+ +

欢迎回来

+

使用手机号码注册您的账户

+
+
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ 已有账号?立即下载APP +
+
+ +
+
+
+
+
+
+ +
+

注册成功!

+

注册成功,下载APP,马上开始您的聊天之旅吧

+ + 下载 +
+
+ + + + +{literal} + +{/literal} + \ No newline at end of file diff --git a/app/view/common/siglepage.html b/app/view/common/siglepage.html new file mode 100644 index 0000000..0a757bc --- /dev/null +++ b/app/view/common/siglepage.html @@ -0,0 +1,10 @@ + + + + {$vo.title} + + +

{$vo.title}

+
{$vo.content|raw}
+ + \ No newline at end of file diff --git a/config/route.php b/config/route.php index 13056fb..be03ac0 100755 --- a/config/route.php +++ b/config/route.php @@ -16,9 +16,12 @@ use Webman\Route; Route::get('/u/{code}', [\app\controller\IndexController::class, 'user']); Route::get('/g/{code}', [\app\controller\IndexController::class, 'group']); +Route::get('/privacy_policy', [\app\controller\IndexController::class, 'privacy_policy']); +Route::get('/aboutus', [\app\controller\IndexController::class, 'aboutus']); +Route::get('/register/{code}', [\app\controller\CommonController::class, 'register']); Route::fallback(function(){ - $fn = base_path().'/public/index.html'; + $fn = 'public/index.html'; if(file_exists($fn)){ return view($fn); } diff --git a/plugin/admin/app/controller/Crud.php b/plugin/admin/app/controller/Crud.php index 2559ba7..c16117b 100755 --- a/plugin/admin/app/controller/Crud.php +++ b/plugin/admin/app/controller/Crud.php @@ -295,7 +295,7 @@ class Crud extends Base $data = $this->inputFilter($request->post()); $password_filed = 'password'; if (isset($data[$password_filed])) { - $data[$password_filed] = Util::passwordHash($data[$password_filed]); + $data[$password_filed] = Util::passwordHash(md5($data[$password_filed])); } $password_filed = 'trade_password'; if (isset($data[$password_filed])) { @@ -380,7 +380,7 @@ class Crud extends Base if ($data[$password_filed] === '') { unset($data[$password_filed]); } else { - $data[$password_filed] = Util::passwordHash($data[$password_filed]); + $data[$password_filed] = Util::passwordHash(md5($data[$password_filed])); } } $password_filed = 'trade_password'; diff --git a/plugin/admin/app/controller/FilesController.php b/plugin/admin/app/controller/FilesController.php index a67c06e..96a943f 100755 --- a/plugin/admin/app/controller/FilesController.php +++ b/plugin/admin/app/controller/FilesController.php @@ -65,6 +65,7 @@ class FilesController extends Crud try{ $data = $this->base($request, $savePath); }catch(\Exception $e){ + return $this->fail( $e->getMessage()); log_alert($e->getMessage()); } return $this->success( '上传成功', $data); diff --git a/plugin/admin/app/controller/UserController.php b/plugin/admin/app/controller/UserController.php index ce28c73..781d14d 100755 --- a/plugin/admin/app/controller/UserController.php +++ b/plugin/admin/app/controller/UserController.php @@ -8,7 +8,7 @@ use plugin\admin\app\model\User as UserModel; use support\exception\BusinessException; use support\Request; use support\Response; -use Throwable; +use Exception; /** * 用户管理 @@ -51,7 +51,7 @@ class UserController extends Crud /** * 浏览 * @return Response - * @throws Throwable + * @throws Exception */ public function index(Request $request): Response { @@ -62,7 +62,7 @@ class UserController extends Crud * 插入 * @param Request $request * @return Response - * @throws BusinessException|Throwable + * @throws BusinessException|Exception */ public function insert(Request $request): Response { @@ -79,7 +79,7 @@ class UserController extends Crud * 更新 * @param Request $request * @return Response - * @throws BusinessException|Throwable + * @throws BusinessException|Exception */ public function update(Request $request): Response { diff --git a/plugin/admin/app/controller/VersionController.php b/plugin/admin/app/controller/VersionController.php index bfa0380..b0f48d9 100755 --- a/plugin/admin/app/controller/VersionController.php +++ b/plugin/admin/app/controller/VersionController.php @@ -39,5 +39,11 @@ class VersionController extends Crud $this->assign("statusList", $statusList); $this->assignconfig("statusList", $statusList); } + function __before_insert__(){ + $this->assign("row", [ + 'type' => 1, + 'force' => 1 + ]); + } } diff --git a/plugin/admin/app/view/user/update.html b/plugin/admin/app/view/user/update.html index dfbf0f3..5dd03d2 100755 --- a/plugin/admin/app/view/user/update.html +++ b/plugin/admin/app/view/user/update.html @@ -144,6 +144,18 @@ +
+ +
+ +
+
+
+ +
+
+
+
{php} /*
diff --git a/plugin/admin/app/view/version/update.html b/plugin/admin/app/view/version/update.html index 570ab67..8c3bc70 100755 --- a/plugin/admin/app/view/version/update.html +++ b/plugin/admin/app/view/version/update.html @@ -34,15 +34,15 @@
- +
- +
- +
- +
diff --git a/plugin/admin/public/js/user.js b/plugin/admin/public/js/user.js index b450616..c3d710d 100755 --- a/plugin/admin/public/js/user.js +++ b/plugin/admin/public/js/user.js @@ -1,4 +1,4 @@ -define(['table', 'upload','form'], function (Table,Upload,Form) { +define(['table', 'upload','form','qrcode'], function (Table,Upload,Form) { var User = { //Do setup work hereAction index: function () { @@ -29,6 +29,10 @@ define(['table', 'upload','form'], function (Table,Upload,Form) { filter: "number", sortable: true // 是否排序 }, + { + title: "上级", + field: "referrer.username" + }, { title: "角色", field: "role_id", @@ -84,10 +88,10 @@ define(['table', 'upload','form'], function (Table,Upload,Form) { }; columns.push({ title: "注册时间", - field: "createTime", - formatter:function(v,row){ - return Table.api.formatter.datetime(parseInt(v/1000)); - }, + field: "created_at", + // formatter:function(v,row){ + // return Table.api.formatter.datetime(parseInt(v/1000)); + // }, filter:'datetime' }); columns.push({ @@ -106,6 +110,7 @@ define(['table', 'upload','form'], function (Table,Upload,Form) { name:"team", icon:"mdi mdi-account-group-outline", classname:"btn btn-xs btn-info btn-dialog", + extend:' data-offset="r" data-area="80%,100%" data-anim="5" data-shade="0.3" data-move="false"', url:'user/team' } ] @@ -128,6 +133,11 @@ define(['table', 'upload','form'], function (Table,Upload,Form) { var form = $('form'); Form.api.bindevent(form) this.getRole(); + + $('#qrcode div').qrcode({ + width: 128,height: 128, + text: $('#qrcode').data("url") + }); }, insert:function(){ Config['upload_url'] = '/files/avatar'; diff --git a/plugin/admin/public/js/version.js b/plugin/admin/public/js/version.js index 35484b5..a32d789 100755 --- a/plugin/admin/public/js/version.js +++ b/plugin/admin/public/js/version.js @@ -97,12 +97,23 @@ define(['table', 'upload','form'], function (Table,Upload,Form) { Table.api.bindevent(table); }, update:function(){ - var form = $('form'); - Form.api.bindevent(form); + this.insert(); }, insert:function(){ var form = $('form'); Form.api.bindevent(form); + var calc_version = function(v){ + var _v = v.split(''); + console.log(_v); + $('#version').val(_v.join('.')); + } + $('#version_wgt').on('change',function(){ + var v = $(this).val(); + calc_version(v); + }).on('input',function(){ + var v = $(this).val(); + calc_version(v); + }); } }; return Version diff --git a/plugin/admin/public/libs/require-form.js b/plugin/admin/public/libs/require-form.js index 70be424..de48df8 100755 --- a/plugin/admin/public/libs/require-form.js +++ b/plugin/admin/public/libs/require-form.js @@ -511,7 +511,7 @@ define(['jquery', 'bootstrap', 'upload', 'validator'], function ($, undefined, U values[name] = $field.val(); } }); - console.log(values); + //console.log(values); return values; } diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..5afa3366976dda5a1e42c40dcf9840b2ce625f7e GIT binary patch literal 15406 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 literal 0 HcmV?d00001 diff --git a/public/index.html b/public/index.html index a83c7a0..fedf158 100755 --- a/public/index.html +++ b/public/index.html @@ -359,17 +359,15 @@
@@ -381,17 +379,16 @@ 应用名:瞬聊

- 黑ICP备2024020582号-3 + 鄂ICP备2026000509号-1

-

+ @@ -399,11 +396,11 @@

联系方式

-
@@ -534,7 +531,8 @@ alert('暂未开放'); //window.location.href = 'https://shunliao.oss-accelerate.aliyuncs.com'; }else{ - window.location.href = 'https://shunliao.oss-accelerate.aliyuncs.com/apk/install.apk'; + //window.location.href = 'https://shunliao.oss-accelerate.aliyuncs.com/apk/install.apk'; + window.location.href = '/shunliao.apk'; } } diff --git a/support/Jwt.php b/support/Jwt.php index a921c6b..d87018e 100755 --- a/support/Jwt.php +++ b/support/Jwt.php @@ -122,9 +122,11 @@ class Jwt * * @param string $account 账号,用户名、邮箱、手机号 * @param string $password 密码 + * @param string $type 登录方式 + * @param string $verifyType 验证方式 * @return boolean */ - public static function login($account, $password,$type=''): array|bool + public static function login($account, $password='',$type='',$verifyType='password'): array|bool { if($type){ $field = $type; @@ -150,10 +152,14 @@ class Jwt self::setError('Account is locked'); return false; } - //if ($user->username!='' && !\plugin\admin\app\common\Util::passwordVerify($password,$user->password)) { - if (!\plugin\admin\app\common\Util::passwordVerify($password,$user->password)) { - self::setError('Password is incorrect'); - return false; + if($verifyType == 'password'){ + //if ($user->username!='' && !\plugin\admin\app\common\Util::passwordVerify($password,$user->password)) { + if (!\plugin\admin\app\common\Util::passwordVerify($password,$user->password)) { + self::setError('Password is incorrect'); + return false; + } + }else{ + captcha_verfiy($type,'login',$account); } //直接登录会员 diff --git a/support/OpenImSdk/Api/Friend.php b/support/OpenImSdk/Api/Friend.php index 140b97c..8365bf8 100755 --- a/support/OpenImSdk/Api/Friend.php +++ b/support/OpenImSdk/Api/Friend.php @@ -100,11 +100,17 @@ class Friend * @param string $userID 用户ID * @return array */ - public function getFriendList(string $userID): array + public function getFriendList(string $userID,$page=1,$pagesize=1000): array { // 获取管理员token $adminToken = Utils::getAdminToken(); - return Utils::send(Url::$getFriendList, ['userID' => $userID], '获取用户的好友列表错误', $adminToken); + return Utils::send(Url::$getFriendList, [ + 'userID' => $userID, + "pagination" => [ + "pageNumber" => $page, + "showNumber" => $pagesize + ] + ], '获取用户的好友列表错误', $adminToken); } /** diff --git a/support/OpenImSdk/Api/Message.php b/support/OpenImSdk/Api/Message.php index 769c078..7c87cbb 100755 --- a/support/OpenImSdk/Api/Message.php +++ b/support/OpenImSdk/Api/Message.php @@ -154,15 +154,15 @@ class Message * @param string $ex 扩展字段 * @return array */ - public function sendBusinessNotification(string $sendID, string $recvID, array $data): array + public function sendBusinessNotification(string $sendID, string $recvID, array $data,string $type='user'): array { // 获取管理员token $data = [ 'sendUserID' => $sendID, - 'recvUserID' => $recvID, - 'recvGroupID' => '', + 'recvUserID' => $type=='user' ? $recvID : '', + 'recvGroupID' => $type=='user' ? '': $recvID, 'key' => md5(time()), - 'data' =>json_encode($data), + 'data' => json_encode($data), 'sendMsg' => true, 'reliabilityLevel' => 1, ];