commit
This commit is contained in:
@@ -781,6 +781,31 @@ func (ctrl *EmployeeController) SaveQRCodeLogin(c *gin.Context) {
|
||||
common.SuccessWithMessage(c, "绑定成功", nil)
|
||||
}
|
||||
|
||||
// SaveLogin 保存验证码登录的绑定信息
|
||||
func (ctrl *EmployeeController) SaveLogin(c *gin.Context) {
|
||||
var req struct {
|
||||
EmployeeID int `json:"employee_id" binding:"required"`
|
||||
CookiesFull []interface{} `json:"cookies_full"`
|
||||
StorageState map[string]interface{} `json:"storage_state"`
|
||||
StorageStatePath string `json:"storage_state_path"`
|
||||
UserInfo map[string]interface{} `json:"user_info"` // 新增: 用户信息
|
||||
}
|
||||
|
||||
if err := c.ShouldBindJSON(&req); err != nil {
|
||||
common.Error(c, common.CodeInvalidParams, "参数错误")
|
||||
return
|
||||
}
|
||||
|
||||
// 调用service层保存
|
||||
err := ctrl.service.SaveLogin(req.EmployeeID, req.CookiesFull, req.StorageState, req.StorageStatePath, req.UserInfo)
|
||||
if err != nil {
|
||||
common.Error(c, common.CodeInternalError, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
common.SuccessWithMessage(c, "绑定成功", nil)
|
||||
}
|
||||
|
||||
// StartQRCodeLogin 启动扫码登录,转发到Python服务
|
||||
func (ctrl *EmployeeController) StartQRCodeLogin(c *gin.Context) {
|
||||
employeeID := c.GetInt("employee_id")
|
||||
|
||||
Reference in New Issue
Block a user