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