瀏覽代碼

赋值角色时带上过期时间

Muninn 6 年之前
父節點
當前提交
20ec895d83
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2
    1
      agora.go

+ 2
- 1
agora.go 查看文件

@@ -78,7 +78,8 @@ func CreateSimpleTokenBuilder(appID, appCertificate, channelName string, uid uin
78 78
 	return SimpleTokenBuilder{CreateAccessToken(appID, appCertificate, channelName, uid)}
79 79
 }
80 80
 
81
-func (builder *SimpleTokenBuilder) InitPrivileges(role Role) {
81
+// InitPrivileges expireTimestamp 为0时长期有效
82
+func (builder *SimpleTokenBuilder) InitPrivileges(role Role, expireTimestamp uint32) {
82 83
 	rolepri := uint16(role)
83 84
 	for key, value := range RolePrivileges[rolepri] {
84 85
 		builder.Token.Message[key] = value