优化了登录
This commit is contained in:
parent
3b2c47e0ec
commit
5d893d26b5
@ -12,14 +12,7 @@ let cameraId = '';
|
||||
let micId = '';
|
||||
|
||||
function login() {
|
||||
if ($('#userId').val() == '') {
|
||||
alert('用户名不能为空!');
|
||||
return;
|
||||
}
|
||||
if ($('#roomId').val() == '') {
|
||||
alert('房间号不能为空!');
|
||||
return;
|
||||
}
|
||||
|
||||
presetting.login(false, options => {
|
||||
rtc = new RtcClient(options);
|
||||
join();
|
||||
@ -29,7 +22,10 @@ function login() {
|
||||
share = new ShareClient(options);
|
||||
});
|
||||
}
|
||||
$(function (){
|
||||
login();
|
||||
|
||||
})
|
||||
function join() {
|
||||
rtc.join();
|
||||
$('#login-root').hide();
|
||||
|
@ -25,7 +25,7 @@ class Presetting {
|
||||
}
|
||||
|
||||
login(share, callback) {
|
||||
let userId = $('#userId').val();
|
||||
let userId = window.mid;
|
||||
if (share) {
|
||||
userId = 'share_' + userId;
|
||||
}
|
||||
@ -33,7 +33,7 @@ class Presetting {
|
||||
|
||||
let sdkAppId;
|
||||
let userSig;
|
||||
let roomId = $('#roomId').val();
|
||||
let roomId = window.roomid;
|
||||
genTestUserSig(userId).then((res)=>{
|
||||
sdkAppId = res.id;
|
||||
userSig = res.data
|
||||
|
@ -31,66 +31,7 @@
|
||||
<div style="width: 86px; height: 23px; font-size: 18px; color: #333333">视频通话</div>
|
||||
</div>
|
||||
<!-- 用户名 房间号 登录按钮-->
|
||||
<div class="col-div" style="width: 320px">
|
||||
<div class="form-group bmd-form-group is-filled" style="width: 100%; height: 80px">
|
||||
<label for="userId" class="bmd-label-floating">用户名:</label>
|
||||
<input type="text" class="form-control" name="userId" id="userId" maxlength="18">
|
||||
</div>
|
||||
<div class="form-group bmd-form-group is-filled" style="width: 100%; height: 80px">
|
||||
<label for="roomId" class="bmd-label-floating">房间号:</label>
|
||||
<input type="text" class="form-control" name="roomId" id="roomId" maxlength="18">
|
||||
</div>
|
||||
<div style="height: 24px"></div>
|
||||
<!-- 登录 -->
|
||||
<button id="login-btn" type="button" class="btn btn-raised btn-primary"
|
||||
style="width: 100%; height: 40px">进入房间
|
||||
<div class="ripple-container"></div>
|
||||
</button>
|
||||
<!-- 摄像头 麦克风 -->
|
||||
<div class="row-div" style="width: 100%; height: 105px; justify-content: center">
|
||||
<img id="camera" style="height: 27px" src="./img/camera.png" onClick="event.cancelBubble = true"
|
||||
data-toggle="popover" data-placement="top" title="" data-content="">
|
||||
<!-- 选择摄像头 -->
|
||||
<div id="camera-option" style="display: none"></div>
|
||||
<div style="width: 100px"></div>
|
||||
<img id="microphone" style="height: 27px" src="./img/mic.png"
|
||||
onClick="event.cancelBubble = true" data-toggle="popover" data-placement="top" title=""
|
||||
data-content="">
|
||||
<!-- 选择麦克风 -->
|
||||
<div id="mic-option" style="display: none"></div>
|
||||
</div>
|
||||
<!-- 设备检测按钮 -->
|
||||
<div id="device-testing-btn" class="device-testing-btn">
|
||||
<div class="device-icon">
|
||||
<svg class="icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-shebei"></use>
|
||||
</svg>
|
||||
</div>
|
||||
设备检测
|
||||
</div>
|
||||
<div id="device-connect-list" class="device-connect-list" style="display: none;">
|
||||
<div id="connect-camera" class="connect icon-normal">
|
||||
<svg class="icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-shiping-xue"></use>
|
||||
</svg>
|
||||
</div>
|
||||
<div id="connect-voice" class="connect icon-normal">
|
||||
<svg class="icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-shengyin"></use>
|
||||
</svg>
|
||||
</div>
|
||||
<div id="connect-mic" class="connect icon-normal">
|
||||
<svg class="icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-maikefeng-xue"></use>
|
||||
</svg>
|
||||
</div>
|
||||
<div id="connect-network" class="connect icon-normal">
|
||||
<svg class="icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-wangluo"></use>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- 设备检测界面弹窗 -->
|
||||
@ -409,7 +350,22 @@
|
||||
</div>
|
||||
<script>
|
||||
|
||||
function GetRequest() {
|
||||
var url = location.search; //获取url中"?"符后的字串
|
||||
var theRequest = new Object();
|
||||
if(url.indexOf("?") != -1) {
|
||||
var str = url.substr(1);
|
||||
strs = str.split("&");
|
||||
for(var i = 0; i < strs.length; i++) {
|
||||
theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
|
||||
}
|
||||
}
|
||||
return theRequest;
|
||||
};
|
||||
window.url = 'https://case.sy-my.net/beelink/public/home/'
|
||||
const urldata = GetRequest('roomid')
|
||||
window.roomid = urldata.roomid
|
||||
window.mid = urldata.memberid
|
||||
</script>
|
||||
<script src="./js/jquery-3.2.1.min.js"></script>
|
||||
<script src="./js/popper.js"></script>
|
||||
|
@ -1,18 +1,29 @@
|
||||
<template>
|
||||
<iframe style="width:100%;height: 100%" src="/zhibo.html" frameborder="0"></iframe>
|
||||
<iframe style="width:100%;height: 100%" :src="url" frameborder="0"></iframe>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import { getliveinfo } from '@/api';
|
||||
import { defineComponent, ref } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
|
||||
export default defineComponent({
|
||||
setup(){
|
||||
return {
|
||||
const id = useRoute().query.id;
|
||||
const url = ref<string>()
|
||||
if(id && typeof id == 'string'){
|
||||
getliveinfo(parseInt(id)).then((res: any)=>{
|
||||
url.value = `/zhibo.html?roomid=${res.roomid}&memberid=${res.memberid}`
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
return {
|
||||
url
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user