Skip to content

Commit 46a62bf

Browse files
committed
1.2.3大版本更新
1 parent 6f744ce commit 46a62bf

11 files changed

Lines changed: 526 additions & 79 deletions

File tree

app/index/controller/Base.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use app\model\Options;
66
use app\BaseController;
7+
use think\facade\Config;
78
use app\index\middleware\LoginCheck;
89

910
abstract class Base extends BaseController
@@ -12,7 +13,10 @@ abstract class Base extends BaseController
1213

1314
public function initialize()
1415
{
16+
$config = Config::get('inis');
17+
1518
// 定义模板路径
19+
define('__CDN__' , $config['official']['cdn']);
1620
define('__ASSETS__' , '/index/assets/');
1721
define('__ADMIN_JS__' , '/index/assets/js/');
1822
define('__ADMIN_CSS__' , '/index/assets/css/');

app/index/controller/FileSystem.php

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class FileSystem extends Base
1212
// 构造器
1313
public function __construct()
1414
{
15-
$this->File = new File();
15+
$this->File = new File;
1616
}
1717

1818
/**
@@ -26,6 +26,9 @@ public function getDir(Request $request)
2626

2727
// 被获取的路径
2828
$path = (empty($param['path'])) ? './' : $param['path'];
29+
// 避免提权,强制定义当前目录 ./
30+
$path = (empty(array_filter(explode('/', $path)))) ? './' : $path;
31+
2932
// 文件图片路径
3033
$ico_path = '/index/assets/svg/filesystem/';
3134

@@ -229,5 +232,68 @@ public function uploadFileOne(Request $request)
229232
return $upload;
230233
}
231234

235+
/**
236+
* @name 读取文件内容
237+
*/
238+
public function read(Request $request)
239+
{
240+
if ($request->isPost())
241+
{
242+
$param = $request->param();
243+
244+
$data = [];
245+
$code = 400;
246+
$msg = 'ok';
247+
248+
$file_path = !empty($param['path']) ? $param['path'] : null;
249+
250+
if (empty($file_path)) $msg = "文件路径不得为空!";
251+
else {
252+
253+
// 重新定义路径,防止提权
254+
$path_array = array_filter(explode('/', $file_path));
255+
$path_file = implode('/', $path_array);
256+
257+
$code = 200;
258+
$data['data'] = $this->File->readFile($path_file);
259+
$data['info'] = $this->File->listInfo($path_file);
260+
}
261+
262+
return $this->create($data,$code,$msg);
263+
}
264+
}
265+
266+
/**
267+
* @name 写入文件内容
268+
*/
269+
public function write(Request $request)
270+
{
271+
if ($request->isPost())
272+
{
273+
$param = $request->param();
274+
275+
$data = [];
276+
$code = 400;
277+
$msg = 'ok';
278+
279+
$file_path = !empty($param['path']) ? $param['path'] : null;
280+
$text = !empty($param['text']) ? $param['text'] : null;
281+
282+
if (empty($file_path)) $msg = "文件路径不得为空!";
283+
else {
284+
285+
// 重新定义路径,防止提权
286+
$path_array = array_filter(explode('/', $file_path));
287+
$path_file = implode('/', $path_array);
288+
289+
$this->File->writeFile($path_file, $text);
290+
291+
$code = 200;
292+
}
293+
294+
return $this->create($data,$code,$msg);
295+
}
296+
}
297+
232298
// END
233299
}

app/index/controller/Test.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,7 @@ public function __construct()
5050

5151
public function index(Request $request)
5252
{
53-
// $data = $this->File->readFile('./storage/random-img/img.txt', true);
54-
55-
// $path = ['./storage/random-img/img.txt','./storage/random-img/test.txt'];
56-
// $data = $this->File->read($path, true);
57-
58-
$data = $this->File->listDirInfo('storage/random-img/',true,'txt');
59-
60-
foreach ($data as $key => $val) {
61-
if (strpos($val, '使用说明.txt')) unset($data[$key]);
62-
}
63-
53+
$data = $this->File->listInfo('./index.php');
6454
return json($data);
6555

6656

app/index/view/page/filesystem.html

Lines changed: 88 additions & 18 deletions
Large diffs are not rendered by default.

config/dbupdate.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
return [
3+
'data'=>[
4+
'users' => [
5+
['account'=>'admin','password'=>'$2y$10$4DOhSpDbEZYLeNCVyFd3fuyQ3Bq7LACZs4xj4/rQmsv0nEOsqs9t2','nickname'=>'inis','sex'=>'保密','email'=>'admin@qq.com','head_img'=>'//q.qlogo.cn/g?b=qq&nk=97783391&s=640','level'=>'admin','create_time'=>1625587200,'update_time'=>1625587200]
6+
],
7+
'article'=> [
8+
['title'=>'欢迎使用,inis 博客系统','description'=>'当你看到这篇文章,就表示您的系统已经搭建成功!','content'=>'当你看到这篇文章,就表示您的系统已经搭建成功!','font_count'=>18,'users_id'=>1,'create_time'=>1625587200,'update_time'=>1625587200]
9+
],
10+
'music' => [
11+
['title'=>'默认歌单','url'=>'https://c.y.qq.com/base/fcgi-bin/u?__=ZhpZFd43','head_img'=>'//q.qlogo.cn/g?b=qq&nk=97783391&s=640','create_time'=>1625587200,'update_time'=>1625587200]
12+
],
13+
'page' => [
14+
['title'=>'友链库','alias'=>'links','content'=>'###个人信息[tabs class="nav-bordered"][item name="自我介绍"active="true"][info class="alert-primary bg-white text-primary"]-愿你出走半生,归来仍是少年![/info][/item][item name="博主友链信息"color="#ff0000"font-weight="bold"][info class="alert-danger bg-white text-danger"]-名称:-地址:-描述:你有多努力,就有多特殊!-头像:`友链申请须知:`**如果你想申请本站的友链,你可以在你的博客上随便找个位置填写上我的友链信息,然后在本页评论区向我提交你的友链信息,我会根据你提交的信息拜访贵方博客,根据评定后在本站相对于的位置填写你的友链信息**[/info][/item][/tabs]##友链申请说明[tabs class="nav-bordered"][item name="内页友链申请"active="true"][info class="alert-warning"]申请条件:`任意博友`[/info][tag class="badge-danger"]内页友链申请不做任何限制,所有人都可以申请[/tag][/item][item name="推荐友链申请"][info class="alert-success"]申请条件:站内文章不少于`20篇`,且质量优良[/info][tag class="badge-danger"]推荐友链限制,为了更好的共同学习和互动[/tag][/item][item name="全站友链申请"color="#ff0000"font-weight="bold"][info class="alert-danger"]申请条件:站内`原创高质量`文章不少于`30篇`,且非常活跃的博主[/info][tag class="badge-danger"]全站友链位置有限[/tag][/item][/tabs]','create_time'=>1625587200,'update_time'=>1625587200]
15+
],
16+
'links_sort'=>[
17+
['name'=>'默认分组','description'=>'这是默认的友链分组']
18+
],
19+
'options'=>[
20+
['keys'=>'copy','value'=>'备案号'],
21+
['keys'=>'description','value'=>'INIS API SYSTEM'],
22+
['keys'=>'domain','value'=>'*'],
23+
['keys'=>'email_serve','opt'=>'{"port": "587", "smtp": "smtp.qq.com", "email": "", "encry": "tls", "encoded": "UTF-8", "email_cc": "", "nickname": "inis", "password": ""}'],
24+
['keys'=>'email_template_1','value'=>"<style>.inis-card{width:550px;height:auto;border-radius:5px;margin:0 auto;box-shadow:0px 0px 20px #888888;position:relative}.inis-card-img{background-image:url(https://picabstract-preview-ftn.weiyun.com/ftn_pic_abs_v3/d238b26f98ee7f65ecce545440c47c892470aa613f3b44018c1e984cccde28d7048273dd4f5aac10e27610adf770c3ae?pictype=scale&from=30013&version=3.3.3.3&uin=1211515059&fname=18.jpeg&size=750);width:550px;height:250px;background-size:cover;background-repeat:no-repeat;border-radius:5px 5px 0px 0px}.inis-card-body{background-color:white;line-height:180%;padding:0 15px 12px;width:520px;margin:10px auto;color:#555555;font-family:'Century Gothic','Trebuchet MS','Hiragino Sans GB',微软雅黑,'Microsoft Yahei',Tahoma,Helvetica,Arial,'SimSun',sans-serif;font-size:12px;margin-bottom:0px}.inis-card-body > h2{font-size:14px;font-weight:normal;padding:13px 0 10px 8px}.inis-card-body > h2 > a{text-decoration:none;color:#ff7272}.inis-row{padding:0 12px 0 12px;margin-top:18px}.comment{background-color:#f5f5f5;border:0px solid #DDD;border-radius:5px;padding:10px 15px;margin:18px 0}.comment > img{margin:0px 6px 5px 6px;width:25px}.comment > a{text-decoration:none;color:#ff7272}.inis-more{text-decoration:none;color:rgb(255,255,255);width:40%;text-align:center;background-color:rgb(255,114,114);height:40px;line-height:40px;box-shadow:3px 3px 3px rgba(0,0,0,0.3);display:block;margin:auto}.inis-font{color:#8c8c8c;font-family:'Century Gothic','Trebuchet MS','Hiragino Sans GB',微软雅黑,'Microsoft Yahei',Tahoma,Helvetica,Arial,'SimSun',sans-serif;font-size:10px;width:100%;text-align:center;padding-bottom:1px}</style><div class=inis-card><div class=inis-card-img></div><div class=inis-card-body><h2>您的<a>《{article}》</a>有了新的评论:</h2><div class=inis-row><p><strong>{nickname}</strong>&nbsp;给您的评论:</p><p class=comment>{text}</p><p>详细信息:</p><p class=comment>IP:{ip}<br />邮箱:<a href=mailto:{email}>{email}</a></p></div></div><a class=inis-more href={admin_url} target=_blank>查看回复的完整內容</a><div class=inis-font><p>©2020-2021 Copyright {site}</p></div></div>"],
25+
['keys'=>'email_template_2','value'=>"<style>.inis-card{width:550px;height:auto;border-radius:5px;margin:0 auto;box-shadow:0px 0px 20px #888888;position:relative;padding-bottom:5px}.inis-card-img{background-image:url(https://picabstract-preview-ftn.weiyun.com/ftn_pic_abs_v3/d238b26f98ee7f65ecce545440c47c892470aa613f3b44018c1e984cccde28d7048273dd4f5aac10e27610adf770c3ae?pictype=scale&from=30013&version=3.3.3.3&uin=1211515059&fname=18.jpeg&size=750);width:550px;height:300px;background-size:cover;background-repeat:no-repeat;border-radius:5px 5px 0px 0px}.inis-head-title{width:200px;height:40px;background-color:rgb(255,114,114);margin-top:-20px;margin-left:20px;box-shadow:3px 3px 3px rgba(0,0,0,0.3);color:rgb(255,255,255);text-align:center;line-height:40px}.inis-card-body{background-color:white;line-height:180%;padding:0 15px 12px;width:520px;margin:30px auto;color:#555555;font-family:'Century Gothic','Trebuchet MS','Hiragino Sans GB',微软雅黑,'Microsoft Yahei',Tahoma,Helvetica,Arial,'SimSun',sans-serif;font-size:12px;margin-bottom:0px}.inis-card-body > h2{font-size:14px;font-weight:normal;padding:13px 0 10px 8px}.inis-card-body > h2 > a{text-decoration:none;color:#ff7272}.inis-row{padding:0 12px 0 12px;margin-top:18px}.comment{background-color:#f5f5f5;border:0px solid #DDD;border-radius:5px;padding:10px 15px;margin:18px 0}.comment > img{margin:0px 6px 5px 6px;width:25px}.inis-font{color:#8c8c8c;font-family:'Century Gothic','Trebuchet MS','Hiragino Sans GB',微软雅黑,'Microsoft Yahei',Tahoma,Helvetica,Arial,'SimSun',sans-serif;font-size:10px;width:100%;text-align:center;}.inis-more{text-decoration:none;color:#FFF;width:40%;text-align:center;background-color:#ff7272;height:40px;line-height:35px;box-shadow:3px 3px 3px rgba(0,0,0,0.30);margin:-10px auto;display:block;}</style><div class=inis-card><div class=inis-card-img></div><div class=inis-head-title>亲爱的{nickname}</div><div class=inis-card-body><h2>您在<a href={site_url}target=_blank>《{article}》</a>的评论有了新的回复:</h2><div class=inis-row><p>您的评论:</p><p class=comment>{text}</p><p><strong>{author}</strong>&nbsp;给您的回复:</p><p class=comment>{content}</p></div></div><div class=inis-font style='word-wrap:break-word;margin-top:-30px;'><p style=padding:20px>萤火虫消失之后,那光的轨迹仍久久地印在我的脑际。那微弱浅淡的光点,仿佛迷失方向的魂灵,在漆黑厚重的夜幕中彷徨。——《挪威的森林》村上春树</p></div><a class=inis-more href={site_url}target=_blank>查看回复的完整內容</a><div class=inis-font><p style=margin-top:30px>本邮件为系统自动发送,请勿直接回复~</p></div><div class=inis-font><p>©2020-2021 Copyright{site}</p></div></div>"],
26+
['keys'=>'email_template_3','value'=>'<div style="margin: 0 auto;width: 800px;"><table border="0"cellspacing="0"cellpadding="0"width="800"bgcolor="#0092ff"height="66"><tbody><tr><td width="50"></td><td width="750"><img style="WIDTH: 135px"src="{domain}/index/assets/images/logo-1.png"></td></tr></tbody></table><table style="FONT-FAMILY: 黑体; FONT-SIZE: 10pt"border="0"cellspacing="0"cellpadding="50"width="800"><tbody><tr><td width="800"><div><div style="FONT-SIZE: 11pt">{email},您好!</div><br><div style="FONT-SIZE: 11pt">以下是您用于验证身份的验证码,请在<span style="color:red">{valid_time}内</span>输入并完成验证。如非本人操作,请忽略此邮件。</div><br><br><div><span style="COLOR: #0094ff; FONT-SIZE: 40pt">{code}</span></div><br><br><hr style="BORDER-BOTTOM: #808080 0px dashed; BORDER-LEFT: #808080 0px dashed; HEIGHT: 1px; BORDER-TOP: #808080 1px dashed; BORDER-RIGHT: #808080 0px dashed"><br><div style="COLOR: #808080">此邮件由系统自动发出,系统不接受回信,因此请勿直接回复。<br>安全使用您的帐号注意事项:<br>1、请不要在其他网站上使用相同的邮箱和密码进行注册。<br>2、请不要告知任何人您的帐号密码信息。<br><br>如果您错误的收到本电子邮件,请您忽略上述内容。</div><br><hr style="BORDER-BOTTOM: #808080 0px dashed; BORDER-LEFT: #808080 0px dashed; HEIGHT: 1px; BORDER-TOP: #808080 1px dashed; BORDER-RIGHT: #808080 0px dashed"><div><br></div><div style="TEXT-ALIGN: right; FONT-SIZE: 11pt">{site}</div><div style="TEXT-ALIGN: right; FONT-SIZE: 11pt">{time}</div></div></td></tr></tbody></table></div>'],
27+
['keys'=>'keywords','value'=>'API,INIS'],
28+
['keys'=>'site_conf','opt'=>'{"token": {"open": 0, "value": "", "status": 0}, "domain": {"status": 0}}'],
29+
['keys'=>'site_ico','value'=>'//q.qlogo.cn/g?b=qq&nk=97783391&s=640'],
30+
['keys'=>'site_img','value'=>'//q.qlogo.cn/g?b=qq&nk=97783391&s=640'],
31+
['keys'=>'site_url'],
32+
['keys'=>'title','value'=>'INIS API']
33+
]
34+
]
35+
];

config/inis.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
return [
1010

11-
'api_cache' => false, // 开启API缓存
11+
'api_cache' => true, // 开启API缓存
1212
'jwt_key' => 'inis-!@#$%*&', // JWT KEY - 用于校验 TOKEN 是否合法
1313
'valid_time' => 5 * 60, // 验证码有效时间 - 单位秒
1414

@@ -33,8 +33,9 @@
3333

3434
// 官方授权系统
3535
'official' => [
36-
'api' => 'https://inis.cc/api/'
36+
'api' => 'https://inis.cc/api/', // 用于检查更新
37+
'cdn' => 'https://cdn.inis.cc/' // 静态文件加速
3738
],
3839

39-
'version' => '1.2.1', // inis 版本号 - 请不要自行更改,后果自负
40+
'version' => '1.2.3', // inis 版本号 - 请不要自行更改,后果自负
4041
];

public/.well-known/acme-challenge/_AIqMjs3kk-ykUSx6Wo5nj0GyZkVNCWRrA3Ri5lIVDA

Lines changed: 0 additions & 1 deletion
This file was deleted.

public/index/assets/css/style.css

Lines changed: 88 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,85 @@ img.rounded-circle.img-thumbnail {
373373
75% { transform:scale(0.4);opacity: 0.2; }
374374
}
375375

376+
#configure #other .domain-textarea{
377+
-webkit-box-shadow: 0 0 35px 0 rgb(154 161 171 / 15%);
378+
box-shadow: 0 0 35px 0 rgb(154 161 171 / 15%);
379+
}
380+
#manage-comments .table tr td:nth-child(3){
381+
word-wrap: break-word;
382+
word-break: break-all;
383+
}
384+
.un-focus{
385+
box-shadow:unset!important;
386+
}
387+
388+
.mask{width: 100%;height: 100%;background:#000;position: absolute;top: 0px;left:0px;opacity: 0.4;z-index: 8000; display: none;-moz-user-select: none; -webkit-user-select: none;}
389+
.pop-ups{width: 70%;background:#fff; position: absolute;z-index: 9000;display: none;}
390+
.pop-ups-head{cursor: move;}
391+
#ace-editor{width: 100%;height:60vh;}
392+
.ace_layer.ace_print-margin-layer{display:none}
393+
#box-narrow{display:none}
394+
.read-load{width: 100%;height: 100%;background:#000;position: absolute;top: 0px;left:0px;opacity: 0.4;z-index: 8000; display: none;-moz-user-select: none; -webkit-user-select: none;}
395+
.card-body.flex-center.load{z-index:9000;}
396+
.card-body.load .spinner-border{width:1.3em;height:1.3em;}
397+
.pop-ups .tool ul {display:flex;list-style: none;margin: 0;padding: 0;}
398+
.pop-ups .tool ul{
399+
/*position: absolute;*/
400+
/*left: 0;*/
401+
/*right: 0;*/
402+
/*top: 0;*/
403+
height: 35px;
404+
background: #565656;
405+
transition: top 500ms;
406+
}
407+
.pop-ups .tool ul li{
408+
display: flex;
409+
align-items: center;
410+
justify-content: center;
411+
float: left;
412+
height: 35px;
413+
line-height: 35px;
414+
padding: 0 15px;
415+
font-size: 13px;
416+
text-align: center;
417+
color: #fff;
418+
border-right: 1px solid #4c4c4c;
419+
cursor: pointer;
420+
}
421+
.pop-ups .tool ul .spinner-border{
422+
width: 1.1em;
423+
height: 1.1em;
424+
border: .2em solid currentColor;
425+
display: inline-block;
426+
vertical-align: text-bottom;
427+
border-right-color: transparent;
428+
border-radius: 50%;
429+
-webkit-animation: spinner-border .75s linear infinite;
430+
animation: spinner-border .75s linear infinite;
431+
}
432+
#filesystem .path-array{
433+
display:flex;
434+
overflow-x: auto;
435+
width: 100%;
436+
}
437+
#filesystem .path-array button{flex:unset}
438+
439+
440+
441+
442+
443+
444+
445+
446+
447+
448+
449+
450+
451+
452+
453+
454+
376455
@media (max-width:768px){
377456
.upload {
378457
width: auto;
@@ -452,36 +531,12 @@ img.rounded-circle.img-thumbnail {
452531
#update-info .modal-body .alert{
453532
margin: .75em 0 0 0!important;
454533
}
455-
}
456-
457-
458-
459-
460-
461-
462-
463-
#configure #other .domain-textarea{
464-
-webkit-box-shadow: 0 0 35px 0 rgb(154 161 171 / 15%);
465-
box-shadow: 0 0 35px 0 rgb(154 161 171 / 15%);
466-
}
467-
#manage-comments .table tr td:nth-child(3){
468-
word-wrap: break-word;
469-
word-break: break-all;
470-
}
471-
472-
473-
474-
475-
476-
477-
478-
479-
480-
481-
482-
483-
484-
485-
486-
487-
534+
#filesystem .path-array{
535+
width: 60%;
536+
}
537+
#filesystem .other {
538+
display: flex;
539+
margin-top: 15px;
540+
margin-left: -10px;
541+
}
542+
}

0 commit comments

Comments
 (0)