File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
src/main/java/org/b3log/symphony/processor/middleware Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -175,6 +175,7 @@ public void handle(final RequestContext context) {
175175
176176 final Request request = context .getRequest ();
177177 final String requestURI = context .requestURI ();
178+ final boolean firstVisitArticle = requestURI .startsWith (Latkes .getContextPath () + "/article/" );
178179 JSONObject currentUser = Sessions .getUser ();
179180 try {
180181 currentUser = ApiProcessor .getUserByKey (context .param ("apiKey" ));
@@ -207,7 +208,10 @@ public void handle(final RequestContext context) {
207208
208209 // 2 小时内首次访问:第一次就需要验证码(可单独开关)
209210 Long lastPassTime = ipLastCaptchaPassTimeCache .getIfPresent (ip );
210- if (firstVisitCaptchaEnabled && lastPassTime == null && (now - firstVisitTime ) <= 2L * 60L * 60L * 1000L ) {
211+ if (firstVisitCaptchaEnabled
212+ && !firstVisitArticle
213+ && lastPassTime == null
214+ && (now - firstVisitTime ) <= 2L * 60L * 60L * 1000L ) {
211215 if (count == 1 ) {
212216 needCaptcha = true ;
213217 }
You can’t perform that action at this time.
0 commit comments