Quellcode durchsuchen

:art: The captcha on the auth page uses a white background Fix https://github.com/siyuan-note/siyuan/issues/8645

Daniel vor 2 Jahren
Ursprung
Commit
d94893f9a6
2 geänderte Dateien mit 3 neuen und 1 gelöschten Zeilen
  1. 1 1
      app/stage/auth.html
  2. 2 0
      kernel/model/session.go

+ 1 - 1
app/stage/auth.html

@@ -187,7 +187,7 @@
     <h1 style="margin-bottom: 48px;color:var(--b3-theme-on-background)">{{.workspace}}</h1>
     <input class="b3-text-filed" id="authCode" type="password" placeholder="{{.l0}}"/><br>
     <div style="position: relative;width: 240px;margin: 8px auto 0;display: none">
-        <img id="captchaImg" style="top: 1px;position: absolute;height: 28px;right: 1px;cursor: pointer">
+        <img id="captchaImg" style="top: 1px;position: absolute;height: 27px;right: 1px;cursor: pointer">
         <input id="captcha" class="b3-text-filed" placeholder="{{.l3}}">
     </div>
     <button class="b3-button" onclick="submitAuth()">{{.l1}}</button>

+ 2 - 0
kernel/model/session.go

@@ -17,6 +17,7 @@
 package model
 
 import (
+	"image/color"
 	"net/http"
 	"net/url"
 	"os"
@@ -118,6 +119,7 @@ func GetCaptcha(c *gin.Context) {
 		options.CharPreset = "ABCDEFGHKLMNPQRSTUVWXYZ23456789"
 		options.Noise = 0.5
 		options.CurveNumber = 0
+		options.BackgroundColor = color.White
 	})
 	if nil != err {
 		logging.LogErrorf("generates captcha failed: " + err.Error())