优化了登录
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user