setLog(self::TYPENAME.'getChatUrl step_1 开始', $this->startTime()); $url = config('console.thirdH5Chat.url'); $secret = config('console.thirdH5Chat.secret'); $parameter = [ 'appid' => config('console.thirdH5Chat.appid'), 'user_key' => urlencode($uid), 'nick_name' => $nickname, 'head_url' => urlencode($headUrl) ]; $this->setLog(self::TYPENAME.'getChatUrl step_2 请求参数', $this->startTime, $parameter); //token算法是 appid+user_key+secret $str = $parameter['appid'].$uid.$secret; $parameter['token'] = md5($str); $this->setLog(self::TYPENAME.'getChatUrl step_3 加入token', $this->startTime, $parameter); $query = ''; foreach ($parameter as $key => $value) { $query .= '&'.$key . '=' . $value; } return $this->response($url.$query); } }