From f741c241c0c97e1b1b360b61a1f8f650afad276a Mon Sep 17 00:00:00 2001 From: taoser Date: Sun, 25 Jul 2021 15:01:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=89=8D=E7=AB=AF=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- view/README.md | 86 +++++ view/app/BaseController.php | 192 +++++++++++ view/app/common/validate/User.php | 80 +++++ view/app/index/controller/Article.php | 380 +++++++++++++++++++++ view/app/index/controller/Login.php | 209 ++++++++++++ view/app/index/controller/User.php | 251 ++++++++++++++ view/app/index/route/route.php | 37 ++ view/config/taoler.php | 24 ++ view/public/static/layui/jquery.min.js | 2 + view/public/static/res/mods/user.js | 378 ++++++++++++++++++++ view/view/taoler/index/article/add.html | 260 ++++++++++++++ view/view/taoler/index/article/detail.html | 335 ++++++++++++++++++ view/view/taoler/index/article/edit.html | 270 +++++++++++++++ view/view/taoler/index/login/forget.html | 186 ++++++++++ view/view/taoler/index/login/reg.html | 105 ++++++ view/view/taoler/index/public/user.html | 53 +++ view/view/taoler/index/user/set.html | 171 ++++++++++ 17 files changed, 3019 insertions(+) create mode 100644 view/README.md create mode 100644 view/app/BaseController.php create mode 100644 view/app/common/validate/User.php create mode 100644 view/app/index/controller/Article.php create mode 100644 view/app/index/controller/Login.php create mode 100644 view/app/index/controller/User.php create mode 100644 view/app/index/route/route.php create mode 100644 view/config/taoler.php create mode 100644 view/public/static/layui/jquery.min.js create mode 100644 view/public/static/res/mods/user.js create mode 100644 view/view/taoler/index/article/add.html create mode 100644 view/view/taoler/index/article/detail.html create mode 100644 view/view/taoler/index/article/edit.html create mode 100644 view/view/taoler/index/login/forget.html create mode 100644 view/view/taoler/index/login/reg.html create mode 100644 view/view/taoler/index/public/user.html create mode 100644 view/view/taoler/index/user/set.html diff --git a/view/README.md b/view/README.md new file mode 100644 index 0000000..aba17b3 --- /dev/null +++ b/view/README.md @@ -0,0 +1,86 @@ +# TaoLer + +> TaoLer是一个简单迅捷的轻论坛系统,适用于个人或组织区域型信息交流发布平台。 + + * 官网:https://www.aieok.com:8443 + * 前台:http://bbs.aieok.com:888 + * 后台:http://adm.aieok.com:888 + * 账号:test + * 密码:test123 + * 版本:TaoLer 1.7.26 + * 日期:2021.7.24 + +#### 项目地址 + +1. gitee https://www.gitee.com/toogee/Taoler +2. github https://www.github.com/taoser/TaoLer +3. composer create-project taoser/taoler + +#### 介绍 + +1. 采用动态密码加密,相同密码在入库时具有唯一性,即使管理员也无法破解,用户信息安全牢固。 +2. 系统采用最新版TinkPHP6框架开发,底层安全可靠,数据查询更快,运行效率更高,网站速度更快。 +3. 自适应前端,桌面和移动端访问界面友好简洁,模块清晰。 +4. 完善的后台系统,管理便捷,动态菜单和权限角色分配系统。支持3级菜单和无限极分类。 +5. 双升级系统,可支持自动和手动升级。可在线检测并升级系统,保持网站的更新和安全。 +6. 代码开源,不设暗门操作,更安全。 +7. 项目会长期维护,优化更新。 + + +#### 构架组成 +- 1.x版本构架: + - 构架:Tinkphp6 + layui2.6 + - 环境:php7 + mysql + - 前端:Fly template V3.0 + +#### 构架介绍 + 快速、简单的面向对象的轻量级PHP开发框架,出色的性能和至简代码的,更注重易用性。代码维护方便。 + layui前端 + 极简、丰盈,简单高效,模块化UI框架,体积轻盈,组件丰盈。 + Fly模板: + 一款至简的社区模板,适合政府机构、教育机构、事业单位、商业企业、个人站长等众多行业领域。 + +#### 安装教程 +1. 首选确保满目使用环境要求,php > 7.2, mysql > 5.7.3 +2. git下载:https://gitee.com/toogee/TaoLer + 官网下载:https://www.aieok.com +3. 解压后,项目绑定域名为public目录对外访问,如果使用nginx服务器,首先设置伪静态Nginx.conf。 + ```html + location / { // …..省略部分代码 + if (!-e $request_filename) { + rewrite ^(.*)$ /index.php?s=/$1 last; + } + } + ``` +4. 首次安装,访问域名http://www.youdomain.com可自动跳转到/install/index进行引导安装,重新安装需删除public目录下install.lock。 +5. 安装前需要先创建mysql数据库(准备:数据库连接地址,数据库用户名,数据库密码,数据库端口,建好在数据库名) +6. 请牢记安装设置的管理员用户名和密码,默认admin/123456。前后台的管理员密码一致。前后端管理员账户是独立的,前端主要对文章内容的审查管理等操作。 + +#### 使用说明 + +1. 安装后本系统已配置默认演示数据,可以删除原数据或者进行数据的修改 +2. 后台可设置分类cate,一定要设置英文别名 +3. 首页有置顶模块,列表文章模块,右侧包含广告模块,回复展示模块 + +#### 文档 + + 参考官网分享文章 + + aieok.com (http://wiki.aieok.com) + +#### 参与贡献 + +1. Fork 本仓库 +2. 新建 Feat_xxx 分支 +3. 提交代码 +4. 新建 Pull Request + +#### 版权信息 + +非商业可免费使用,没有功能限制,但不能更改版本信息,如需更改可购买授权。 + +本项目包含的第三方源码和二进制文件之版权信息另行标注。 + +版权所有Copyright © 2020-2021 by aieok.com (https://www.aieok.com) + +All rights reserved。 diff --git a/view/app/BaseController.php b/view/app/BaseController.php new file mode 100644 index 0000000..b185718 --- /dev/null +++ b/view/app/BaseController.php @@ -0,0 +1,192 @@ +app = $app; + $this->request = $this->app->request; + + // 控制器初始化 + $this->initialize(); + } + + // 初始化 + protected function initialize() + {} + + /** + * 验证数据 + * @access protected + * @param array $data 数据 + * @param string|array $validate 验证器名或者验证规则数组 + * @param array $message 提示信息 + * @param bool $batch 是否批量验证 + * @return array|string|true + * @throws ValidateException + */ + protected function validate(array $data, $validate, array $message = [], bool $batch = false) + { + if (is_array($validate)) { + $v = new Validate(); + $v->rule($validate); + } else { + if (strpos($validate, '.')) { + // 支持场景 + [$validate, $scene] = explode('.', $validate); + } + $class = false !== strpos($validate, '\\') ? $validate : $this->app->parseClass('validate', $validate); + $v = new $class(); + if (!empty($scene)) { + $v->scene($scene); + } + } + + $v->message($message); + + // 是否批量验证 + if ($batch || $this->batchValidate) { + $v->batch(true); + } + + return $v->failException(true)->check($data); + } + + /** + * 操作错误跳转 + * @param mixed $msg 提示信息 + * @param string $url 跳转的URL地址 + * @param mixed $data 返回的数据 + * @param integer $wait 跳转等待时间 + * @param array $header 发送的Header信息 + * @return void + */ + protected function error($msg = '', string $url = null, $data = '', int $wait = 3, array $header = []): Response + { + if (is_null($url)) { + $url = request()->isAjax() ? '' : 'javascript:history.back(-1);'; + } elseif ($url) { + $url = (strpos($url, '://') || 0 === strpos($url, '/')) ? $url : app('route')->buildUrl($url); + } + + $result = [ + 'code' => 0, + 'msg' => $msg, + 'data' => $data, + 'url' => $url, + 'wait' => $wait, + ]; + + $type = (request()->isJson() || request()->isAjax()) ? 'json' : 'html'; + if ('html' == strtolower($type)) { + $type = 'jump'; + } + + $response = Response::create($result, $type)->header($header)->options(['jump_template' => app('config')->get('app.dispatch_error_tmpl')]); + + throw new HttpResponseException($response); + } + + /** + * 返回封装后的API数据到客户端 + * @param mixed $data 要返回的数据 + * @param integer $code 返回的code + * @param mixed $msg 提示信息 + * @param string $type 返回数据格式 + * @param array $header 发送的Header信息 + * @return Response + */ + protected function result($data, int $code = 0, $msg = '', string $type = '', array $header = []): Response + { + $result = [ + 'code' => $code, + 'msg' => $msg, + 'time' => time(), + 'data' => $data, + ]; + + $type = $type ?: 'json'; + $response = Response::create($result, $type)->header($header); + + throw new HttpResponseException($response); + } + + /** + * 操作成功跳转 + * @param mixed $msg 提示信息 + * @param string $url 跳转的URL地址 + * @param mixed $data 返回的数据 + * @param integer $wait 跳转等待时间 + * @param array $header 发送的Header信息 + * @return void + */ + protected function success($msg = '', string $url = null, $data = '', int $wait = 3, array $header = []): Response + { + if (is_null($url) && isset($_SERVER["HTTP_REFERER"])) { + $url = $_SERVER["HTTP_REFERER"]; + } elseif ($url) { + $url = (strpos($url, '://') || 0 === strpos($url, '/')) ? $url : app('route')->buildUrl($url); + } + + $result = [ + 'code' => 1, + 'msg' => $msg, + 'data' => $data, + 'url' => $url, + 'wait' => $wait, + ]; + + $type = (request()->isJson() || request()->isAjax()) ? 'json' : 'html'; + // 把跳转模板的渲染下沉,这样在 response_send 行为里通过getData()获得的数据是一致性的格式 + if ('html' == strtolower($type)) { + $type = 'jump'; + } + + $response = Response::create($result, $type)->header($header)->options(['jump_template' => app('config')->get('app.dispatch_success_tmpl')]); + + throw new HttpResponseException($response); + } + + +} diff --git a/view/app/common/validate/User.php b/view/app/common/validate/User.php new file mode 100644 index 0000000..d465414 --- /dev/null +++ b/view/app/common/validate/User.php @@ -0,0 +1,80 @@ + 'require|min:2|max:18|chsDash|unique:user', + 'email|邮箱' => 'require|email|unique:user', + 'password|密码' => 'require|min:6|max:20', + 'repassword|确认密码'=>'require|confirm:password', + 'nickname|昵称' => 'require|min:2|max:20', + 'captcha|验证码' => 'require|captcha', + 'city|城市' => 'min:2|max:25', + 'sign|签名' => 'min:10|max:100', + 'sex|性别' => 'require', + 'nowpass|新密码' => 'require|min:6|max:20', + 'code|校验码' => 'require|length:4', + ]; + + //邮件邮件码验证 + public function sceneCode() + { + return $this->only(['code']); + } + + //name登陆验证场景 + public function sceneLoginName() + { + return $this->only(['name','password','captcha']) + ->remove('name', 'unique'); + } + + //emai登陆验证场景 + public function sceneLoginEmail() + { + return $this->only(['email','password','captcha']) + ->remove('email', 'unique'); + } + + //注册验证场景 + public function sceneReg() + { + return $this->only(['name','email','password','repassword','captcha']); + + } + + //密码找回 + public function sceneForget() + { + return $this->only(['email','captcha']) + ->remove('email', 'unique'); + } + + //密码重设 + public function sceneRepass() + { + return $this->only(['password','repassword','captcha']); + } + + //密码重置 + public function sceneRespass() + { + return $this->only(['password','repassword','captcha']); + } + + //用户资料 + public function sceneSet() + { + return $this->only(['email','nickname','ctity','sex','sign']) + ->remove('email','unique'); + } + + //设置新密码 + public function sceneSetpass() + { + return $this->only(['nowpass','password','repassword']); + } +} \ No newline at end of file diff --git a/view/app/index/controller/Article.php b/view/app/index/controller/Article.php new file mode 100644 index 0000000..5509049 --- /dev/null +++ b/view/app/index/controller/Article.php @@ -0,0 +1,380 @@ + ['except' => ['cate','detail','download'] ], + ]; + + //文章分类 + public function cate() + { + //非法请求参数,抛出异常 + if(count(Request::param()) >3){ + // 抛出 HTTP 异常 + throw new \think\exception\HttpException(404, '请求异常'); + } + + //获取分类ID + $ename = Request::param('ename'); + $type = Request::param('type') ?? 'all'; + + //分页伪静态 + $str = Request::baseUrl(); //不带参数在url + $patterns = "/\d+/"; //数字正则 + preg_match($patterns,$str,$arr); //正则查询页码出现在位置 + //检测route配置中是否设置了伪静态后缀 + $suffix = Config::get('route.url_html_suffix') ? '.'.Config::get('route.url_html_suffix') : '/'; + if(Config::get('route.url_html_suffix')){ + //伪静态有后缀 + if(isset($arr[0])){ + $page = $arr[0]; + $url = strstr($str,$arr[0],true); + } else { + $page = 1; + $url = strstr($str,'.html',true).'/'; + } + } else { + //伪静态后缀false + if(isset($arr[0])){ + $page = $arr[0]; + $url = strstr($str,$arr[0],true); + } else { + $page = 1; + $url = $str.'/'; + } + } + //分类列表 + $article = new ArticleModel(); + $artList = $article->getCateList($ename,$type,$page,$url,$suffix); + + // 热议文章 + $artHot = $article->getArtHot(10); + + //广告 + $ad = new Slider(); + //分类图片 + $ad_cateImg = $ad->getSliderList(3); + //分类钻展赞助 + $ad_comm = $ad->getSliderList(6); + + View::assign(['type'=>$type,'artList'=>$artList,'artHot'=>$artHot,'ad_cateImg'=>$ad_cateImg,'ad_comm'=>$ad_comm,'jspage'=>'jie']); + return View::fetch(); + } + + //文章详情页 + public function detail($id) + { + $article = new ArticleModel(); + $artDetail = $article->getArtDetail($id); + if(!$artDetail){ + // 抛出 HTTP 异常 + throw new \think\exception\HttpException(404, '异常消息'); + } + $comments = $artDetail->comments()->where('status',1)->order(['cai'=>'asc','create_time'=>'asc'])->paginate(10); + //$comment = new \app\common\model\Comment(); + //$comments = $comment->getComment($id); + //dump($comments); + $artDetail->inc('pv')->update(); + $pv = Db::name('article')->field('pv')->where('id',$id)->value('pv'); + $download = $artDetail->upzip ? download($artDetail->upzip,'file') : ''; + +/* + $nt = time(); + $ft = $article->comments; + $ct[] = []; + foreach($ft as $c){ + $t = $c->create_time; + $ct[] = intval(($nt - strtotime($t))/86400); + } + dump($nt); + dump($ct); + $this->assign('ct',$ct); + $article->append(['comment.ct'])->toArray(); + //halt($article); +*/ + + // 热议文章 + $artHot = $article->getArtHot(10); + //广告 + $ad = new Slider(); + //分类图片 + $ad_artImg = $ad->getSliderList(4); + //分类钻展赞助 + $ad_comm = $ad->getSliderList(7); + + View::assign(['article'=>$artDetail,'pv'=>$pv,'comments'=>$comments,'artHot'=>$artHot,'ad_art'=>$ad_artImg,'ad_comm'=>$ad_comm,$download,'jspage'=>'jie']); + return View::fetch(); + } + + //文章评论 + public function comment() + { + if (Request::isAjax()){ + //获取评论 + $data = Request::only(['content','article_id','user_id']); + $sendId = $data['user_id']; + if(empty($data['content'])){ + return json(['code'=>0, 'msg'=>'评论不能为空!']); + } + + //用户留言存入数据库 + if (Comment::create($data)) { + //站内信 + $article = Db::name('article')->field('id,title,user_id')->where('id',$data['article_id'])->find(); + $title = $article['title']; + $link = (string) url('article/detail',['id'=>$data['article_id']]); + + //评论中回复@user comment + $preg = "/@([^@\s]*)\s/"; + preg_match($preg,$data['content'],$username); + if(isset($username[1])){ + $receveId = Db::name('user')->whereOr('nickname', $username[1])->whereOr('name', $username[1])->value('id'); + } else { + $receveId = $article['user_id']; + } + $data = ['title'=>$title,'content'=>'评论通知','link'=>$link,'user_id'=>$sendId,'type'=>2]; //type=2为评论留言 + Message::sendMsg($sendId,$receveId,$data); + if(Config::get('taoler.config.email_notice')) mailto($this->showUser(1)['email'],'评论审核通知','Hi亲爱的管理员:
用户'.$this->showUser($this->uid)['name'].'刚刚对 '.$title.' 发表了评论,请尽快处理。'); + $res = ['code'=>0, 'msg'=>'留言成功']; + } else { + $res = ['code'=>-1, 'msg'=>'留言失败']; + } + return json($res); + } + } + + /** + * 添加帖子文章 + * @return string|\think\Response|\think\response\Json|void + */ + public function add() + { + if (Request::isAjax()) { + $data = Request::only(['cate_id', 'title', 'title_color', 'user_id', 'content', 'upzip', 'tags', 'captcha']); + $validate = new \app\common\validate\Article; //调用验证器 + $result = $validate->scene('Artadd')->check($data); //进行数据验证 + if (true !== $result) { + return Msgres::error($validate->getError()); + } + + //获取内容图片音视频标识 + $iva= $this->hasIva($data['content']); + $data = array_merge($data,$iva); + + $article = new ArticleModel(); + $result = $article->add($data); + if ($result == 1) { + $aid = Db::name('article')->max('id'); + $link = (string)url('article/detail', ['id' => $aid]); + //清除文章tag缓存 + Cache::tag('tagArtDetail')->clear(); + if(Config::get('taoler.config.email_notice')) mailto($this->showUser(1)['email'],'发帖审核通知','Hi亲爱的管理员:
用户'.$this->showUser($this->uid)['name'].'刚刚发表了 '.$data['title'].' 新的帖子,请尽快处理。'); + $res = Msgres::success('add_success', $link); + } else { + $res = Msgres::error('add_error'); + } + return $res; + } + View::assign(['jspage'=>'jie']); + return View::fetch(); + } + + /** + * 编辑文章 + * @param $id + * @return string|\think\Response|\think\response\Json|void + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + */ + public function edit($id) + { + $article = ArticleModel::find($id); + //编辑 + if(Request::isAjax()){ + $data = Request::only(['id','cate_id','title','title_color','user_id','content','upzip','tags','captcha']); + $validate = new \app\common\validate\Article(); //调用验证器 + $res = $validate->scene('Artadd')->check($data); //进行数据验证 + + if(true !== $res){ + return Msgres::error($validate->getError()); + } else { + //获取内容图片音视频标识 + $iva= $this->hasIva($data['content']); + $data = array_merge($data,$iva); + + $result = $article->edit($data); + if($result == 1) { + //删除原有缓存显示编辑后内容 + Cache::delete('article_'.$id); + $link = (string) url('article/detail',['id'=> $id]); + $editRes = Msgres::success('edit_success',$link); + } else { + $editRes = Msgres::error($result); + } + return $editRes; + } + } + //查询标签 + $tag = $article->tags; + $attr = explode(',',$tag); + $tags = []; + foreach($attr as $key=>$v){ + if ($v !='') { + $tags[] = $v; + } + } + + View::assign(['article'=>$article,'tags'=>$tags,'jspage'=>'jie']); + return View::fetch(); + } + + //删除帖子 + public function delete() + { + $article = ArticleModel::find(input('id')); + $result = $article->together(['comments'])->delete(); + if($result) { + $res = Msgres::success('delete_success'); + } else { + $res = Msgres::error('delete_error'); + } + return $res; + } + + public function uploads() + { + $type = Request::param('type'); + $uploads = new Uploads(); + switch ($type){ + case 'image': + $upRes = $uploads->put('file','article_pic',1024,'image'); + break; + case 'zip': + $upRes = $uploads->put('file','article_zip',1024,'application|image'); + break; + case 'video': + $upRes = $uploads->put('file','article_video',102400,'video|audio'); + break; + case 'audio': + $upRes = $uploads->put('file','article_audio',102400,'audio'); + break; + default: + $upRes = $uploads->put('file','article_file',1024,'image'); + break; + } + return $upRes; + } + + //附件下载 + public function download($id) + { + $zipdir = Db::name('article')->where('id',$id)->value('upzip'); + $zip = substr($zipdir,1); + Db::name('article')->cache(true)->where('id',$id)->inc('downloads')->update(); + //删除缓存显示下载后数据 + Cache::delete('article_'.$id); + return download($zip,'my'); + } + + //添加tag + public function tags() + { + $data = Request::only(['tags']); + $att = explode(',',$data['tags']); + $tags = []; + foreach($att as $v){ + if ($v !='') { + $tags[] = $v; + } + } + return json(['code'=>0,'data'=>$tags]); + } + + //文章置顶,状态 + public function jieset(){ + $data = Request::param(); + $article = ArticleModel::field('id,is_top,is_hot,is_reply')->find($data['id']); + switch ($data['field']){ + case 'top': + if($data['rank']==1){ + $article->save(['is_top' => 1]); + $res = ['status'=>0,'msg'=>'置顶成功']; + } else { + $article->save(['is_top' => 0]); + $res = ['status'=>0,'msg'=>'已取消置顶']; + } + break; + case 'hot': + if($data['rank']==1){ + $article->save(['is_hot' => 1]); + $res = ['status'=>0,'msg'=>'已设精贴']; + } else { + $article->save(['is_hot' => 0]); + $res = ['status'=>0,'msg'=>'精贴已取消']; + } + break; + case 'reply': + if($data['rank']==1){ + $article->save(['is_reply' => 1]); + $res = ['status'=>0,'msg'=>'本帖禁评']; + } else { + $article->save(['is_reply' => 0]); + $res = ['status'=>0,'msg'=>'禁评已取消']; + } + } + //删除本贴设置缓存显示编辑后内容 + Cache::delete('article_'.$data['id']); + //清除文章tag缓存 + Cache::tag('tagArtDetail')->clear(); + return json($res); + } + + //改变标题颜色 + public function titleColor() + { + $data = Request::param(); + $result = ArticleModel::update($data); + if($result){ + //清除文章缓存 + Cache::tag(['tagArt','tagArtDetail'])->clear(); + $res = ['code'=> 0, 'msg'=>'标题颜色设置成功']; + }else{ + $res = ['code'=> -1, 'msg'=>'标题颜色设置失败']; + } + return json($res); + } + + //内容中是否有图片视频音频插入 + public function hasIva($content) + { + //判断是否插入图片 + $isHasImg = strpos($content,'img['); + $data['has_img'] = is_int($isHasImg) ? 1 : 0; + //判断是否插入视频 + $isHasVideo = strpos($content,'video('); + $data['has_video'] = is_int($isHasVideo) ? 1 : 0; + //判断是否插入音频 + $isHasAudio = strpos($content,'audio['); + $data['has_audio'] = is_int($isHasAudio) ? 1 : 0; + + return $data; + } + +} \ No newline at end of file diff --git a/view/app/index/controller/Login.php b/view/app/index/controller/Login.php new file mode 100644 index 0000000..7070d61 --- /dev/null +++ b/view/app/index/controller/Login.php @@ -0,0 +1,209 @@ + ['except' => ['index'] ] + ]; + + //给模板中JScace文件赋值 + protected function initialize() + { + parent::initialize(); + View::assign(['jspage'=>'']); + } + + //用户登陆 + public function index() + { + //已登陆跳出 + if(Session::has('user_id')){ + return redirect((string) url('user/index')); + } + //获取登录前访问页面refer + $refer = Request::server('HTTP_REFERER'); + //$domain = Request::domain(); + //截取域名后面的字符 + //$url = substr($refer,strlen($domain)); + Cookie::set('url',$refer); + if(Request::isAjax()) { + //登陆前数据校验 + $data = Request::param(); + + //邮箱正则表达式 + $pattern = "/^([0-9A-Za-z\\-_\\.]+)@([0-9a-z]+\\.[a-z]{2,3}(\\.[a-z]{2})?)$/i"; + //判断输入的是邮箱还是用户名 + if (preg_match($pattern, $data['name'])){ + //输入邮箱email登陆验证 + $data['email'] = $data['name']; + unset($data['name']); + try{ + validate(userValidate::class) + ->scene('loginEmail') + ->check($data); + } catch (ValidateException $e) { + // 验证失败 输出错误信息 + return json(['code'=>-1,'msg'=>$e->getError()]); + } + $data['name'] = $data['email']; + unset($data['email']); + } else { + //用户名name登陆验证 + try{ + validate(userValidate::class) + ->scene('loginName') + ->check($data); + } catch (ValidateException $e) { + // 验证失败 输出错误信息 + return json(['code'=>-1,'msg'=>$e->getError()]); + } + } + //登陆请求 + $user = new User(); + $res = $user->login($data); + if ($res == 1) { //登陆成功 + return Msgres::success('login_success',Cookie::get('url')); + } else { + return Msgres::error($res); + } + } + + return View::fetch('login'); + } + + //注册 + public function reg() + { + if(Request::isAjax()){ + $data = Request::only(['name','email','password','repassword','captcha']); + + //校验场景中reg的方法数据 + try{ + validate(userValidate::class) + ->scene('Reg') + ->check($data); + } catch (ValidateException $e) { + return json(['code'=>-1,'msg'=>$e->getError()]); + } + + $user = new User(); + $result = $user->reg($data); + + if ($result == 1) { + $res = ['code'=>0,'msg'=>'注册成功','url'=>(string) url('login/index')]; + if(Config::get('taoler.config.email_notice')) mailto($this->showUser(1)['email'],'注册新用户通知','Hi亲爱的管理员:
新用户 '.$data['name'].' 刚刚注册了新的账号,请尽快处理。'); + }else { + $res = ['code'=>-1,'msg'=>$result]; + } + return json($res); + } + return View::fetch(); + } + + //找回密码 + public function forget() + { + if(Request::isAjax()){ + $data = Request::param(); + + try{ + validate(userValidate::class) + ->scene('Forget') + ->check($data); + } catch (ValidateException $e) { + return json(['code'=>-1,'msg'=>$e->getError()]); + } + //查询用户 + $user = Db::name('user')->where('email',$data['email'])->find(); + if($user) { + $code = mt_rand('1111','9999'); + Cache::set('code',$code,600); + Cache::set('userid',$user['id'],600); + + $result = mailto($data['email'],'重置密码','Hi亲爱的'.$user['name'].':
您正在维护您的信息,请在10分钟内验证,您的验证码为:'.$code); + if($result){ + Cache::set('repass','postcode',60); //设置repass标志为1存入Cache + $res = ['code'=>0,'msg'=>'验证码已发送成功,请去邮箱查看!','url'=>(string) url('login/postcode')]; + } else { + $res = ['code'=>-1,'msg'=>'验证码发送失败!']; + } + }else{ + $res = ['code' =>-1,'msg'=>'邮箱错误或不存在']; + } + return json($res); + } + return View::fetch(); + } + + //接收验证码 + public function postcode() + { + if(Cache::get('repass') !== 'postcode'){ + return redirect((string) url('login/forget')); + } + if(Request::isAjax()){ + $code = Request::only(['code']); + try{ + validate(userValidate::class) + ->scene('Code') + ->check($code); + } catch (ValidateException $e) { + return json(['code'=>-1,'msg'=>$e->getError()]); + } + + if(Cache::get('code')==$code['code']) { //无任何输入情况下需排除code为0和Cache为0的情况 + //Cache::delete('repass'); + Cache::set('repass','resetpass',60); + $res = ['code'=>0,'msg'=>'验证成功','url'=>(string) url('login/respass')]; + } else { + $res = ['code'=>-1,'msg'=>'验证码错误或已过期!']; + } + return json($res); + } + return View::fetch('forget'); + } + + //忘记密码找回重置 + public function respass() + { + if(Cache::get('repass') !== 'resetpass'){ + return redirect((string) url('login/forget')); + } + if(Request::isAjax()){ + $data = Request::param(); + try{ + validate(userValidate::class) + ->scene('Repass') + ->check($data); + } catch (ValidateException $e) { + return json(['code'=>-1,'msg'=>$e->getError()]); + } + + $data['uid'] = Cache::get('userid'); + $user = new User(); + $res = $user->respass($data); + if ($res == 1) { + return json(['code'=>0,'msg'=>'修改成功','url'=>(string) url('login/index')]); + } else { + return json(['code'=>-1,'msg'=>'$res']); + } + } + return View::fetch('forget'); + } + +} \ No newline at end of file diff --git a/view/app/index/controller/User.php b/view/app/index/controller/User.php new file mode 100644 index 0000000..bfbafae --- /dev/null +++ b/view/app/index/controller/User.php @@ -0,0 +1,251 @@ + ['except' => ['home'] ], + ]; + + //用户中心 + public function index() + { + return view(); + } + + + //发帖list + public function artList() + { + $article = Article::withCount('comments')->where('user_id',$this->uid)->order('update_time','desc')->paginate(10); + //var_dump($article); + $count = $article->total(); + $res = []; + if($count){ + $res['code'] = 0; + $res['count'] = $count; + foreach($article as $v){ + $res['data'][] = ['id'=>$v['id'], + 'title' => $v['title'], + 'url' => (string) url('article/detail',['id'=>$v['id']]), + 'status' => $v['status'] ? '正常':'待审核', + 'ctime' => $v['create_time'], + 'datas' => $v['pv'].'阅/'.$v['comments_count'].'答' + ]; + } + + } else { + return json(['code'=>-1,'msg'=>'无数据']); + } + return json($res); + } + + //收藏list + public function collList(){ + //收藏的帖子 + $collect = Collection::with(['article'=>function($query){ + $query->withCount('comments')->where('status',1); + }])->where('user_id',$this->uid)->order('create_time','desc')->paginate(10); + $count =$collect->total(); + $res = []; + if($count){ + $res['code'] = 0; + $res['count'] = $count ; + foreach($collect as $v){ + + $res['data'][] = [ + 'id' =>$v['id'], + 'title' => $v['collect_title'], + 'url' => (string) url('article/detail',['id'=>$v['article_id']]), + 'auther' => $v['auther'], + 'status' => is_null(Db::name('article')->field('id')->where('delete_time',0)->find($v['article_id'])) ? '已失效' : '正常', + 'ctime' => $v['create_time'] + ]; + } + + } else { + return json(['code'=>-1,'msg'=>'无数据']); + } + return json($res); + } + + + + //文章管理 + public function post() + { + return View::fetch(); + } + + //取消文章收藏 + public function colltDel() + { + if(Request::isAjax()){ + $collt = Collection::where('user_id',$this->uid)->find(input('id')); + $result = $collt->delete(); + if($result){ + $res = ['code'=>0,'msg'=>'取消成功']; + } else { + $res = ['code'=>0,'msg'=>'取消失败']; + } + return json($res); + } + } + + //用户设置-我的资料 + public function set() + { + if(Request::isAjax()){ + $data = Request::only(['user_id','email','nickname','sex','city','area_id','sign']); + $validate = new userValidate; + $result = $validate->scene('Set')->check($data); + if(!$result){ + $this->error($validate->getError()); + } else { + $user = new userModel; + $result = $user->setNew($data); + if($result == 1){ + Cache::tag('user')->clear(); + return ['code'=>0,'msg'=>'资料更新成功']; + } else { + $this->error($result); + } + } + } + $area = Db::name('user_area')->select(); + View::assign(['area'=>$area]); + return View::fetch(); + } + + //更换头像 + public function uploadHeadImg() + { + $uploads = new \app\common\lib\Uploads(); + $upRes = $uploads->put('file','head_img',1024,'image','uniqid'); + $upHeadRes = $upRes->getData(); + if($upHeadRes['status'] == 0){ + $name_path = $upHeadRes['url']; + //$name = $file->hashName(); + //$image = \think\Image::open("uploads/$name_path"); + //$image->thumb(168, 168)->save("uploads/$name_path"); + + //查出当前用户头像删除原头像并更新 + $imgPath = Db::name('user')->where('id',$this->uid)->value('user_img'); + if(file_exists('.'.$imgPath)){ + $dirPath = dirname('.'.$imgPath); + if($dirPath !== './static/res/images/avatar'){ //防止删除默认头像 + unlink('.'.$imgPath); + } + } + $result = Db::name('user') + ->where('id',$this->uid) + ->update(['user_img'=>$name_path]); + Cache::tag(['user','tagArtDetail','tagArt'])->clear(); + if($result) { + $res = ['status'=>0,'msg'=>'头像更新成功']; + } else { + $res = ['status'=>1,'msg'=>'头像更新失败']; + } + } else { + $res = ['status'=>1,'msg'=>'上传错误']; + } + return json($res); + } + + + public function message() + { + $uid = Session::get('user_id'); + $msg = Message::receveMsg($uid); + + View::assign('msg',$msg); + return View::fetch(); + } + + //个人页 + public function home($id) + { + //用户 + $u = Cache::get('user'.$id); + if(!$u){ + $u = Db::name('user')->field('name,nickname,city,sex,sign,user_img,point,vip,create_time')->cache(3600)->find($id); + } + + + //用户发贴 + $arts = Db::name('user')->alias('u')->join('article a','u.id = a.user_id')->field('u.id,a.id,a.title,a.pv,a.is_hot,a.create_time,a.delete_time')->where('a.delete_time',0)->where('a.user_id',$id)->order(['a.create_time'=>'desc'])->cache(3600)->select(); + //用户回答 + $reys = Db::name('comment')->alias('c')->join('article a','c.article_id = a.id')->field('a.id,a.title,c.content,c.create_time,c.delete_time')->where(['a.delete_time'=>0,'c.delete_time'=>0])->where('c.user_id',$id)->order(['c.create_time'=>'desc'])->cache(3600)->select(); + + View::assign(['u'=>$u,'arts'=>$arts,'reys'=>$reys,'jspage'=>'']); + return View::fetch(); + } + + + public function layout() + { + return View::fetch(); + } + + + //邮箱激活 + public function activate() + { + $this->isLogin(); + $user = UserModel::find($this->uid); + $this->assign('user',$user); + return view(); + } + + //修改密码 + public function setPass() + { + if(Request::isAjax()){ + $data = Request::param(); + $validate = new userValidate; + $res = $validate->scene('setPass')->check($data); + if(!$res){ + return $this->error($validate->getError()); + } + $user = new userModel; + $result = $user->setpass($data); + if($result == 1) { + Session::clear(); + Cookie::delete('auth'); + return $this->success('密码修改成功 请登录', (string) url('login/index')); + } else { + return $this->error($result); + } + } + } + + //退出账户 + public function logout() + { + Session::clear(); + Cookie::delete('auth'); + //Cookie::delete('user_name'); + //Cookie::delete('user_id'); + if(Session::has('user_id')){ + return json(['code' => -1, 'msg' => '退出失败']); + } else { + return json(['code' => 200, 'msg' => '退出成功', 'url' => '/']); + } + } + +} \ No newline at end of file diff --git a/view/app/index/route/route.php b/view/app/index/route/route.php new file mode 100644 index 0000000..778f772 --- /dev/null +++ b/view/app/index/route/route.php @@ -0,0 +1,37 @@ + +// +---------------------------------------------------------------------- +use think\facade\Route; + +Route::get('captcha/[:config]','\\think\\captcha\\CaptchaController@index'); +Route::rule('/', 'index'); // 首页访问路由 +Route::group(function () { + Route::get('jie/:id', 'article/detail'); + Route::get('column///','article/cate') + ->pattern([ + 'ename' => '\w+', + 'page' => '\d+', + ]); + Route::rule('add','article/add')->token(); + Route::rule('edit/[:id]','article/edit'); + //Route::rule('del/:id','article/delete'); +}); +Route::group(function () { + Route::rule('u/:id', 'user/home'); +}); +Route::rule('login','login/index'); +Route::rule('forget','login/forget'); +Route::rule('postcode','login/postcode'); +Route::rule('respass','login/respass'); +Route::rule('reg','Login/reg') + ->middleware(\app\middleware\CheckRegister::class); + +Route::rule('search/[:keywords]', 'index/search'); // 搜索 + \ No newline at end of file diff --git a/view/config/taoler.php b/view/config/taoler.php new file mode 100644 index 0000000..c81b497 --- /dev/null +++ b/view/config/taoler.php @@ -0,0 +1,24 @@ + 'TaoLer', + //版本配置 + 'version' => '1.7.26', + //加盐 + 'salt' => 'taoler', + //数据库备份目录 + 'databasebackdir' => app()->getRootPath() .'data/', + //配置 + 'config' =>[ + 'email_notice' => 1, + 'cate_show' => 0, + 'area_show' => 0, + + ] + + +]; \ No newline at end of file diff --git a/view/public/static/layui/jquery.min.js b/view/public/static/layui/jquery.min.js new file mode 100644 index 0000000..c4c6022 --- /dev/null +++ b/view/public/static/layui/jquery.min.js @@ -0,0 +1,2 @@ +/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.0",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var _t,zt=[],Ut=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ut,"$1"+r):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,zt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((_t=E.implementation.createHTMLDocument("").body).innerHTML="
",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0{{d.title}}'} + ,{field: 'status', title: '状态', width: 80} + ,{field: 'ctime', title: '时间', width: 120} + ,{field: 'datas', title: '数据', width: 120} + ,{title: '操作', width: 150, align: 'center', toolbar: '#artTool'} + ]] + ,text: '对不起,加载出现异常!' + ,page: true + }); + + //收藏list + table.render({ + elem: '#coll-post' + ,url: collListUrl + ,title: '' + ,cols: [[ + {type: 'numbers', fixed: 'left'} + ,{field: 'title', title: '标题',minWidth: 250,templet: ''} + ,{field: 'auther', title: '作者', width: 120} + ,{field: 'status', title: '状态', width: 80} + ,{field: 'ctime', title: '时间', width: 120} + ,{title: '取消', width: 80, align: 'center', toolbar: '#collTool'} + ]] + ,text: '对不起,加载出现异常!' + ,page: true + }); + + //监听行工具事件 + table.on('tool(art-post)', function(obj){ + var data = obj.data; + var id = data.id; + if(obj.event === 'del'){ + layer.confirm('确定删除吗?',{ + title:'删除文章', + icon:3 + },function(index){ + layer.close(index); + $.post(atrDelUrl,{"id":id},function(data){ + if(data.code == 0){ + layer.msg(data.msg,{ + icon:6, + time:2000 + }); + } else { + layer.open({ + title:'删除失败', + content:data.msg, + icon:5, + adim:6 + }) + } + } + ); + table.reload('art-post'); + }); + + } else if(obj.event === 'edit'){//编辑 + $.post(artEditUrl,{"id":id},function(){ + location.href = artEditUrl + '?id=' + id; + }); + } + + }); + + //监听行工具事件 + table.on('tool(coll-post)', function(obj){ + var id = obj.data.id; + if(obj.event === 'del'){ + layer.confirm('确定取消收藏?',{ + title:'取消收藏', + icon:3 + },function(index){ + layer.close(index); + $.post(collDelUrl,{"id":id},function(data){ + if(data.code == 0){ + layer.msg(data.msg,{ + icon:6, + time:2000 + }); + } else { + layer.open({ + title:'取消失败', + content:data.msg, + icon:5, + adim:6 + }) + } + } + ); + table.reload('coll-post'); + }); + } + }); + + //显示当前tab + if(location.hash){ + element.tabChange('user', location.hash.replace(/^#/, '')); + } + + element.on('tab(user)', function(){ + var othis = $(this), layid = othis.attr('lay-id'); + if(layid){ + location.hash = layid; + } + }); +/* + //根据ip获取城市 + if($('#L_city').val() === ''){ + $.getScript('http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js', function(){ + $('#L_city').val(remote_ip_info.city||''); + }); + } +*/ + //上传图片 + if($('.upload-img')[0]){ + layui.use('upload', function(upload){ + var avatarAdd = $('.avatar-add'); + + upload.render({ + elem: '.upload-img' + ,accept: 'images' + ,acceptMime: 'image/*' + ,exts: 'jpg|png|gif|bmp|jpeg' + ,url: uploadHeadImg + ,size: 10240 + ,auto: false + ,choose: function (obj) { //选择文件后的回调 + imgcom.uploads(obj); + } + ,before: function(){ + avatarAdd.find('.loading').show(); + } + ,done: function(res){ + if(res.status == 0){ + location.reload(); + } else { + layer.msg(res.msg, {icon: 5}); + } + avatarAdd.find('.loading').hide(); + } + ,error: function(){ + avatarAdd.find('.loading').hide(); + } + }); + }); + } + + //合作平台 + if($('#LAY_coop')[0]){ + + //资源上传 + $('#LAY_coop .uploadRes').each(function(index, item){ + var othis = $(this); + upload.render({ + elem: item + ,url: '/api/upload/cooperation/?filename='+ othis.data('filename') + ,accept: 'file' + ,exts: 'zip' + ,size: 30*1024 + ,before: function(){ + layer.msg('正在上传', { + icon: 16 + ,time: -1 + ,shade: 0.7 + }); + } + ,done: function(res){ + if(res.code == 0){ + layer.msg(res.msg, {icon: 6}) + } else { + layer.msg(res.msg) + } + } + }); + }); + + //成效展示 + var effectTpl = ['{{# layui.each(d.data, function(index, item){ }}' + ,'' + ,'{{ item.uid }}' + ,'{{ item.authProduct }}' + ,'¥{{ item.rmb }}' + ,'{{ item.create_time }}' + ,'' + ,'{{# }); }}'].join(''); + + var effectView = function(res){ + var html = laytpl(effectTpl).render(res); + $('#LAY_coop_effect').html(html); + $('#LAY_effect_count').html('你共有 '+ (res.count||0) +' 笔合作授权订单'); + }; + + var effectShow = function(page){ + fly.json('/cooperation/effect', { + page: page||1 + }, function(res){ + effectView(res); + laypage.render({ + elem: 'LAY_effect_page' + ,count: res.count + ,curr: page + ,jump: function(e, first){ + if(!first){ + effectShow(e.curr); + } + } + }); + }); + }; + + effectShow(); + + } + + //提交成功后刷新 + fly.form['set-mine'] = function(data, required){ + layer.msg('修改成功', { + icon: 1 + ,time: 1000 + ,shade: 0.1 + }, function(){ + location.reload(); + }); + } + + //帐号绑定 + $('.acc-unbind').on('click', function(){ + var othis = $(this), type = othis.attr('type'); + layer.confirm('整的要解绑'+ ({ + qq_id: 'QQ' + ,weibo_id: '微博' + })[type] + '吗?', {icon: 5}, function(){ + fly.json('/api/unbind', { + type: type + }, function(res){ + if(res.status === 0){ + layer.alert('已成功解绑。', { + icon: 1 + ,end: function(){ + location.reload(); + } + }); + } else { + layer.msg(res.msg); + } + }); + }); + }); + + +//手机设备的简单适配 + var treeMobileUser = $('.site-tree-mobile-user') + ,shadeMobileUser = $('.site-mobile-shade-user') + + treeMobileUser.on('click', function(){ + $('body').addClass('site-mobile'); + }); + + shadeMobileUser.on('click', function(){ + $('body').removeClass('site-mobile'); + }); + +//我的消息 + gather.minemsg = function(){ + var delAll = $('#LAY_delallmsg') + ,tpl = '{{# var len = d.rows.length;\ + if(len === 0){ }}\ +
您暂时没有最新消息
\ + {{# } else { }}\ + \ + {{# } }}' + ,delEnd = function(clear){ + if(clear || dom.minemsg.find('.mine-msg li').length === 0){ + dom.minemsg.html('
您暂时没有最新消息
'); + } + } + + + fly.json(messageFind, {}, function(res){ + var html = laytpl(tpl).render(res); + dom.minemsg.html(html); + if(res.rows.length > 0){ + delAll.removeClass('layui-hide'); + } else { + delAll.addClass('layui-hide'); + } + }); + + + //阅读后删除 + dom.minemsg.on('click', '.mine-msg li .fly-delete', function(){ + var othis = $(this).parents('li'), id = othis.data('id'); + fly.json(messageRemove, { + id: id + }, function(res){ + if(res.status === 0){ + othis.remove(); + delEnd(); + } + }); + }); + + //删除全部 + $('#LAY_delallmsg').on('click', function(){ + var othis = $(this); + layer.confirm('确定清空吗?', function(index){ + fly.json(messageRemove, { + id: true + }, function(res){ + if(res.status === 0){ + layer.close(index); + othis.addClass('layui-hide'); + delEnd(true); + } + }); + }); + }); + + }; + + dom.minemsg[0] && gather.minemsg(); + + exports('user', null); + +}); \ No newline at end of file diff --git a/view/view/taoler/index/article/add.html b/view/view/taoler/index/article/add.html new file mode 100644 index 0000000..5f78a38 --- /dev/null +++ b/view/view/taoler/index/article/add.html @@ -0,0 +1,260 @@ +{extend name="public/base" /} + +{block name="title"}发表帖子{/block} +{block name="link"}{/block} +{block name="column"}{/block} +{block name="content"} +
{include file="public/menu" /}
+
+
+ +
+
+
    +
  • {:lang('add post')}
  • +
+
+
+ +
+
+ +
+ +
+
+
+ +
+ + + +
+
+ {if ($user.auth == 1)} +
+
+
+ {/if} +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+ +
+
+
+
+ +
+ +
+ +
+
+ +
+
+ +
+ +
+ +
+
+
+
+
+
+ + +
+ +
+ +
+
+ captcha +
+
+
+ + +
+ +
+
+
+
+
+
+{/block} + +{block name="script"} + + +{/block} \ No newline at end of file diff --git a/view/view/taoler/index/article/detail.html b/view/view/taoler/index/article/detail.html new file mode 100644 index 0000000..4cd03f1 --- /dev/null +++ b/view/view/taoler/index/article/detail.html @@ -0,0 +1,335 @@ +{extend name="public/base" /} + +{block name="title"}{$article.title}-{$sysInfo.webname}{/block} +{block name="keywords"}{$article.title},{$article.tags}{/block} +{block name="description"}{$article.title},{:getArtContent($article.content)}{/block} +{block name="link"}{/block} +{block name="column"}
{include file="/public/column" /}
{/block} +{block name="content"} +
+
+
+
+

{$article.title} +
+

+ + {$comments->count()} + {$pv} + + +
+ + {$article.user.name} + + + +
+
+ {if ($user.auth ?? '')} + + {if($article.is_top == 0)} + + {else /} + {:lang('cancel topping')} + {/if} + {if($article.is_hot == 0)} + + {else /} + {:lang('cancel hoting')} + {/if} + {if($article.is_reply == 1)} + + {else /} + {:lang('enable reply')} + {/if} + {:lang('title color')} + {/if} + {if(session('user_name')==$article.user.name || ($user.auth ?? ''))} + {:lang('edit')} + {/if} +
+
+ +
+ +
+ + +
+ + +
+
{$article.content|raw}
+ {notempty name="$article.upzip"} +
+ + +
+ {/notempty} +
+ +
+ 评论 {$comments->count()} + +
{$comments|raw}
+ {if condition="$article.is_reply == 1"} +
+
+ +
+ +
+
+
+ + + +
+
+ {else /} +
本帖已设置禁止回复
+ {/if} +
+
+
+
+
{:lang('sponsor')}- + {:lang('i want to join')} +
+
+ {volist name="ad_comm" id="vo"} + {$vo.slid_name} + {/volist} +
+
+
+
{:lang('hot post list')}
+ {volist name="artHot" id="vo"} +
+ {$vo.title} + {$vo.comments_count} +
+ {/volist} +
+
+ {volist name="ad_art" id="vo"} + + {/volist} +
+ +
+
+{include file="public/menu" /} + +
+
+
+ +
+{/block} +{block name="script"} + +{/block} \ No newline at end of file diff --git a/view/view/taoler/index/article/edit.html b/view/view/taoler/index/article/edit.html new file mode 100644 index 0000000..b287a7b --- /dev/null +++ b/view/view/taoler/index/article/edit.html @@ -0,0 +1,270 @@ +{extend name="public/base" /} + +{block name="title"}编辑帖子{/block} +{block name="link"}{/block} +{block name="column"}{/block} +{block name="content"} +
{include file="public/menu" /}
+
+
+ +
+
+
    +
  • {:lang('edit post')}
  • +
+
+
+ + +
+
+ +
+ +
+
+
+ +
+ + + +
+
+ {if ($user.auth == 1)} +
+
+
+
+ {/if} +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+ +
+
+
+
+ +
+ +
+
发表后无法更改飞吻
+
+
+
+
+ +
+ +
+ +
+
+ +
+
+ +
+ +
+ +
+
+
+
+ {volist name="tags" id="vo" } + + {/volist} +
+
+
+ +
+ +
+
+ captcha +
+
+
+ +
+ +
+
+
+
+
+
+{/block} + +{block name="script"} + +{/block} \ No newline at end of file diff --git a/view/view/taoler/index/login/forget.html b/view/view/taoler/index/login/forget.html new file mode 100644 index 0000000..2d366a3 --- /dev/null +++ b/view/view/taoler/index/login/forget.html @@ -0,0 +1,186 @@ +{extend name="public/base" /} + +{block name="title"}{:lang('retrieve password')}{/block} +{block name="column"}{/block} +{block name="content"} +
{include file="public/menu" /}
+
+
+
+
    +
  • {:lang('login')}
  • +
  • {if cache('repass')==2}{:lang('reset password')}{else /}{:lang('retrieve password')}{/if}
  • +
+
+
+ {//验证码} + {if cache('repass') == 'postcode'} +
+
+ +
+ +
+
+
+ + {:lang('go back')} +
+
+ {elseif cache('repass') == 'resetpass' /} + +
{:lang('reset password')}
+
+
+ +
+ +
+
{:lang('6-16 characters')}
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ captcha +
+
+
+
+
+ + +
+
+
该重置密码链接已失效,请重新校验您的信息
+
非法链接,请重新校验您的信息
+ {else /} + {//发邮件} +
+
+ +
+ +
+
+
+ +
+ +
+
+ +
captcha
+
+
+
+
+ +
+
+ {/if} +
+
+
+
+
+{/block} + +{block name="script"} + +{/block} diff --git a/view/view/taoler/index/login/reg.html b/view/view/taoler/index/login/reg.html new file mode 100644 index 0000000..29a43f3 --- /dev/null +++ b/view/view/taoler/index/login/reg.html @@ -0,0 +1,105 @@ +{extend name="public:base" /} + +{block name="title"}注册账号{/block} +{block name="column"}{/block} +{block name="content"} +
{include file="public/menu" /}
+
+
+
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
{:lang('the only way to get back your password')}
+
+
+ +
+ +
+
{:lang('strong type encryption')}
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ captcha +
+
+
+
+
+ +
+ +
+
+
+
+
+
+{/block} + +{block name="script"} + +{/block} diff --git a/view/view/taoler/index/public/user.html b/view/view/taoler/index/public/user.html new file mode 100644 index 0000000..87f4af2 --- /dev/null +++ b/view/view/taoler/index/public/user.html @@ -0,0 +1,53 @@ + + + + + 用户中心 + + + + + + + {block name="css"}{/block} + + +{include file="public/header" /} +
+{include file="public/user-nav" /} +
+ {block name="content"} + {/block} +
+
+{include file="public/footer" /} + +{block name="script"} + +{/block} + + \ No newline at end of file diff --git a/view/view/taoler/index/user/set.html b/view/view/taoler/index/user/set.html new file mode 100644 index 0000000..3a9ce21 --- /dev/null +++ b/view/view/taoler/index/user/set.html @@ -0,0 +1,171 @@ +{extend name="public/user" /} + +{block name="content"} +
+
    +
  • 我的资料
  • +
  • 头像
  • +
  • 密码
  • +
  • 帐号绑定
  • +
+
+
+
+ + +
+ +
+
如果您在邮箱已激活的情况下,变更了邮箱,需重新验证邮箱
+
+
+ +
+ +
+
+
+ + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ +
+
+
+

建议尺寸168*168,支持jpg、png、gif,最大不能超过50KB

+ + + +
+
+
+ +
+ +
+ +
+ +
+
+
+ +
+ +
+
6到16个字符
+
+
+ +
+ +
+
+
+ +
+
+ +
+
    +
  • + + 已成功绑定,您可以使用QQ帐号直接登录Fly社区,当然,您也可以 + 解除绑定 + + +
  • +
  • + + + + 立即绑定 + ,即可使用微博帐号登录Fly社区 +
  • +
+
+
+
+{/block} + +{block name="script"} + +{/block} \ No newline at end of file