正在显示
1 个修改的文件
包含
38 行增加
和
1 行删除
@@ -161,7 +161,7 @@ class User extends Api | @@ -161,7 +161,7 @@ class User extends Api | ||
161 | ->where('openid', $openid) | 161 | ->where('openid', $openid) |
162 | ->where('app_id', $appId) | 162 | ->where('app_id', $appId) |
163 | ->update($userData); | 163 | ->update($userData); |
164 | - $this->success("登录成功!", ['token' => $token]); | 164 | + $this->success("登录成功!", ['token' => $token, 'avatar' => $wxUserData['avatarUrl']]); |
165 | } else { | 165 | } else { |
166 | if(empty($data['inviter'])){ | 166 | if(empty($data['inviter'])){ |
167 | $invite_id = ''; | 167 | $invite_id = ''; |
@@ -361,4 +361,41 @@ class User extends Api | @@ -361,4 +361,41 @@ class User extends Api | ||
361 | } | 361 | } |
362 | $this->success('success',$data); | 362 | $this->success('success',$data); |
363 | } | 363 | } |
364 | + | ||
365 | + | ||
366 | + | ||
367 | + /** | ||
368 | + * @ApiTitle (获取用户融云账号信息) | ||
369 | + * @ApiSummary (获取用户融云账号信息) | ||
370 | + * @ApiMethod (POST) | ||
371 | + * @ApiRoute (/api/user/rongyun) | ||
372 | + * | ||
373 | + * @ApiHeaders (name=token, type=string, required=true, description="请求的Token") | ||
374 | + * | ||
375 | + * @ApiReturn({ | ||
376 | + "code": 1, | ||
377 | + "msg": "成功", | ||
378 | + "time": "1571492001", | ||
379 | + "data": { | ||
380 | + "id"://融云id | ||
381 | + "token"://融云token | ||
382 | + } | ||
383 | + }) | ||
384 | + */ | ||
385 | + public function rongyun() { | ||
386 | + $return = [ | ||
387 | + 'id' => '', | ||
388 | + 'token' => '' | ||
389 | + ]; | ||
390 | + if($this->userId) { | ||
391 | + $user_id = $this->getUserId(); | ||
392 | + if($this->user['is_create'] == 1) { | ||
393 | + $return = [ | ||
394 | + 'id' => $this->user['rongyun_id'], | ||
395 | + 'token' => $this->user['rongyun_token'], | ||
396 | + ]; | ||
397 | + } | ||
398 | + } | ||
399 | + $this->success('成功',$return); | ||
400 | + } | ||
364 | } | 401 | } |
-
请 注册 或 登录 后发表评论