zoukankan      html  css  js  c++  java
  • laravel 框架接入环信遇到的坑(-)

    在脚本中执行判断user表中是否注册环信时,报错: “请求错误:service_resource_not_found Service resource not found  ”

      // 判断环信是否已经注册该用户
                $personal = Easemob::getUser($user->id);
                dd($personal);

    追踪到composer包中link1stlaravel-easemobsrcappHttp.php 文件,添加一行 return false;即可;

    public function index()
        {
            $userList = User::where('remarks', 'like', '%0417%')->get();
    
            $registers = array();
            $num = 0;
    
            foreach ($userList as $key => $user) {
                // 判断环信是否已经注册该用户
                $personal = Easemob::getUser($user->id);
    //            dd($personal);
                if (!$personal) {
                    $registers[] = array('username' => $user->id, 'password' => $user->id . 'laizheer');
                    $num++;
                }
                // 够50条的时候发起注册
                if (!empty($registers) and (count($registers) == 50)) {
                    Easemob::authorizationRegistrations($registers);
                    $registers = array();
                    $this->info('user注册已完成' . $num . '个');
                }
    
                // 循环到最后一条的时候,直接注册
                if (!empty($registers) and ($userList->count() - $key) < 50) {
                    Easemob::authorizationRegistrations($registers);
                    $registers = array();
                    $this->info('user注册最后已完成' . $num . '个');
                }
    
    //            dd('停止一下');
            }
            dd('总人数:' . count($userList));
    
        }
  • 相关阅读:
    给X轴添加滚动条,放大X轴Y轴
    win7下发布网站
    asp.net播放声音
    用Flash方式动态生成图表
    debian programming guid
    php 自动跳转的3种方法
    用expect实现su c功能,身份切换
    11 Top Opensource Resources for Cloud Computing
    转:Linux系统下Shell命令行快捷键实用技巧
    sed 替换
  • 原文地址:https://www.cnblogs.com/lxwphp/p/10874221.html
Copyright © 2011-2022 走看看