You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
824 B
35 lines
824 B
<?php
|
|
|
|
namespace rongyun;
|
|
|
|
use RongCloud\RongCloud;
|
|
|
|
class User
|
|
{
|
|
private $appKey = '8luwapkv86qpl';
|
|
private $appSecret = 'cEAwnxE4ooY';
|
|
/**
|
|
* 注册用户
|
|
*/
|
|
public function registerUser($user_id,$user_name,$user_head_img)
|
|
{
|
|
$user = new RongCloud($this->appKey,$this->appSecret);
|
|
return $user->getUser()->register([
|
|
'id' => $user_id,
|
|
'name' => $user_name,
|
|
'portrait' => $user_head_img
|
|
]);
|
|
}
|
|
/**
|
|
* 修改用户
|
|
*/
|
|
public function updateUser($user_id,$user_name,$user_head_img)
|
|
{
|
|
$user = new RongCloud($this->appKey,$this->appSecret);
|
|
return $user->getUser()->update([
|
|
'id' => $user_id,
|
|
'name' => $user_name,
|
|
'portrait' => $user_head_img
|
|
]);
|
|
}
|
|
} |