feat: 机器列表新增运行状态 & refactor: 登录账号信息存储与context

This commit is contained in:
meilin.huang
2023-11-07 21:05:21 +08:00
parent d9adf0fd25
commit eddda41291
74 changed files with 915 additions and 652 deletions

View File

@@ -13,6 +13,11 @@ func ToMap(jsonStr string) map[string]any {
return ToMapByBytes([]byte(jsonStr))
}
// json字符串转结构体
func To[T any](jsonStr string, res T) (T, error) {
return res, json.Unmarshal([]byte(jsonStr), &res)
}
// json字节数组转map
func ToMapByBytes(bytes []byte) map[string]any {
var res map[string]any