This commit is contained in:
haoouba 2021-05-22 18:10:06 +08:00
parent 4e82b7cfe9
commit bbaa2acbb0
13 changed files with 15 additions and 68 deletions

File diff suppressed because one or more lines are too long

View File

@ -3231,11 +3231,6 @@
right: 0;
}
}
&.captcha {
display: flex;
align-items: center;
justify-content: space-between;
}
}
}
.body {

View File

@ -323,19 +323,16 @@ document.addEventListener('DOMContentLoaded', () => {
let isSubmit = false;
$('.joe_comment__respond-form').on('submit', function (e) {
e.preventDefault();
const url = $('.joe_comment__respond-form').attr('action') + '?time=' + +new Date();
const action = $('.joe_comment__respond-form').attr('action') + '?time=' + +new Date();
const type = $('.joe_comment__respond-form').attr('data-type');
const parent = $('.joe_comment__respond-form').attr('data-coid');
const author = $(".joe_comment__respond-form .head input[name='author']").val();
const _ = $(".joe_comment__respond-form input[name='_']").val();
const mail = $(".joe_comment__respond-form .head input[name='mail']").val();
const url = $(".joe_comment__respond-form .head input[name='url']").val();
let text = $(".joe_comment__respond-form .body textarea[name='text']").val();
if (author.trim() === '') return Qmsg.info('请输入昵称!');
if (!/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(mail)) return Qmsg.info('请输入正确的邮箱!');
/* -- 验证码前端校验 -- */
const captcha = $(".joe_comment__respond-form .head input[name='captcha']").val();
if (captcha.trim() === '') return Qmsg.info('请输入验证码!');
/* -- 验证码前端校验 -- */
if (type === 'text' && text.trim() === '') return Qmsg.info('请输入评论内容!');
if (type === 'draw') {
const txt = $('#joe_comment_draw')[0].toDataURL('image/webp', 0.1);
@ -345,9 +342,9 @@ document.addEventListener('DOMContentLoaded', () => {
isSubmit = true;
$('.joe_comment__respond-form .foot .submit button').html('发送中...');
$.ajax({
url,
url: action,
type: 'POST',
data: { author, mail, text, parent, captcha, _ },
data: { author, mail, text, parent, url, _ },
dataType: 'text',
success(res) {
let arr = [],

File diff suppressed because one or more lines are too long

View File

@ -14,9 +14,9 @@
<head>
<?php $this->need('public/include.php'); ?>
<link rel="stylesheet" href="<?php $this->options->themeUrl('assets/css/joe.census.min.css?v=20210522'); ?>">
<link rel="stylesheet" href="<?php $this->options->themeUrl('assets/css/joe.census.min.css'); ?>">
<script src="https://cdn.jsdelivr.net/npm/echarts@5.1.1/dist/echarts.min.js"></script>
<script src="<?php $this->options->themeUrl('assets/js/joe.census.min.js?v=20210522'); ?>"></script>
<script src="<?php $this->options->themeUrl('assets/js/joe.census.min.js'); ?>"></script>
</head>
<body>

View File

@ -1,35 +0,0 @@
<?php
session_start();
header("Content-type: image/png");
$image = imagecreatetruecolor(85, 25);
$bgcolor = imagecolorallocate($image, 255, 255, 255);
imagecolortransparent($image, $bgcolor);
imagefill($image, 0, 0, $bgcolor);
$content = "0123456789";
$captcha = "";
/* 绘制干扰点 */
for ($i = 0; $i < 80; $i++) {
$pointColor = imagecolorallocate($image, rand(100, 255), rand(100, 255), rand(100, 255));
imagesetpixel($image, rand(0, 85), rand(0, 25), $pointColor);
}
/* 绘制验证码 */
for ($i = 0; $i < 4; $i++) {
$fontSize = 10;
$fontColor = imagecolorallocate($image, 155, 155, 155);
$fontContent = rand(0, 9);
$captcha .= $fontContent;
$x = ($i * 85 / 4) + 7;
$y = rand(3, 8);
imagestring($image, $fontSize, $x, $y, $fontContent, $fontColor);
}
$_SESSION["captcha"] = $captcha;
imagepng($image);
imagedestroy($image);

View File

@ -70,9 +70,6 @@ function themeInit($self)
case 'article_filing':
_getArticleFiling($self);
break;
case 'article_filing_list':
_getArticleFilingList($self);
break;
};
}

View File

@ -9,12 +9,6 @@ class Intercept
{
public static function message($comment)
{
/* 校验验证码是否正确 */
session_start();
$captcha = (int)Typecho_Request::getInstance()->captcha;
if (!$captcha) throw new Typecho_Widget_Exception('请输入验证码!', 403);
if ($captcha != $_SESSION['captcha']) throw new Typecho_Widget_Exception('验证码错误,请检查!', 403);
/* 用户输入内容画图模式 */
if (preg_match('/\{!\{(.*)\}!\}/', $comment['text'], $matches)) {
/* 如果判断是否有双引号,如果有双引号,则禁止评论 */

View File

@ -2,7 +2,7 @@
/* 获取主题当前版本号 */
function _getVersion()
{
return "7.0.9";
return "7.1.0";
};
/* 判断是否是手机 */

View File

@ -329,7 +329,7 @@ function _getServerStatus($self)
/* 状态 */
"status" => $response ? true : false,
/* 信息提示 */
"message" => $response['msg'] ? $response['msg'] : '无',
"message" => $response['msg'],
/* 上行流量KB */
"up" => $response["up"] ? $response["up"] : 0,
/* 下行流量KB */

View File

@ -1,6 +1,6 @@
{
"name": "typecho-joe-next",
"version": "7.0.9",
"version": "7.1.0",
"description": "A Theme Of Typecho",
"main": "index.php",
"keywords": [

View File

@ -25,9 +25,8 @@
<div class="list">
<input type="text" value="<?php $this->user->hasLogin() ? $this->user->mail() : $this->remember('mail') ?>" autocomplete="off" name="mail" placeholder="请输入邮箱..." />
</div>
<div class="list captcha">
<input maxlength="4" type="text" autocomplete="off" name="captcha" placeholder="请输入验证码..." />
<img style="cursor: pointer; margin-right: 5px;" src="<?php $this->options->themeUrl('core/captcha.php'); ?>" onclick="this.src = this.src">
<div class="list">
<input type="text" autocomplete="off" name="url" placeholder="请输入网址(非必填)..." />
</div>
</div>
<div class="body">

View File

@ -19,7 +19,7 @@
<link rel="stylesheet" href="<?php $this->options->themeUrl('assets/css/joe.mode.min.css'); ?>">
<link rel="stylesheet" href="<?php $this->options->themeUrl('assets/css/joe.normalize.min.css'); ?>">
<link rel="stylesheet" href="<?php $this->options->themeUrl('assets/css/joe.global.min.css'); ?>">
<link rel="stylesheet" href="<?php $this->options->themeUrl('assets/css/joe.responsive.min.css?v=202105211730'); ?>">
<link rel="stylesheet" href="<?php $this->options->themeUrl('assets/css/joe.responsive.min.css'); ?>">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/typecho-joe-next@6.0.0/plugin/qmsg/qmsg.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/animate.css@3.7.2/animate.min.css" />
@ -40,6 +40,6 @@
<?php if ($this->options->JCursorEffects && $this->options->JCursorEffects !== 'off') : ?>
<script src="<?php $this->options->themeUrl('assets/cursor/' . $this->options->JCursorEffects); ?>" async></script>
<?php endif; ?>
<script src="<?php $this->options->themeUrl('assets/js/joe.global.min.js'); ?>"></script>
<script src="<?php $this->options->themeUrl('assets/js/joe.global.min.js?v=20210522'); ?>"></script>
<script src="<?php $this->options->themeUrl('assets/js/joe.short.min.js'); ?>"></script>
<?php $this->options->JCustomHeadEnd() ?>