-
Notifications
You must be signed in to change notification settings - Fork 70
/
user.go
40 lines (33 loc) · 1.15 KB
/
user.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package users
import "github.com/i-Things/things/shared/utils"
// phone 手机号 wxOpen 微信开放平台 wxIn 微信内 wxMiniP 微信小程序 pwd 账号密码
const (
RegPhone = "phone" //手机号 (企业版)
RegWxOpen = "wxOpen" //微信开放平台登录(企业版)
RegWxIn = "wxIn" //微信内登录(企业版)
RegWxMiniP = "wxMiniP" //微信小程序(企业版)
RegPwd = "pwd" //账号密码注册
)
type UserInfoType uint8
const (
Uid UserInfoType = iota //用户UID
InviterUid //邀请人用户id
UserName //用户登录名
GroupId //用户组id
Email //邮箱
Phone //手机号
Wechat //微信
InfoMax //结束
AuthId //权限id
)
type UserStatus = int64
const (
NotRegisterStatus UserStatus = iota //未注册完成状态只注册了第一步
NormalStatus //正常状态
)
func GetLoginNameType(userName string) UserInfoType {
if utils.IsMobile(userName) == true {
return Phone
}
return UserName
}