|
|
|
/*
|
|
|
|
* @desc:登录
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @Date: 2022/4/27 21:51
|
|
|
|
*/
|
|
|
|
|
|
|
|
package system
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
|
|
model2 "tyj_admin/internal/model"
|
|
|
|
)
|
|
|
|
|
|
|
|
type UserLoginReq struct {
|
|
|
|
g.Meta `path:"/login" tags:"登录" method:"post" summary:"用户登录"`
|
|
|
|
Username string `p:"username" v:"required#用户名不能为空"`
|
|
|
|
Password string `p:"password" v:"required#密码不能为空"`
|
|
|
|
//VerifyCode string `p:"verifyCode" v:"required#验证码不能为空"`
|
|
|
|
//VerifyKey string `p:"verifyKey"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type UserLoginRes struct {
|
|
|
|
g.Meta `mime:"application/json"`
|
|
|
|
UserInfo *model2.LoginUserRes `json:"userInfo"`
|
|
|
|
Token string `json:"token"`
|
|
|
|
MenuList []*model2.UserMenus `json:"menuList"`
|
|
|
|
Permissions []string `json:"permissions"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type UserLoginMobileReq struct {
|
|
|
|
g.Meta `path:"/loginMobile" tags:"登录" method:"post" summary:"用户登录"`
|
|
|
|
Phone string `p:"userName" v:"required#手机号不能为空"`
|
|
|
|
Code string `p:"code" v:"required#验证码不能为空"`
|
|
|
|
//VerifyCode string `p:"verifyCode" v:"required#验证码不能为空"`
|
|
|
|
//VerifyKey string `p:"verifyKey"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type UserLoginMobileRes struct {
|
|
|
|
g.Meta `mime:"application/json"`
|
|
|
|
UserInfo *model2.LoginUserRes `json:"userInfo"`
|
|
|
|
Token string `json:"token"`
|
|
|
|
MenuList []*model2.UserMenus `json:"menuList"`
|
|
|
|
Permissions []string `json:"permissions"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type MobileCodeReq struct {
|
|
|
|
g.Meta `path:"/mobileCode" tags:"登录" method:"post" summary:"手机验证码"`
|
|
|
|
Phone string `p:"userName" v:"required#手机号不能为空"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type MobileCodeRes struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
type UserLoginOutReq struct {
|
|
|
|
g.Meta `path:"/loginOut" tags:"登录" method:"delete" summary:"退出登录"`
|
|
|
|
Authorization string `p:"Authorization" in:"header" dc:"Bearer {{token}}"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type UserLoginOutRes struct {
|
|
|
|
}
|