├── README.md ├── admin.php ├── application ├── admin │ ├── controller │ │ ├── Admin.php │ │ ├── Article.php │ │ ├── Attachment.php │ │ ├── Category.php │ │ ├── Common.php │ │ ├── Index.php │ │ ├── Login.php │ │ ├── System.php │ │ ├── Tag.php │ │ └── Upload.php │ └── view │ │ ├── admin │ │ └── password.html │ │ ├── article │ │ ├── add.html │ │ ├── edit.html │ │ └── index.html │ │ ├── attachment │ │ └── index.html │ │ ├── category │ │ ├── add.html │ │ ├── addBatch.html │ │ ├── edit.html │ │ └── index.html │ │ ├── index │ │ └── index.html │ │ ├── login │ │ └── login.html │ │ ├── public │ │ ├── footer.html │ │ ├── header.html │ │ ├── ueditor.html │ │ └── upload.html │ │ ├── system │ │ └── set.html │ │ └── tag │ │ └── index.html ├── command.php ├── common.php ├── common │ └── taglib │ │ └── Article.php ├── config.php ├── database.php ├── index │ ├── controller │ │ ├── Article.php │ │ ├── Category.php │ │ ├── Common.php │ │ ├── Index.php │ │ ├── Search.php │ │ └── Tag.php │ └── view │ │ ├── article │ │ └── show.html │ │ ├── category │ │ ├── category.html │ │ └── list.html │ │ ├── index │ │ └── index.html │ │ ├── public │ │ ├── footer.html │ │ └── header.html │ │ ├── search │ │ └── index.html │ │ └── tag │ │ ├── index.html │ │ └── tag.html ├── install │ ├── common.php │ ├── config.php │ ├── controller │ │ └── Index.php │ └── view │ │ └── index │ │ ├── index.html │ │ ├── step1.html │ │ ├── step2.html │ │ ├── step3.html │ │ └── step4.html ├── route.php └── tags.php ├── data ├── install.lock └── install │ ├── database.tpl │ └── install.sql ├── extend └── org │ ├── Captcha.php │ ├── Http.php │ ├── Uploader.php │ └── captcha │ ├── bgs │ ├── 1.jpg │ ├── 2.jpg │ ├── 3.jpg │ ├── 4.jpg │ ├── 5.jpg │ ├── 6.jpg │ ├── 7.jpg │ └── 8.jpg │ ├── ttfs │ ├── 1.ttf │ ├── 2.ttf │ ├── 3.ttf │ ├── 4.ttf │ ├── 5.ttf │ └── 6.ttf │ └── zhttfs │ └── 1.ttf ├── favicon.ico ├── index.php ├── install.php ├── public ├── 2016 │ ├── css │ │ ├── common.css │ │ └── layout.css │ ├── images │ │ ├── 20161107line.png │ │ ├── banner10.jpg │ │ ├── banner5.jpg │ │ ├── banner6.jpg │ │ ├── banner7.jpg │ │ ├── banner8.jpg │ │ ├── banner9.jpg │ │ ├── envelope.png │ │ ├── icon36.png │ │ ├── icon37.png │ │ ├── img59.jpg │ │ ├── img60.jpg │ │ ├── img61.jpg │ │ ├── img62.jpg │ │ ├── recruitment1.png │ │ ├── wqp_inco12.png │ │ ├── wwimg03.png │ │ ├── wwimg04.png │ │ ├── wwimg05.png │ │ ├── wwimg06.png │ │ ├── wwimg07.png │ │ ├── wwimg08.png │ │ ├── wwimg09.png │ │ ├── wwimg10.png │ │ ├── wwimg108.png │ │ ├── wwimg109.png │ │ ├── wwimg11.png │ │ ├── wwimg110.png │ │ ├── wwimg112.png │ │ ├── wwimg113.png │ │ ├── wwimg114.png │ │ ├── wwimg115.png │ │ ├── wwimg116.png │ │ ├── wwimg12.png │ │ ├── wwimg127.png │ │ ├── wwimg13.png │ │ ├── wwimg14.png │ │ ├── wwimg15.png │ │ ├── wwimg22.png │ │ ├── wwimg30.png │ │ ├── wwimg31.png │ │ ├── wwimg32.png │ │ ├── wwimg33.png │ │ ├── wwimg34.png │ │ ├── wwimg35.png │ │ ├── wwimg36.png │ │ ├── wwimg37.png │ │ ├── wwimg38.png │ │ ├── wwimg39.png │ │ ├── wwimg40.png │ │ ├── wwimg41.png │ │ ├── wwimg52.png │ │ ├── wwimg91.png │ │ ├── wwimg92.png │ │ ├── wwimg94.png │ │ ├── wwimg97.png │ │ ├── wwimg98.png │ │ ├── wwpic179.jpg │ │ ├── wwpic19.png │ │ ├── wwpic202.jpg │ │ ├── wwpic94.jpg │ │ ├── yysimg2.png │ │ ├── zdown.png │ │ ├── zhsh06.png │ │ └── zhsh06g.png │ ├── js │ │ ├── idangerous.swiper.min.js │ │ ├── jquery-1.12.2.min.js │ │ ├── layout.js │ │ └── nav.js │ └── picture │ │ ├── banner1.jpg │ │ ├── banner2.jpg │ │ ├── banner3.jpg │ │ ├── banner4.jpg │ │ ├── banner5.jpg │ │ ├── logo.jpg │ │ ├── wqp_img10.jpg │ │ ├── wwpic192.jpg │ │ ├── wwpic193.jpg │ │ ├── wwpic194.jpg │ │ └── wwpic195.jpg ├── admin │ ├── css │ │ ├── admin_login.css │ │ ├── common.css │ │ └── main.css │ ├── fonts │ │ ├── icomoon.dev.svg │ │ ├── icomoon.eot │ │ ├── icomoon.svg │ │ ├── icomoon.ttf │ │ └── icomoon.woff │ ├── images │ │ ├── login │ │ │ └── admin-login-btnbg.gif │ │ ├── logo.png │ │ ├── onCorrect.gif │ │ ├── onError.gif │ │ ├── onFocus.gif │ │ ├── onShow.gif │ │ └── tab-thbg.png │ └── js │ │ └── jquery-1.10.2.min.js ├── bootstrap │ ├── css │ │ ├── bootstrap.css │ │ ├── bootstrap.css.map │ │ ├── bootstrap.min.css │ │ └── bootstrap.min.css.map │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ └── js │ │ ├── Core Changelog.txt │ │ ├── Documentation │ │ └── index.html │ │ ├── Flash │ │ ├── ExternalCall.as │ │ ├── FileItem.as │ │ ├── SWFUpload v2.as3proj │ │ ├── SWFUpload.as │ │ ├── deploy.bat │ │ ├── obj │ │ │ ├── SWFUpload-v2Config.old │ │ │ └── SWFUpload-v2Config.xml │ │ └── swfupload.swf │ │ ├── bootstrap.js │ │ ├── bootstrap.min.js │ │ ├── check.js │ │ ├── npm.js │ │ ├── plugins │ │ ├── SWFObject License.txt │ │ ├── swfupload.cookies.js │ │ ├── swfupload.queue.js │ │ ├── swfupload.speed.js │ │ └── swfupload.swfobject.js │ │ ├── swfupload license.txt │ │ └── swfupload.js ├── images │ └── nopic_small.gif ├── install │ ├── css │ │ └── install.css │ ├── images │ │ ├── logo.png │ │ └── right.png │ └── layer │ │ ├── layer.js │ │ └── skin │ │ ├── default │ │ ├── icon-ext.png │ │ ├── icon.png │ │ ├── loading-0.gif │ │ ├── loading-1.gif │ │ └── loading-2.gif │ │ └── layer.css ├── js │ └── jquery-1.10.2.min.js ├── ueditor │ ├── dialogs │ │ ├── emotion │ │ │ ├── emotion.css │ │ │ ├── emotion.js │ │ │ └── images │ │ │ │ ├── 0.gif │ │ │ │ ├── bface.gif │ │ │ │ ├── cface.gif │ │ │ │ ├── fface.gif │ │ │ │ ├── jxface2.gif │ │ │ │ ├── neweditor-tab-bg.png │ │ │ │ ├── tface.gif │ │ │ │ ├── wface.gif │ │ │ │ └── yface.gif │ │ ├── formula │ │ │ ├── formula.css │ │ │ ├── formula.html │ │ │ ├── formula.js │ │ │ └── images │ │ │ │ └── formula.png │ │ ├── image │ │ │ ├── image.css │ │ │ ├── image.js │ │ │ └── images │ │ │ │ ├── close.png │ │ │ │ ├── upload1.png │ │ │ │ └── upload2.png │ │ ├── link │ │ │ └── link.js │ │ ├── map │ │ │ ├── map.html │ │ │ └── map.js │ │ └── video │ │ │ ├── images │ │ │ ├── center_focus.jpg │ │ │ ├── left_focus.jpg │ │ │ ├── none_focus.jpg │ │ │ └── right_focus.jpg │ │ │ ├── video.css │ │ │ └── video.js │ ├── lang │ │ └── zh-cn │ │ │ ├── images │ │ │ ├── copy.png │ │ │ ├── imglabel.png │ │ │ ├── localimage.png │ │ │ ├── music.png │ │ │ └── upload.png │ │ │ └── zh-cn.js │ ├── themes │ │ └── default │ │ │ ├── css │ │ │ ├── umeditor.css │ │ │ └── umeditor.min.css │ │ │ └── images │ │ │ ├── caret.png │ │ │ ├── close.png │ │ │ ├── icons.gif │ │ │ ├── icons.png │ │ │ ├── ok.gif │ │ │ ├── pop-bg.png │ │ │ ├── spacer.gif │ │ │ └── videologo.gif │ ├── umeditor.config.js │ └── umeditor.min.js └── webuploader │ ├── css │ └── webuploader.css │ ├── images │ ├── bg.png │ ├── icons.png │ ├── image.png │ ├── progress.png │ └── success.png │ └── js │ ├── Uploader.swf │ ├── upload.js │ └── webuploader.min.js ├── router.php ├── runtime ├── log │ ├── 201703 │ │ └── 16.log │ └── 201705 │ │ └── 25.log └── temp │ ├── 0c8b49059bc1ebbe048a5121bc1bf7a6.php │ ├── 17234b4be5c21c14091d612be45bd3bc.php │ ├── 210c8c356ba9bd3981b6ab43e9f305b8.php │ ├── 30d1cc99c1bc034e5c200ba707dd35a1.php │ ├── 475cf067fe13cd4ae194a4f93e6289fb.php │ ├── 6c53111cf3b524422fc724b9b7d7d0a2.php │ ├── 82ea6f6b4718772cb88cdadfeb464935.php │ ├── a53be606ea4014d3a783dc1d42a08787.php │ ├── b2fd86b9b813bac8e5a0c61c78bac52b.php │ ├── b444870957310c359fdda42c3909a8ee.php │ ├── b86381f1ff6d237a2d2dca38ef1726ee.php │ ├── cb3dc614ba1acd33d17896132e3ad7ec.php │ ├── cf54bafd355a108a93266bd22a0f461f.php │ ├── d3023fa7c137fe58ecb1423dc9f4a26c.php │ ├── dd63a90fe72680c336fcdfd81f850fa5.php │ └── f4cd5eabdab173c211f78c2339146fe0.php └── thinkphp ├── .travis.yml ├── CONTRIBUTING.md ├── LICENSE.txt ├── README.md ├── base.php ├── codecov.yml ├── composer.json ├── console.php ├── convention.php ├── helper.php ├── lang └── zh-cn.php ├── library ├── think │ ├── App.php │ ├── Build.php │ ├── Cache.php │ ├── Collection.php │ ├── Config.php │ ├── Console.php │ ├── Controller.php │ ├── Cookie.php │ ├── Db.php │ ├── Debug.php │ ├── Env.php │ ├── Error.php │ ├── Exception.php │ ├── File.php │ ├── Hook.php │ ├── Lang.php │ ├── Loader.php │ ├── Log.php │ ├── Model.php │ ├── Paginator.php │ ├── Process.php │ ├── Request.php │ ├── Response.php │ ├── Route.php │ ├── Session.php │ ├── Template.php │ ├── Url.php │ ├── Validate.php │ ├── View.php │ ├── cache │ │ ├── Driver.php │ │ └── driver │ │ │ ├── File.php │ │ │ ├── Lite.php │ │ │ ├── Memcache.php │ │ │ ├── Memcached.php │ │ │ ├── Redis.php │ │ │ ├── Sqlite.php │ │ │ ├── Wincache.php │ │ │ └── Xcache.php │ ├── config │ │ └── driver │ │ │ ├── Ini.php │ │ │ ├── Json.php │ │ │ └── Xml.php │ ├── console │ │ ├── Command.php │ │ ├── Input.php │ │ ├── LICENSE │ │ ├── Output.php │ │ ├── bin │ │ │ ├── README.md │ │ │ └── hiddeninput.exe │ │ ├── command │ │ │ ├── Build.php │ │ │ ├── Clear.php │ │ │ ├── Help.php │ │ │ ├── Lists.php │ │ │ ├── Make.php │ │ │ ├── make │ │ │ │ ├── Controller.php │ │ │ │ ├── Model.php │ │ │ │ └── stubs │ │ │ │ │ ├── controller.plain.stub │ │ │ │ │ ├── controller.stub │ │ │ │ │ └── model.stub │ │ │ └── optimize │ │ │ │ ├── Autoload.php │ │ │ │ ├── Config.php │ │ │ │ ├── Route.php │ │ │ │ └── Schema.php │ │ ├── input │ │ │ ├── Argument.php │ │ │ ├── Definition.php │ │ │ └── Option.php │ │ └── output │ │ │ ├── Ask.php │ │ │ ├── Descriptor.php │ │ │ ├── Formatter.php │ │ │ ├── Question.php │ │ │ ├── descriptor │ │ │ └── Console.php │ │ │ ├── driver │ │ │ ├── Buffer.php │ │ │ ├── Console.php │ │ │ └── Nothing.php │ │ │ ├── formatter │ │ │ ├── Stack.php │ │ │ └── Style.php │ │ │ └── question │ │ │ ├── Choice.php │ │ │ └── Confirmation.php │ ├── controller │ │ ├── Rest.php │ │ └── Yar.php │ ├── db │ │ ├── Builder.php │ │ ├── Connection.php │ │ ├── Query.php │ │ ├── builder │ │ │ ├── Mysql.php │ │ │ ├── Pgsql.php │ │ │ ├── Sqlite.php │ │ │ └── Sqlsrv.php │ │ ├── connector │ │ │ ├── Mysql.php │ │ │ ├── Pgsql.php │ │ │ ├── Sqlite.php │ │ │ ├── Sqlsrv.php │ │ │ └── pgsql.sql │ │ └── exception │ │ │ ├── BindParamException.php │ │ │ ├── DataNotFoundException.php │ │ │ └── ModelNotFoundException.php │ ├── debug │ │ ├── Console.php │ │ └── Html.php │ ├── exception │ │ ├── ClassNotFoundException.php │ │ ├── DbException.php │ │ ├── ErrorException.php │ │ ├── Handle.php │ │ ├── HttpException.php │ │ ├── HttpResponseException.php │ │ ├── PDOException.php │ │ ├── RouteNotFoundException.php │ │ ├── TemplateNotFoundException.php │ │ ├── ThrowableError.php │ │ └── ValidateException.php │ ├── log │ │ └── driver │ │ │ ├── File.php │ │ │ ├── Socket.php │ │ │ └── Test.php │ ├── model │ │ ├── Merge.php │ │ ├── Pivot.php │ │ └── Relation.php │ ├── paginator │ │ ├── Collection.php │ │ └── driver │ │ │ └── Bootstrap.php │ ├── process │ │ ├── Builder.php │ │ ├── Utils.php │ │ ├── exception │ │ │ ├── Faild.php │ │ │ └── Timeout.php │ │ └── pipes │ │ │ ├── Pipes.php │ │ │ ├── Unix.php │ │ │ └── Windows.php │ ├── response │ │ ├── Json.php │ │ ├── Jsonp.php │ │ ├── Redirect.php │ │ ├── View.php │ │ └── Xml.php │ ├── session │ │ └── driver │ │ │ ├── Memcache.php │ │ │ ├── Memcached.php │ │ │ └── Redis.php │ ├── template │ │ ├── TagLib.php │ │ ├── driver │ │ │ └── File.php │ │ └── taglib │ │ │ └── Cx.php │ └── view │ │ └── driver │ │ ├── Php.php │ │ └── Think.php └── traits │ ├── controller │ └── Jump.php │ ├── model │ └── SoftDelete.php │ └── think │ └── Instance.php ├── logo.png ├── phpunit.xml ├── start.php └── tpl ├── default_index.tpl ├── dispatch_jump.tpl ├── page_trace.tpl └── think_exception.tpl /README.md: -------------------------------------------------------------------------------- 1 | # tp5cms 2 | 一个基于thinkphp5的cms框架,前端采用swiper+bootstrap+自定义layout,外观相当美观。考虑到目前市场成熟的基于php的cms都商业收费,具有一定的使用成本,而且比较难定制开发,故本人收集到该代码时首先考虑到免费开源。系统存在一些问题,需要修改,本人希望本人和同行小伙伴们继续后面的工作,开发出一套基于php的真正免费开源的cms。 3 | -------------------------------------------------------------------------------- /admin.php: -------------------------------------------------------------------------------- 1 | isPost()) { 11 | $data = input('post.'); 12 | $id=session('cms_admin_id'); 13 | $r=db('admin')->where('id',$id)->find(); 14 | if($r['password']!=md5(md5($data['password_o']).$r['encrypt'])){ 15 | $this->error('原密码错误'); 16 | } 17 | if($data['password_n']!=$data['password_r']){ 18 | $this->error('新密码与重复密码不一致'); 19 | } 20 | $encrypt=create_randomstr(); 21 | $password=md5(md5($data['password_n']).$encrypt); 22 | db('admin')->where('id',$id)->update(['password'=>$password,'encrypt'=>$encrypt]); 23 | $this->success('密码修改成功','Login/index'); 24 | } 25 | return $this->fetch(); 26 | } 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /application/admin/controller/Attachment.php: -------------------------------------------------------------------------------- 1 | check(); 10 | $list = db('attachment')->order('id desc')->paginate(10); 11 | $page = $list->render(); 12 | $this->assign('list', $list); 13 | $this->assign('page', $page); 14 | return $this->fetch(); 15 | } 16 | public function check() 17 | { 18 | $list = db('attachment')->field('id,filepath')->select(); 19 | foreach ($list as $v) { 20 | if (!is_file($v['filepath'])) { 21 | db('attachment')->where('id', $v['id'])->delete(); 22 | } 23 | } 24 | if (!db('article')->limit(1)->select()&&!db('category')->limit(1)->select()) { 25 | $list = db('attachment')->field('id,filepath')->select(); 26 | foreach ($list as $v) { 27 | if (is_file($v['filepath'])) { 28 | @unlink($v['filepath']); 29 | } 30 | db('attachment')->where('id', $v['id'])->delete(); 31 | } 32 | } 33 | } 34 | public function delete() 35 | { 36 | $data = input('param.'); 37 | if (!isset($data['id']) || empty($data['id'])) { 38 | $this->error('参数错误'); 39 | } 40 | if (is_array($data['id'])) { 41 | foreach ($data['id'] as $v) { 42 | $v = intval($v); 43 | $file = db('attachment')->where('id', $v)->value('filepath'); 44 | db('attachment')->where('id', $v)->delete(); 45 | @unlink($file); 46 | } 47 | $this->success('删除成功'); 48 | } else { 49 | $id = intval($data['id']); 50 | if (!$id) { 51 | $this->error('非法参数'); 52 | } 53 | $file = db('attachment')->where('id', $id)->value('filepath'); 54 | db('attachment')->where('id', $id)->delete(); 55 | @unlink($file); 56 | $this->success('删除成功'); 57 | } 58 | $this->success('删除成功'); 59 | } 60 | } -------------------------------------------------------------------------------- /application/admin/controller/Common.php: -------------------------------------------------------------------------------- 1 | time() - session('cms_login_time') > 2 * 60 * 60) { 11 | session('cms_admin_username', null); 12 | session('cms_admin_id', null); 13 | session('cms_login_time', null); 14 | $this->redirect(url('Login/index')); 15 | } 16 | } 17 | public function logout() 18 | { 19 | session('cms_admin_username', null); 20 | session('cms_admin_id', null); 21 | session('cms_login_time', null); 22 | $this->success('退出成功', 'Login/index'); 23 | } 24 | public function cache() 25 | { 26 | $path=RUNTIME_PATH; 27 | delDirAndFile($path); 28 | $this->success('清除缓存成功'); 29 | } 30 | } -------------------------------------------------------------------------------- /application/admin/controller/Index.php: -------------------------------------------------------------------------------- 1 | PHP_OS.' '.$_SERVER["SERVER_SOFTWARE"], 13 | 'PHP运行方式' => php_sapi_name(), 14 | //'MYSQL版本' => mysql_get_client_info(), 15 | '上传附件限制' => ini_get('upload_max_filesize'), 16 | '执行时间限制' => ini_get('max_execution_time').'秒', 17 | '磁盘剩余空间 '=> round((@disk_free_space(".")/(1024*1024)),2).'M', 18 | ]; 19 | $this->assign('server_info',$server_info); 20 | return $this->fetch(); 21 | } 22 | 23 | 24 | } 25 | -------------------------------------------------------------------------------- /application/admin/controller/Login.php: -------------------------------------------------------------------------------- 1 | fetch('login'); 12 | } 13 | public function doLogin() 14 | { 15 | if (request()->isPost()) { 16 | $username = input('username'); 17 | $passowrd = input('password'); 18 | $code = input('code'); 19 | $rule = ['username' => 'require|max:20', 'password' => 'require|max:20', 'code' => 'require']; 20 | $msg = ['username.require' => '用户名必须填写', 'username.max' => '用户名最多不能超过20个字符', 'password.require' => '密码必须填写', 'password.between' => '密码最多不能超过20个字符', 'code.require' => '验证码必须填写']; 21 | $data = ['username' => $username, 'password' => $passowrd, 'code' => $code]; 22 | $validate = new Validate($rule, $msg); 23 | if (!$validate->check($data)) { 24 | $this->error($validate->getError()); 25 | } 26 | 27 | $captcha = new \org\Captcha(); 28 | if (!$captcha->check($code)) { 29 | $this->error('验证码错误'); 30 | } 31 | $r = db('admin')->where('username', $username)->find(); 32 | if (!$r) { 33 | $this->error('用户名不存在'); 34 | } 35 | if ($r['password'] != md5(md5($passowrd).$r['encrypt'])) { 36 | $this->error('密码错误'); 37 | } 38 | session('cms_admin_id', $r['id']); 39 | session('cms_admin_username', $username); 40 | session('cms_login_time', request()->time()); 41 | unset($r); 42 | db('admin')->where('username', $username)->update(['lastip' => request()->ip(), 'lasttime' => request()->time()]); 43 | $this->success('登录成功', 'Index/index'); 44 | } 45 | } 46 | public function captcha() 47 | { 48 | $captcha = new \org\Captcha(config('captcha')); 49 | $captcha->entry(); 50 | } 51 | } -------------------------------------------------------------------------------- /application/admin/controller/System.php: -------------------------------------------------------------------------------- 1 | isPost()) { 11 | $data = input('post.'); 12 | db('system')->where('id',1)->update($data); 13 | $this->success('设置成功'); 14 | } 15 | $detail = db('system')->where('id',1)->find(); 16 | $this->assign('detail', $detail); 17 | return $this->fetch(); 18 | } 19 | 20 | 21 | } 22 | -------------------------------------------------------------------------------- /application/admin/controller/Tag.php: -------------------------------------------------------------------------------- 1 | check(); 10 | $tag_list = db('tag')->order('tagid desc')->paginate(10); 11 | $page = $tag_list->render(); 12 | $this->assign('tag_list', $tag_list); 13 | $this->assign('page', $page); 14 | return $this->fetch(); 15 | } 16 | private function check() 17 | { 18 | db('tag')->where('tag', '')->delete(); 19 | if (!db('article')->limit(1)->select() || !db('tag')->limit(1)->select() || !db('tag_data')->limit(1)->select()) { 20 | db('tag')->where(1)->delete(); 21 | db('tag_data')->where(1)->delete(); 22 | } 23 | $list = db('tag_data')->field('contentid')->select(); 24 | foreach ($list as $v) { 25 | if (!db('article')->where('id', $v['contentid'])->find()) { 26 | db('tag_data')->where('content', $v['contentid'])->delete(); 27 | } 28 | } 29 | } 30 | public function delete() 31 | { 32 | $data = input('param.'); 33 | if (!isset($data['tagid']) || empty($data['tagid'])) { 34 | $this->error('参数错误'); 35 | } 36 | if (is_array($data['tagid'])) { 37 | foreach ($data['tagid'] as $v) { 38 | $v = intval($v); 39 | db('tag')->where('tagid', $v)->delete(); 40 | db('tag_data')->where('tagid', $v)->delete(); 41 | } 42 | $this->success('删除成功'); 43 | } else { 44 | $tagid = intval($data['tagid']); 45 | if (!$tagid) { 46 | $this->error('非法参数'); 47 | } 48 | db('tag')->where('tagid', $tagid)->delete(); 49 | db('tag_data')->where('tagid', $tagid)->delete(); 50 | $this->success('删除成功'); 51 | } 52 | $this->success('删除成功'); 53 | } 54 | } -------------------------------------------------------------------------------- /application/admin/controller/Upload.php: -------------------------------------------------------------------------------- 1 | file('file'); 10 | $info = $file->move('./uploads/'); 11 | if (!empty($info)) { 12 | $attachment['filename'] = $info->getFilename(); 13 | $attachment['filepath'] = 'uploads/' . pathConvert($info->getSaveName()); 14 | $attachment['fileext'] = $info->getExtension(); 15 | $attachment['filesize'] = $info->getSize(); 16 | $attachment['inputtime'] = request()->time(); 17 | db('attachment')->insert($attachment); 18 | $data['path'] = __ROOT__ . '/uploads/' . pathConvert($info->getSaveName()); 19 | $data['code'] = 1; 20 | $data['message'] = '上传成功!'; 21 | } else { 22 | $data['path'] = ''; 23 | $data['code'] = 0; 24 | $data['message'] = '上传失败!'; 25 | } 26 | return json($data); 27 | } 28 | 29 | public function ueditor() 30 | { 31 | $config = ["savePath" => "uploads/", "maxSize" => 1024, "allowFiles" => [".gif", ".png", ".jpg", ".jpeg", ".bmp"]]; 32 | $up = new \org\Uploader("upfile", $config); 33 | $info = $up->getFileInfo(); 34 | db('attachment')->insert(array('filename' => $info['name'], 'filepath' => $info['url'], 'fileext' =>str_replace('.','',$info['type']), 'filesize' => $info['size'], 'inputtime' => request()->time())); 35 | echo json_encode($info); 36 | } 37 | } -------------------------------------------------------------------------------- /application/admin/view/admin/password.html: -------------------------------------------------------------------------------- 1 | {include file="public:header" /} 2 |