网关重启时恢复权限与分配数据
This commit is contained in:
@@ -23,8 +23,9 @@ func Online(name string) (err error) {
|
||||
}
|
||||
|
||||
var body struct {
|
||||
Id int32 `json:"id"`
|
||||
Secret string `json:"secret"`
|
||||
Id int32 `json:"id"`
|
||||
Secret string `json:"secret"`
|
||||
Permits []core.PermitDef `json:"permits"`
|
||||
}
|
||||
err = json.Unmarshal([]byte(resp), &body)
|
||||
if err != nil {
|
||||
@@ -33,6 +34,9 @@ func Online(name string) (err error) {
|
||||
|
||||
app.Id = body.Id
|
||||
app.PlatformSecret = body.Secret
|
||||
for _, def := range body.Permits {
|
||||
app.Permits.Store(def.Id, &def.Permit)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user