mirror of
https://github.com/weloe/token-go.git
synced 2025-10-28 09:51:32 +08:00
feat: add QRCode state api, support QRCode login
This commit is contained in:
23
model/qrcode.go
Normal file
23
model/qrcode.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package model
|
||||
|
||||
type QRCodeState int
|
||||
|
||||
// QRCode State
|
||||
const (
|
||||
WaitScan QRCodeState = 1
|
||||
WaitAuth QRCodeState = 2
|
||||
ConfirmAuth QRCodeState = 3
|
||||
CancelAuth QRCodeState = 4
|
||||
Expired QRCodeState = 5
|
||||
)
|
||||
|
||||
type QRCode struct {
|
||||
id string
|
||||
State QRCodeState
|
||||
LoginId string
|
||||
Ticket string
|
||||
}
|
||||
|
||||
func NewQRCode(id string) *QRCode {
|
||||
return &QRCode{id: id, State: WaitScan}
|
||||
}
|
||||
Reference in New Issue
Block a user