This commit is contained in:
sjk
2026-01-09 23:27:52 +08:00
parent 8446c004e7
commit 3b66018271
18 changed files with 2006 additions and 508 deletions

View File

@@ -42,13 +42,20 @@ func (ctrl *EmployeeController) SendXHSCode(c *gin.Context) {
// 获取当前登录用户ID
employeeID := c.GetInt("employee_id")
err := ctrl.service.SendXHSCode(req.XHSPhone, employeeID)
data, err := ctrl.service.SendXHSCode(req.XHSPhone, employeeID)
if err != nil {
common.Error(c, common.CodeInternalError, err.Error())
return
}
common.SuccessWithMessage(c, "验证码已发送请在小红书APP中查看", nil)
// 检查是否需要扫码验证
if needCaptcha, ok := data["need_captcha"].(bool); ok && needCaptcha {
// 发送验证码时触发风控,返回二维码
common.SuccessWithMessage(c, "需要扫码验证", data)
return
}
common.SuccessWithMessage(c, "验证码已发送请在小红书APP中查看", data)
}
// GetProfile 获取员工个人信息

View File

@@ -36,6 +36,13 @@ func (ctrl *XHSController) SendCode(c *gin.Context) {
return
}
// 检查是否需要扫码验证
if needCaptcha, ok := result.Data["need_captcha"].(bool); ok && needCaptcha {
// 发送验证码时触发风控,返回二维码
common.SuccessWithMessage(c, result.Message, result.Data)
return
}
// 判断Python服务返回的结果
if result.Code != 0 {
common.Error(c, result.Code, result.Message)