| 12345678910111213141516171819202122232425 |
- package controller
- import (
- "git.wanbits.cc/sin/flytalk/config"
- "git.wanbits.cc/sin/flytalk/models"
- "git.wanbits.cc/sin/flytalk/tools"
- )
- func CheckKefuPass(username string, password string) (models.User, models.User_role, bool) {
- info := models.FindUser(username)
- var uRole models.User_role
- if info.Name == "" || info.Password != tools.Md5(password) {
- return info, uRole, false
- }
- uRole = models.FindRoleByUserId(info.ID)
- return info, uRole, true
- }
- //验证是否已经登录
- func AuthCheck(uid string) map[string]string {
- info := config.GetUserInfo(uid)
- return info
- }
|