prettier lint

Signed-off-by: WaitSpring <me@waitspring.com>
这个提交包含在:
WaitSpring 2023-02-25 12:33:18 +08:00
父节点 0656d90c12
当前提交 235cc86d37
共有 8 个文件被更改,包括 242 次插入215 次删除

3
.prettierignore 普通文件
查看文件

@ -0,0 +1,3 @@
vendor/
node_modules/
js/jquery.min.js

查看文件

@ -1,9 +1,9 @@
# About *Common Program of Qiuwen Baike* 关于《求闻百科共同纲领》
# About _Common Program of Qiuwen Baike_ 关于《求闻百科共同纲领》
The development of this software is subject to the *Common Program of Qiuwen Baike*, which is a constitutional document of *Qiuwen Baike* and its community and plays the role similar to Code of Conduct in other open-source communities.
The development of this software is subject to the _Common Program of Qiuwen Baike_, which is a constitutional document of _Qiuwen Baike_ and its community and plays the role similar to Code of Conduct in other open-source communities.
本软件之开发遵循《求闻百科共同纲领》,该文件为求闻百科纲领性文件,起到类似其他开源社区中“行为准则”的作用。
You can read the *Common Program* at <https://qwbk.org/c/31162>.
You can read the _Common Program_ at <https://qwbk.org/c/31162>.
您可以在下列网址查阅《共同纲领》:<https://qwbk.org/c/31162>
您可以在下列网址查阅《共同纲领》:<https://qwbk.org/c/31162>

查看文件

@ -2,37 +2,37 @@
## 依赖
- PHP 8.0及以上版本,建议PHP 8.1
- OpenSSL、PDO、Curl扩展
- PHP 8.0 及以上版本,建议 PHP 8.1
- OpenSSL、PDO、Curl 扩展
- Composer
- 数据库
- MySQL或兼容数据库
- MySQL 或兼容数据库
- 无需完整服务器,只需要一个数据库,以及一个对数据库有完整权限的用户即可
- PDO MySQL扩展
- MediaWiki实例
- OAuth扩展
- 需要有权限申请OAuth消费者
- 短信发送服务及其Token
- PDO MySQL 扩展
- MediaWiki 实例
- OAuth 扩展
- 需要有权限申请 OAuth 消费者
- 短信发送服务及其 Token
- 目前支持阿里云
- 邮件发送服务及其Token
- Web服务器
- 邮件发送服务及其 Token
- Web 服务器
## 安装
1. Git Clone
2. 在根目录,运行composer install以下载所有依赖库
3. 配置Web服务器
4. 在MediaWiki实例中,申请OAuth消费者
- OAuth版本为1.0a
- 回传路径指向callback.php
- 权限方面,需要获取用户名,需要“编辑存在的页面;创建、编辑和移动页面”权限,需要“编辑您的用户参数设置和JSON配置”权限
5. 配置config.php
2. 在根目录,运行 composer install 以下载所有依赖库
3. 配置 Web 服务器
4. 在 MediaWiki 实例中,申请 OAuth 消费者
- OAuth 版本为 1.0a
- 回传路径指向 callback.php
- 权限方面,需要获取用户名,需要“编辑存在的页面;创建、编辑和移动页面”权限,需要“编辑您的用户参数设置和 JSON 配置”权限
5. 配置 config.php
6. 可以使用了
## 结构
- index.php - 进行实名制认证的准备
- callback.php - MediaWiki系统中登记的OAuth回传点,获取MediaWiki中的用户信息,并且检查是否有对应的实名制信息;此外保存数据库结构
- callback.php - MediaWiki 系统中登记的 OAuth 回传点,获取 MediaWiki 中的用户信息,并且检查是否有对应的实名制信息;此外保存数据库结构
- reg.php - 如果用户没有实名制信息,要求其登记实名制信息
- verify.php - 如果用户有实名制信息,并且想要更新实名制信息,要求其验证既有实名制信息
- update.php - 对于想要更新实名制信息的用户,要求其提供新的实名制信息
@ -41,4 +41,4 @@
## 授权
本程序在MIT许可证下发布,同时遵循《求闻百科共同纲领》。您可以浏览CODE_OF_CONDUCT.md和LICENSE以获取上述内容的细节。
本程序在 MIT 许可证下发布,同时遵循《求闻百科共同纲领》。您可以浏览 CODE_OF_CONDUCT.md LICENSE 以获取上述内容的细节。

查看文件

@ -1,9 +1,9 @@
{
"require": {
"alibabacloud/darabonba-openapi": "^0.2.8",
"alibabacloud/dysmsapi-20170525": "2.0.20",
"mediawiki/oauthclient": "^1.2",
"ext-openssl": "*",
"ext-pdo": "*"
}
"require": {
"alibabacloud/darabonba-openapi": "^0.2.8",
"alibabacloud/dysmsapi-20170525": "2.0.20",
"mediawiki/oauthclient": "^1.2",
"ext-openssl": "*",
"ext-pdo": "*"
}
}

查看文件

@ -1,89 +1,89 @@
* {
margin: 0;
padding: 0
}
body,
html {
min-height: 100vh
}
html {
width: 100%;
background: #fff;
color: #000;
line-height: 1.75;
font-family: 'Noto Serif', 'Source Serif', 'Noto Serif SC', 'Source Han Serif SC', 'Times New Roman', 'Times', 'STSong', 'SimSun', serif;
}
body {
display: flex;
margin: 0 auto;
max-width: 83vw;
flex-wrap: wrap;
flex-direction: column;
justify-content: space-between
}
header {
margin: 10vh 0 0;
padding-bottom: 1em;
border-bottom: 5px solid #36c
}
a img {
border: 0
}
main {
display: flex;
flex-wrap: wrap;
flex-direction: column;
margin: 0 auto;
min-width: 70vw
}
h1 {
margin-top: 0.5em;
margin-bottom: 0.5em;
font-size: 1.25em
}
p {
margin: .5em 0
}
ul {
margin: .5em 0 .5em 2em
}
li {
margin: .25em 0;
}
a {
color: #36c;
text-decoration: none
}
a:hover {
text-decoration: underline
}
em,
footer {
color: #777;
font-style: normal
}
footer {
margin: 0 0 10vh;
padding-top: 1em;
border-top: 1px solid #eaecf0;
font-size: .9em;
}
.footer-links a {
margin-right: .5em;
white-space: nowrap
}
* {
margin: 0;
padding: 0;
}
body,
html {
min-height: 100vh;
}
html {
width: 100%;
background: #fff;
color: #000;
line-height: 1.75;
font-family: 'Noto Serif', 'Source Serif', 'Noto Serif SC', 'Source Han Serif SC', 'Times New Roman', 'Times', 'STSong', 'SimSun', serif;
}
body {
display: flex;
margin: 0 auto;
max-width: 83vw;
flex-wrap: wrap;
flex-direction: column;
justify-content: space-between;
}
header {
margin: 10vh 0 0;
padding-bottom: 1em;
border-bottom: 5px solid #36c;
}
a img {
border: 0;
}
main {
display: flex;
flex-wrap: wrap;
flex-direction: column;
margin: 0 auto;
min-width: 70vw;
}
h1 {
margin-top: 0.5em;
margin-bottom: 0.5em;
font-size: 1.25em;
}
p {
margin: 0.5em 0;
}
ul {
margin: 0.5em 0 0.5em 2em;
}
li {
margin: 0.25em 0;
}
a {
color: #36c;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
em,
footer {
color: #777;
font-style: normal;
}
footer {
margin: 0 0 10vh;
padding-top: 1em;
border-top: 1px solid #eaecf0;
font-size: 0.9em;
}
.footer-links a {
margin-right: 0.5em;
white-space: nowrap;
}

查看文件

@ -14,26 +14,30 @@ $("#button_acquirecode").on("click", function () {
} else if (regex.test(pn) === false) {
alert("手机号格式错误!");
} else {
$.post("./smsVerify.php", {
act: "UserLoginCode",
pn: pn
}, function () {
state.counter = setInterval(function () {
buttonAcquire.val(state.countdown-- +"秒后重新发送");
buttonAcquire.attr("disabled", "true");
// done
if (state.countdown === 0) {
clearInterval(state.counter);
var passed = regex.test(pn);
if (passed) {
buttonAcquire.removeAttr("disabled");
$.post(
"./smsVerify.php",
{
act: "UserLoginCode",
pn: pn
},
function () {
state.counter = setInterval(function () {
buttonAcquire.val(state.countdown-- + "秒后重新发送");
buttonAcquire.attr("disabled", "true");
// done
if (state.countdown === 0) {
clearInterval(state.counter);
var passed = regex.test(pn);
if (passed) {
buttonAcquire.removeAttr("disabled");
}
var text = "获取验证码";
buttonAcquire.val(text);
state.countdown = countdownLength;
}
var text = "获取验证码";
buttonAcquire.val(text);
state.countdown = countdownLength;
}
}, 1000);
});
}, 1000);
}
);
}
});
$("#button_submit").on("click", function () {
@ -48,21 +52,25 @@ $("#button_submit").on("click", function () {
if (pn === "" || code === "") {
alert("手机号和验证码不能为空!");
} else {
$.post("./smsVerify.php", {
act: "UserLogin",
pn: pn,
code: code
}, function (data) {
if (data === "1") {
$("#exportForm").submit();
} else if (data === "2") {
alert("验证码错误");
} else if (data === "3") {
alert("验证码已失效");
} else {
alert("网络波动");
$.post(
"./smsVerify.php",
{
act: "UserLogin",
pn: pn,
code: code
},
function (data) {
if (data === "1") {
$("#exportForm").submit();
} else if (data === "2") {
alert("验证码错误");
} else if (data === "3") {
alert("验证码已失效");
} else {
alert("网络波动");
}
}
});
);
}
}
}

查看文件

@ -14,26 +14,30 @@ $("#button_acquirecode").on("click", function () {
} else if (regex.test(pn) === false) {
alert("手机号格式错误!");
} else {
$.post("./smsVerify.php", {
act: "UserLoginCode",
pn: pn
}, function () {
state.counter = setInterval(function () {
buttonAcquire.val(state.countdown-- + "秒后重新发送");
buttonAcquire.attr("disabled", "true");
// done
if (state.countdown === 0) {
clearInterval(state.counter);
var passed = regex.test(pn);
if (passed) {
buttonAcquire.removeAttr("disabled");
$.post(
"./smsVerify.php",
{
act: "UserLoginCode",
pn: pn
},
function () {
state.counter = setInterval(function () {
buttonAcquire.val(state.countdown-- + "秒后重新发送");
buttonAcquire.attr("disabled", "true");
// done
if (state.countdown === 0) {
clearInterval(state.counter);
var passed = regex.test(pn);
if (passed) {
buttonAcquire.removeAttr("disabled");
}
var text = "获取验证码";
buttonAcquire.val(text);
state.countdown = countdownLength;
}
var text = "获取验证码";
buttonAcquire.val(text);
state.countdown = countdownLength;
}
}, 1000);
});
}, 1000);
}
);
}
});
$("#button_submit").on("click", function () {
@ -45,21 +49,25 @@ $("#button_submit").on("click", function () {
if (pn === "" || code === "") {
alert("手机号和验证码不能为空!");
} else {
$.post("./smsVerify.php", {
act: "UserLogin",
pn: pn,
code: code
}, function (data) {
if (data === "1") {
$("#exportForm").submit();
} else if (data === "2") {
alert("验证码错误");
} else if (data === "3") {
alert("验证码已失效");
} else {
alert("网络波动");
$.post(
"./smsVerify.php",
{
act: "UserLogin",
pn: pn,
code: code
},
function (data) {
if (data === "1") {
$("#exportForm").submit();
} else if (data === "2") {
alert("验证码错误");
} else if (data === "3") {
alert("验证码已失效");
} else {
alert("网络波动");
}
}
});
);
}
}
});

查看文件

@ -8,23 +8,27 @@ var state = {
var buttonAcquire = $("#button_acquirecode");
$("#button_acquirecode").on("click", function () {
var uid = $("input[name=userid]").val();
$.post("./smsVerify.php", {
act: "UserVerifyCode",
uid: uid
}, function () {
state.counter = setInterval(function () {
buttonAcquire.val(state.countdown-- + "秒后重新发送");
buttonAcquire.attr("disabled", "true");
// done
if (state.countdown === 0) {
clearInterval(state.counter);
buttonAcquire.removeAttr("disabled");
var text = "获取验证码";
buttonAcquire.val(text);
state.countdown = countdownLength;
}
}, 1000);
});
$.post(
"./smsVerify.php",
{
act: "UserVerifyCode",
uid: uid
},
function () {
state.counter = setInterval(function () {
buttonAcquire.val(state.countdown-- + "秒后重新发送");
buttonAcquire.attr("disabled", "true");
// done
if (state.countdown === 0) {
clearInterval(state.counter);
buttonAcquire.removeAttr("disabled");
var text = "获取验证码";
buttonAcquire.val(text);
state.countdown = countdownLength;
}
}, 1000);
}
);
});
$("#button_submit").on("click", function () {
var code = $("#input_code").val();
@ -34,20 +38,24 @@ $("#button_submit").on("click", function () {
if (code === "") {
alert("验证码不能为空!");
} else {
$.post("./smsVerify.php", {
act: "UserVerify",
code: code
}, function (data) {
if (data === "1") {
$("#exportForm").submit();
} else if (data === "2") {
alert("验证码错误");
} else if (data === "3") {
alert("验证码已失效");
} else {
alert("网络波动");
$.post(
"./smsVerify.php",
{
act: "UserVerify",
code: code
},
function (data) {
if (data === "1") {
$("#exportForm").submit();
} else if (data === "2") {
alert("验证码错误");
} else if (data === "3") {
alert("验证码已失效");
} else {
alert("网络波动");
}
}
});
);
}
}
});