|
@@ -5,6 +5,7 @@ namespace app\api\controller;
|
|
|
use app\common\controller\Api;
|
|
|
use app\common\library\Ems;
|
|
|
use app\common\library\Sms;
|
|
|
+use app\utils\Service\Tencent\TencentIm;
|
|
|
use think\Validate;
|
|
|
use think\Db;
|
|
|
use app\common\library\Wechat;
|
|
@@ -45,6 +46,8 @@ class User extends Api
|
|
|
$ret = $this->auth->login($account, $password);
|
|
|
if ($ret) {
|
|
|
$data = $this->auth->getUserinfo_smiple();
|
|
|
+ $im = new TencentIm();
|
|
|
+ $im->register(im_prefix($data['id']),$data['nickname'],$data['avatar']);
|
|
|
$this->success(__('Logged in successful'), $data);
|
|
|
} else {
|
|
|
$this->error($this->auth->getError());
|
|
@@ -84,6 +87,8 @@ class User extends Api
|
|
|
if ($ret) {
|
|
|
Sms::flush($mobile, 'mobilelogin');
|
|
|
$data = $this->auth->getUserinfo_smiple();
|
|
|
+ $im = new TencentIm();
|
|
|
+ $im->register(im_prefix($data['id']),$data['nickname'],$data['avatar']);
|
|
|
$this->success(__('Logged in successful'), $data);
|
|
|
} else {
|
|
|
$this->error($this->auth->getError());
|
|
@@ -119,6 +124,8 @@ class User extends Api
|
|
|
$ret = $this->auth->register('', $password, '', $mobile, []);
|
|
|
if ($ret) {
|
|
|
$data = $this->auth->getUserinfo_smiple();
|
|
|
+ $im = new TencentIm();
|
|
|
+ $im->register(im_prefix($data['id']),$data['nickname'],$data['avatar']);
|
|
|
$this->success(__('Sign up successful'), $data);
|
|
|
} else {
|
|
|
$this->error($this->auth->getError());
|