xbx #66
10
package.json
10
package.json
@ -22,8 +22,8 @@
|
||||
"vuex": "^4.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "^4.4.1",
|
||||
"@typescript-eslint/parser": "^4.4.1",
|
||||
"@typescript-eslint/eslint-plugin": "^2.33.0",
|
||||
"@typescript-eslint/parser": "^2.33.0",
|
||||
"@vue/cli-plugin-babel": "~4.5.0",
|
||||
"@vue/cli-plugin-eslint": "~4.5.0",
|
||||
"@vue/cli-plugin-router": "~4.5.0",
|
||||
@ -31,12 +31,12 @@
|
||||
"@vue/cli-plugin-vuex": "~4.5.0",
|
||||
"@vue/cli-service": "~4.5.0",
|
||||
"@vue/compiler-sfc": "^3.0.0-0",
|
||||
"@vue/eslint-config-typescript": "^7.0.0",
|
||||
"eslint": "^7.11.0",
|
||||
"@vue/eslint-config-typescript": "^5.0.2",
|
||||
"eslint": "^6.7.2",
|
||||
"eslint-plugin-vue": "^7.0.0-0",
|
||||
"node-sass": "^4.14.1",
|
||||
"sass-loader": "^10.0.2",
|
||||
"typescript": "~4.0.3"
|
||||
"typescript": "~3.9.3"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
|
@ -809,3 +809,16 @@ export async function refusedtolive(signupid: number, msg: string){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取直播签名
|
||||
*/
|
||||
|
||||
export async function usersig(userid: number) {
|
||||
const res = await get<string>("userSig",{userid});
|
||||
if(res.code != 0){
|
||||
message.error(res.msg)
|
||||
return '';
|
||||
}
|
||||
return res.data;
|
||||
}
|
@ -191,6 +191,7 @@ import { defineComponent, onMounted } from "vue";
|
||||
import LivePlaying from "@/components/LivePlaying.vue";
|
||||
import LiveingWatcher from "@/components/LiveingWatcher.vue";
|
||||
import TRTC from "trtc-js-sdk"
|
||||
import { usersig } from '@/api';
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
@ -202,8 +203,11 @@ export default defineComponent({
|
||||
let client: any;
|
||||
let localStream: any;
|
||||
let statie = true;
|
||||
onMounted(()=>{
|
||||
init(pingmu);
|
||||
let userSing = '';
|
||||
onMounted(async ()=>{
|
||||
userSing = await usersig(10);
|
||||
|
||||
init(pingmu, userSing);
|
||||
|
||||
})
|
||||
function fenxiang(){
|
||||
@ -220,10 +224,11 @@ export default defineComponent({
|
||||
// console.error('leaving room failed: ' + error);
|
||||
// });
|
||||
// });
|
||||
init(statie ? shexiang : pingmu);
|
||||
init(statie ? shexiang : pingmu, userSing);
|
||||
statie = !statie;
|
||||
}
|
||||
function init(fun: any){
|
||||
function init(fun: any, userSig: string){
|
||||
console.log(userSig)
|
||||
const el = document.querySelector("#local_stream");
|
||||
if(el){
|
||||
el.innerHTML = ""
|
||||
@ -232,7 +237,7 @@ export default defineComponent({
|
||||
mode: 'rtc',
|
||||
sdkAppId: '1400400340',
|
||||
userId: 10,
|
||||
userSig: 'cf1e5db5d230ce6fee3fa23ba779c68a597dd229c11cd9ee315e5ffd6b9bf415'
|
||||
userSig: userSig
|
||||
});
|
||||
client
|
||||
.join({ roomId: 11 })
|
||||
|
Loading…
Reference in New Issue
Block a user