mirror of
https://github.com/alireza0/x-ui.git
synced 2026-03-14 05:23:09 +00:00
0.2.0
- 优化 ui 界面 - 优化网站加载速度 - 新增从 v2-ui 迁移账号数据的功能
This commit is contained in:
@@ -11,6 +11,19 @@ import (
|
||||
type UserService struct {
|
||||
}
|
||||
|
||||
func (s *UserService) GetFirstUser() (*model.User, error) {
|
||||
db := database.GetDB()
|
||||
|
||||
user := &model.User{}
|
||||
err := db.Model(model.User{}).
|
||||
First(user).
|
||||
Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return user, nil
|
||||
}
|
||||
|
||||
func (s *UserService) CheckUser(username string, password string) *model.User {
|
||||
db := database.GetDB()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user