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

@@ -5,11 +5,18 @@ import (
"time"
)
const randChar = "0123456789abcdefghigklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
const Nums = "0123456789"
const LowerChars = "abcdefghigklmnopqrstuvwxyz"
const UpperChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
// 生成随机字符串
func Rand(l int) string {
strList := []byte(randChar)
return RandByChars(l, Nums+LowerChars+UpperChars)
}
// 根据传入的chars随机生成指定位数的字符串
func RandByChars(l int, chars string) string {
strList := []byte(chars)
result := []byte{}
i := 0