Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
SunWuyuan committed Aug 26, 2024
1 parent 8b704f4 commit 799b330
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 405 deletions.
70 changes: 35 additions & 35 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,75 +1,75 @@
=
SiteName='' #网站名称,必须填写
SiteSlogan='' #网站标语,必须填写
SiteDomain='' #网站域名,不需要https://开头与/结尾,必须填写
SitePrivacyPolicy='' #隐私政策链接,法律建议你填
SiteTermsofService='' #服务条款链接,法律建议你填
SiteFeedbackEmail='' #网站联系邮箱,无则空
SiteName=
SiteSlogan=
SiteDomain=
SitePrivacyPolicy=
SiteTermsofService=
SiteFeedbackEmail=
=
#recaptcha 测试环境数据,始终返回成功,请勿在生产环境使用
#rekey='0x4AAAAAAAHW417G1zlyXZhW'
#resecret='0x4AAAAAAAHW46pUIOHkBAtxriTbQONaHT8'
rekey='' #谷歌验证码key
resecret='' #谷歌验证码secret
rekey=
resecret=
#高级设置,可以兼容理论上所有兼容recaptcha的验证码,如非需要不需修改
reurl='https://www.recaptcha.net/recaptcha/api.js' #不需要加?和后面的内容,ZeroCat会自动添加callback
reverify='https://www.recaptcha.net/recaptcha/api/siteverify'
reurl=
reverify=
=
#兼容hcaptcha示例
# reurl='https://challenges.cloudflare.com/turnstile/v0/api.js'
# reverify='https://challenges.cloudflare.com/turnstile/v0/siteverify'
=
#邮箱 生产环境,给俺小心点
mailservice='' #例如qq,163,126等
mailuser='' #发送邮件的邮箱
mailpass='' #邮箱密码或授权码
mailfrom='' #发件人名称
mailservice=
mailuser=
mailpass=
mailfrom=
=
=
#安全 生产环境,给俺小心点
adminuser='' #管理员账号(邮箱)
jwttoken='' #JWT加密密钥(任意数字英文字符)
SessionSecret='' #Session加密密钥(任意数字英文字符)
adminuser=
jwttoken=
SessionSecret=
=
#mysql 开发环境测试DB,请勿在生产环境使用
mysqlhost='' #数据库主机
mysqlport='' #数据库端口
mysqluser='' #数据库用户名
mysqlpassword='' #数据库密码
mysqldatabase='' #数据库名称
mysqlhost=
mysqlport=
mysqluser=
mysqlpassword=
mysqldatabase=
mysqlssl =
DATABASE_URL=
=
=
# S3存储 生产环境,给俺小心点
S3endpoint='' #S3 服务器地址
S3region='' #S3 服务器区域
S3bucket='' #S3 存储桶名称
AWS_ACCESS_KEY_ID='' # S3 Access Key ID
AWS_SECRET_ACCESS_KEY='' # S3 Secret Access Key
S3endpoint=
S3region=
S3bucket=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
#S3endpoint='https://s3.us-west-004.backblazeb2.com'
#S3region='us-west-004'
#S3bucket='ourworld'
#AWS_ACCESS_KEY_ID='00431947f6014c90000000002'
#AWS_SECRET_ACCESS_KEY='K004cd5buq0LBWxhzGi+k534Fj3tkhQ'
S3staticurl='https://' # 最终供用户访问的地址,不带末尾/符号
S3staticurl=
=
#Axiom日志流,不填则删掉这两行 不区分环境
AXIOM_DATASET=
AXIOM_TOKEN=
=
#Cors配置
corslist='*' #允许跨域请求的域名列表
corslist=
=
#评论区配置
WalineServerURL='' #waline的服务器链接
WalineServerURL=
=
#兔小巢配置
txcid='' #兔小巢ID,不填则默认597800(ZeroCat官方)
txckey='' #不需要则不填
txcid=
txckey=
=
#前端静态文件地址 记得改掉!
staticurl='https://registry.npmmirror.com/owstatic/latest/files' #静态文件地址
staticurl=
#localstatic=false
#staticpath='static'
=
Expand All @@ -78,7 +78,7 @@ staticurl='https://registry.npmmirror.com/owstatic/latest/files' #静态文件
# localstatic=true #是否使用本地静态文件
# staticurl='/static' #无需修改,当然也可以随便改成别的
# staticpath='static' #静态文件在服务器上的相对地址(相对于项目根目录)
html='' #位于hand前面的html
html=
=
# This was inserted by `prisma init`:
# Environment variables declared in this file are automatically made available to Prisma.
Expand All @@ -87,7 +87,7 @@ html='' #位于hand前面的html
# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB.
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings
=
editorurl='https://zerocat-static.houlangs.com/scratchguifile'
editorurl=
=
=
# Geetest 极验
Expand Down
3 changes: 1 addition & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ app.use(
var cors = require("cors");
var corsOptions = {
origin: (origin, callback) => {
console.log(origin);
if (process.env.corslist.indexOf(origin) !== -1 || !origin) {
if (!origin || process.env.corslist.indexOf(new URL(origin).hostname) !== -1) {
callback(null, true);
} else {
callback(new Error("Not allowed by CORS"));
Expand Down
5 changes: 3 additions & 2 deletions server/router_account.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,9 @@ router.post("/register",geetest,function (req, res) {
router.post("/repw", geetest,function (req, res) {

var email = req.body.un;
SQL = `SELECT * FROM ow_users WHERE email='${email}' LIMIT 1`;
DB.query(SQL, function (err, User) {
SQL = `SELECT * FROM ow_users WHERE email=? LIMIT 1`;
w=[email];
DB.qww(SQL,w, function (err, User) {
if (err) {
res.status(200).send({ message: "账号格式错误或不存在" });
return;
Expand Down
Loading

0 comments on commit 799b330

Please sign in to comment.