diff --git a/app/Http/Controllers/Api/UsersController.php b/app/Http/Controllers/Api/UsersController.php index f2ebb0682..c1e6d0b12 100755 --- a/app/Http/Controllers/Api/UsersController.php +++ b/app/Http/Controllers/Api/UsersController.php @@ -1215,13 +1215,41 @@ class UsersController extends AbstractController $data['nickname'] = $sharekey ? $username : $user?->nickname; $data['token'] = $token; $data['msgs'] = $msgs; - $data['sharelink'] = $meeting->getShareLink(); // Meeting::setTouristInfo($data); // return Base::retSuccess('success', $data); } + /** + * @api {get} api/users/meeting/link 16. 【会议】获取分享链接 + * + * @apiDescription 需要token身份 + * @apiVersion 1.0.0 + * @apiGroup users + * @apiName meeting__link + * + * @apiParam {String} meetingid 频道ID(不是数字) + * @apiParam {String} [sharekey] 分享的key + * + * @apiSuccess {Number} ret 返回状态码(1正确、0错误) + * @apiSuccess {String} msg 返回信息(错误描述) + * @apiSuccess {Object} data 返回数据 + */ + public function meeting__link() + { + $meetingid = trim(Request::input('meetingid')); + $sharekey = trim(Request::input('sharekey')); + if(empty($sharekey) || !Meeting::getShareInfo($sharekey)){ + User::auth(); + } + $meeting = Meeting::whereMeetingid($meetingid)->first(); + if (empty($meeting)) { + return Base::retError('频道ID不存在'); + } + return Base::retSuccess('success', $meeting->getShareLink()); + } + /** * @api {get} api/users/meeting/tourist 16. 【会议】游客信息 * diff --git a/resources/assets/js/App.vue b/resources/assets/js/App.vue index 1f2b45482..b63917b53 100755 --- a/resources/assets/js/App.vue +++ b/resources/assets/js/App.vue @@ -334,43 +334,25 @@ export default { switch (act) { // 获取用户信息 case "getInfo": - if( (uuid+'').indexOf('88888') !== -1 ){ - this.$store.dispatch("call", { - url: 'users/meeting/tourist', - data: { - tourist_id: uuid + const isTourist = (uuid+'').indexOf('88888') !== -1; + this.$store.dispatch("call", { + url: isTourist ? 'users/meeting/tourist' : 'users/basic', + data: { + userid: uuid, + tourist_id: uuid, + } + }).then(({data}) => { + $A.eeuiAppSendMessage({ + action: 'updateMeetingInfo', + infos: { + uuid: uuid, + avatar: isTourist ? data?.userimg : data[0]?.userimg, + username: isTourist ? data?.nickname : data[0]?.nickname, } - }).then(({data}) => { - $A.eeuiAppSendMessage({ - action: 'updateMeetingInfo', - infos: { - uuid: uuid, - avatar: data?.userimg, - username: data?.nickname, - } - }); - }).catch(({msg}) => { - $A.modalError(msg); }); - }else{ - this.$store.dispatch("call", { - url: 'users/basic', - data: { - userid: [ (uuid+"").substring(5) ] - } - }).then(({data}) => { - $A.eeuiAppSendMessage({ - action: 'updateMeetingInfo', - infos: { - uuid: uuid, - avatar: data[0]?.userimg, - username: data[0]?.nickname, - } - }); - }).catch(({msg}) => { - $A.modalError(msg); - }); - } + }).catch(({msg}) => { + $A.modalError(msg); + }); break; //加入成功 case "success": diff --git a/resources/assets/js/pages/manage/components/MeetingManager.vue b/resources/assets/js/pages/manage/components/MeetingManager.vue index 49ddaba63..7701cff40 100644 --- a/resources/assets/js/pages/manage/components/MeetingManager.vue +++ b/resources/assets/js/pages/manage/components/MeetingManager.vue @@ -73,7 +73,7 @@ - + @@ -113,7 +113,7 @@ - {{$L('复制链接')}} + {{$L('复制链接')}} {{$L('发送邀请')}} @@ -172,6 +172,8 @@ export default { audioTrack: null, videoTrack: null, }, + + linkCopyLoad: false, } }, @@ -279,7 +281,6 @@ export default { }).then(({data}) => { this.$set(this.addData, 'name', data.name); this.$set(this.addData, 'meetingid', data.meetingid); - this.$set(this.addData, 'sharelink', data.sharelink); this.$set(this.localUser, 'nickname', data.nickname); this.$set(this.localUser, 'userimg', data.userimg); this.$store.dispatch("saveDialogMsg", data.msgs); @@ -539,12 +540,25 @@ export default { }, linkCopy() { - this.$copyText(this.addData.sharelink).then(_ => { - $A.messageSuccess('已复制会议邀请链接'); - }).catch(_ => { - $A.messageError('复制失败'); + this.linkCopyLoad = true; + this.$store.dispatch("call", { + url: 'users/meeting/link', + data: { + meetingid: this.addData.meetingid || this.invitationData.meetingid, + sharekey: this.addData.sharekey + }, + }).then(({ data }) => { + this.$copyText(data).then(_ => { + $A.messageSuccess('已复制会议邀请链接'); + }).catch(_ => { + $A.messageError('复制失败'); + }); + this.invitationShow = false; + }).catch(({ msg }) => { + $A.modalError(msg); + }).finally(_ => { + this.linkCopyLoad = false; }); - this.invitationShow = false; }, } }