mirror of https://github.com/v2ray/v2ray-core
parent
9d2407f4e4
commit
68b85cce60
@ -1,22 +0,0 @@
|
||||
// +build json
|
||||
|
||||
package vmess
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
func (u *Account) UnmarshalJSON(data []byte) error {
|
||||
type JsonConfig struct {
|
||||
ID string `json:"id"`
|
||||
AlterIds uint16 `json:"alterId"`
|
||||
}
|
||||
var rawConfig JsonConfig
|
||||
if err := json.Unmarshal(data, &rawConfig); err != nil {
|
||||
return err
|
||||
}
|
||||
u.Id = rawConfig.ID
|
||||
u.AlterId = uint32(rawConfig.AlterIds)
|
||||
|
||||
return nil
|
||||
}
|
Loading…
Reference in new issue