token 简化

This commit is contained in:
2024-12-02 11:11:40 +08:00
parent 51c8a7fe2e
commit 06070edded
5 changed files with 15 additions and 31 deletions

View File

@@ -36,6 +36,13 @@ func InitDefault(config *viper.Viper) {
}
}
func ParseToken(token string) (user_id int) {
if err := db.Table("web_auth").Select("user_id").Where("token = ?", token).Scan(&user_id).Error; err != nil {
fmt.Println("token解析失败", err)
}
return user_id
}
// 定时检查补全颜色字段
func CheckColorNullRows(offset int) {
for {