Browse Source

增加打印

Signed-off-by: zouap <zouap@pcl.ac.cn>
pull/3538/head
zouap 2 years ago
parent
commit
5153875bc7
2 changed files with 9 additions and 4 deletions
  1. +9
    -3
      routers/user/auth.go
  2. +0
    -1
      web_src/less/openi.less

+ 9
- 3
routers/user/auth.go View File

@@ -276,7 +276,7 @@ func SignInPostAPI(ctx *context.Context) {

func SignInPostCommon(ctx *context.Context, form auth.SignInForm) {
ctx.Data["Title"] = ctx.Tr("sign_in")
log.Info("here111")
orderedOAuth2Names, oauth2Providers, err := models.GetActiveOAuth2Providers()
if err != nil {
ctx.ServerError("UserSignIn", err)
@@ -291,7 +291,7 @@ func SignInPostCommon(ctx *context.Context, form auth.SignInForm) {
ctx.Data["IsCourse"] = ctx.QueryBool("course")
ctx.Data["EnableSSPI"] = models.IsSSPIEnabled()
ctx.Data["EnableCloudBrain"] = true
log.Info("here222")
if ctx.HasError() {
ctx.HTML(200, tplSignIn)
return
@@ -326,6 +326,7 @@ func SignInPostCommon(ctx *context.Context, form auth.SignInForm) {
return
}
models.SaveLoginInfoToDb(ctx.Req.Request, u)
log.Info("here333")
// If this user is enrolled in 2FA, we can't sign the user in just yet.
// Instead, redirect them to the 2FA authentication page.
_, err = models.GetTwoFactorByUID(u.ID)
@@ -337,6 +338,7 @@ func SignInPostCommon(ctx *context.Context, form auth.SignInForm) {
}
return
}
log.Info("here444")
// User needs to use 2FA, save data and redirect to 2FA page.
if err := ctx.Session.Set("twofaUid", u.ID); err != nil {
ctx.ServerError("UserSignIn: Unable to set twofaUid in session", err)
@@ -368,6 +370,7 @@ func SignInCloudBrainPost(ctx *context.Context, form auth.SignInForm) {

// SignInPost response for sign in request
func SignInPost(ctx *context.Context, form auth.SignInForm) {
log.Info("here99999")
ctx.Data["PageIsLogin"] = true
ctx.Data["SignInLink"] = setting.AppSubURL + "/user/login"
ctx.Data["ActivityTpl"] = getActivityTpl()
@@ -747,6 +750,7 @@ func handleSignInFull(ctx *context.Context, u *models.User, remember bool, obeyR

// Register last login
u.SetLastLogin()
log.Info("77777_2222")
if err := models.UpdateUserCols(u, "last_login_unix"); err != nil {
ctx.ServerError("UpdateUserCols", err)
return setting.AppSubURL + "/dashboard"
@@ -758,14 +762,16 @@ func handleSignInFull(ctx *context.Context, u *models.User, remember bool, obeyR
ctx.RedirectToFirst(redirectToCourse)
return redirectToCourse
}
log.Info("77777_777")
if redirectTo := ctx.GetCookie("redirect_to"); len(redirectTo) > 0 && !util.IsExternalURL(redirectTo) {
log.Info("77777_8888")
ctx.SetCookie("redirect_to", "", -1, setting.AppSubURL, "", setting.SessionConfig.Secure, true)
if obeyRedirect {
ctx.RedirectToFirst(redirectTo)
}
return redirectTo
}
log.Info("77777_99999")
if obeyRedirect {
ctx.Redirect(setting.AppSubURL + "/dashboard")
}


+ 0
- 1
web_src/less/openi.less View File

@@ -298,7 +298,6 @@ footer .column {
background-position: -496px -52px;
background-position: -459px -52px;
}
.TESTING,
.RUNNING {
display: inline-block;
width: 18px;


Loading…
Cancel
Save