feat: Implement S2A OAuth authorization using chromedp and rod browser automation, and integrate it into team processing.
This commit is contained in:
@@ -731,13 +731,17 @@ func processSingleTeam(idx int, req TeamProcessRequest) (result TeamProcessResul
|
||||
logger.Warning(fmt.Sprintf("%s 入库重试 (第%d次)", memberLogPrefix, attempt+1), memberChild.Email, "team")
|
||||
}
|
||||
|
||||
// 创建日志回调(只输出关键日志)
|
||||
// 创建日志回调(输出关键日志和调试信息)
|
||||
authLogger := auth.NewAuthLogger(memberChild.Email, logPrefix, memberIdx+1, func(entry auth.AuthLogEntry) {
|
||||
// 只输出错误和关键步骤
|
||||
if entry.IsError {
|
||||
logger.Error(fmt.Sprintf("%s %s", memberLogPrefix, entry.Message), memberChild.Email, "team")
|
||||
} else if entry.Step == auth.StepComplete || entry.Step == auth.StepConsent || entry.Step == auth.StepSelectWorkspace {
|
||||
logger.Info(fmt.Sprintf("%s %s", memberLogPrefix, entry.Message), memberChild.Email, "team")
|
||||
} else {
|
||||
// 输出关键步骤:导航、输入、完成等
|
||||
switch entry.Step {
|
||||
case auth.StepNavigate, auth.StepInputEmail, auth.StepInputPassword,
|
||||
auth.StepComplete, auth.StepConsent, auth.StepSelectWorkspace:
|
||||
logger.Info(fmt.Sprintf("%s %s", memberLogPrefix, entry.Message), memberChild.Email, "team")
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -826,12 +830,16 @@ func processSingleTeam(idx int, req TeamProcessRequest) (result TeamProcessResul
|
||||
logger.Warning(fmt.Sprintf("%s 入库重试 (第%d次)", ownerLogPrefix, attempt+1), owner.Email, "team")
|
||||
}
|
||||
|
||||
// 创建日志回调(只输出关键日志)
|
||||
// 创建日志回调(输出关键日志和调试信息)
|
||||
authLogger := auth.NewAuthLogger(owner.Email, logPrefix, 0, func(entry auth.AuthLogEntry) {
|
||||
if entry.IsError {
|
||||
logger.Error(fmt.Sprintf("%s %s", ownerLogPrefix, entry.Message), owner.Email, "team")
|
||||
} else if entry.Step == auth.StepComplete || entry.Step == auth.StepConsent || entry.Step == auth.StepSelectWorkspace {
|
||||
logger.Info(fmt.Sprintf("%s %s", ownerLogPrefix, entry.Message), owner.Email, "team")
|
||||
} else {
|
||||
switch entry.Step {
|
||||
case auth.StepNavigate, auth.StepInputEmail, auth.StepInputPassword,
|
||||
auth.StepComplete, auth.StepConsent, auth.StepSelectWorkspace:
|
||||
logger.Info(fmt.Sprintf("%s %s", ownerLogPrefix, entry.Message), owner.Email, "team")
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user