|
@@ -14,7 +14,7 @@ use think\Db;
|
|
|
*/
|
|
|
class Tenim extends Api
|
|
|
{
|
|
|
- protected $noNeedLogin = ["callback",'test','createIMGroup','updateRoomInfo','setImManage','sendMessageToUser','outMemberFromRoom'];
|
|
|
+ protected $noNeedLogin = ["callback",'test','createIMGroup','updateRoomInfo','setImManage','sendMessageToUser','outMemberFromRoom','selectstatus','loginoutim'];
|
|
|
protected $noNeedRight = ['*'];
|
|
|
|
|
|
|
|
@@ -37,6 +37,56 @@ exit;
|
|
|
// $this->success("",$partyList);
|
|
|
}
|
|
|
|
|
|
+ public function loginoutim($uid){
|
|
|
+ /*
|
|
|
+ * https://console.tim.qq.com/v4/im_open_login_svc/kick?sdkappid=88888888&identifier=admin&usersig=xxx&random=99999999&contenttype=json
|
|
|
+ */
|
|
|
+ $random = rand(10000000, 99999999);
|
|
|
+ $usersig = $this->usersig("administrator");
|
|
|
+ // 获取配置信息
|
|
|
+ $config = config("tencent_im");
|
|
|
+ $url = "https://console.tim.qq.com/v4/im_open_login_svc/kick";
|
|
|
+ $url .= "?sdkappid=" . $config["sdkappid"];
|
|
|
+ $url .= "&identifier=administrator";
|
|
|
+ $url .= "&usersig=" . $usersig;
|
|
|
+ $url .= "&random=" . $random;
|
|
|
+ $url .= "&contenttype=json";
|
|
|
+
|
|
|
+ $data = [
|
|
|
+ 'Identifier' => "".$uid."",
|
|
|
+ ];
|
|
|
+
|
|
|
+ $rs = curl_post($url,json_encode($data));
|
|
|
+ //dump($rs);
|
|
|
+// exit;
|
|
|
+
|
|
|
+ }
|
|
|
+ public function selectstatus(){
|
|
|
+ /*
|
|
|
+ * https://console.tim.qq.com/v4/openim/query_online_status?sdkappid=88888888&identifier=admin&usersig=xxx&random=99999999&contenttype=json
|
|
|
+ */
|
|
|
+ $random = rand(10000000, 99999999);
|
|
|
+ $usersig = $this->usersig("administrator");
|
|
|
+ // 获取配置信息
|
|
|
+ $config = config("tencent_im");
|
|
|
+ $url = "https://console.tim.qq.com/v4/openim/query_online_status";
|
|
|
+ $url .= "?sdkappid=" . $config["sdkappid"];
|
|
|
+ $url .= "&identifier=administrator";
|
|
|
+ $url .= "&usersig=" . $usersig;
|
|
|
+ $url .= "&random=" . $random;
|
|
|
+ $url .= "&contenttype=json";
|
|
|
+
|
|
|
+ $data = [
|
|
|
+ 'To_Account' => ["34"],
|
|
|
+ ];
|
|
|
+
|
|
|
+ $rs = curl_post($url,json_encode($data));
|
|
|
+ //$rs = curl_post($url,'{"IsNeedDetail":1,"To_Account":["32"]}');
|
|
|
+ dump($rs);
|
|
|
+ exit;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 创建im群组
|
|
|
*/
|