Browse Source

赋值角色时带上过期时间

Muninn 6 years ago
parent
commit
20ec895d83
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      agora.go

+ 2
- 1
agora.go View File

@@ -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