1234567891011121314151617181920212223242526272829303132333435363738 |
- import { GET_SIG, GET_ARGOA_SIG, GET_COMMON_SIG } from '../utils/apiList'
- import { request, Response } from '../utils/http'
- interface SingResType {
- expire: number | string,
- sdkAppId: number | string,
- sign: string,
- operatorType: number
- }
- type RoomDetailRes = Response & {
- data: SingResType
- }
- // export const getRTCSig = async (userId: string): Promise<SingResType> => {
- // const res = await request.get<RoomDetailRes>(GET_SIG, {
- // userId
- // })
- // return res.data
- // }
- export const getRTCSig = async (userId: string | number, roleId: string | number, channelName: string): Promise<SingResType> => {
- const res = await request.get<RoomDetailRes>(GET_COMMON_SIG, {
- userId,
- roleId,
- channelName
- })
- return res.code === 0 ? res.data : {
- sdkAppId: '',
- expire: '',
- sign: '',
- operatorType: -1
- }
- }
|