代码拉取完成,页面将自动刷新
/**
* 基础鉴权 token 生成示例
*/
const { generateToken04 } = require('../server/zegoServerAssistant');
// 请将 appID 修改为你的 appId,appid 为 数字
// 举例:1234567890
const appID = ; // type: number
// 请将 serverSecret 修改为你的 serverSecret,serverSecret 为 string
// 举例:'sdfsdfsd323sdfsdf'
const serverSecret = ;// type: 32 byte length string
// 请将 userId 修改为用户的 userId
const userId = 'user1';// type: string
const effectiveTimeInSeconds = 3600; //type: number; unit: s; token 过期时间,单位:秒
//生成基础鉴权 token时,payload 要设为空字符串
const payload = '';
// Build token
const token = generateToken04(appID, userId, serverSecret, effectiveTimeInSeconds, payload);
console.log('token:',token);
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。