auth.go
1.2 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
package protocol
//指定的请求头字段
const (
HeaderAccessToken string = "x-mmm-accesstoken"
HeaderRefreshToken string = "x-mmm-refreshtoken"
HeaderUID string = "x-mmm-uid"
HeaderUUID string = "x-mmm-uuid"
HeaderTimestamp string = "x-mmm-timestamp"
HeaderDevicetype string = "x-mmm-devicetype"
HeaderAppproject string = "x-mmm-appproject"
HeaderSign string = "x-mmm-sign"
)
//BaseHeader 请求的header数据
//减少在具体业务方法中使用 this.Ctx.Input.Header("xxxx")
type BaseHeader struct {
AccessToken string
RefreshToken string
AppProject string
Devicetype string
Sign string
UUID string
Timestamp int
UID int
}
//RequestLogin 登录请求
type RequestLogin struct {
Account string `json:"account"`
Password string `json:"password"`
}
//ResponseLogin 登录响应
type ResponseLogin struct {
LoginAuthToken
}
type LoginAuthToken struct {
AccessToken string `json:"access_token"`
ExpiresIn int64 `json:"expires_in"`
RefreshToken string `json:"refresh_token"`
RefreshExpires int64 `json:"refresh_expires"`
}
//RequestSwapCompany 切换公司
type RequestSwapCompany struct {
}
// ResponseSwapCompany ...
type ResponseSwapCompany struct {
}