修复注册后跳转,新增语言包内容

This commit is contained in:
toogee 2020-11-04 12:24:54 +08:00
parent 506e359c1d
commit 1f6a76c85a
13 changed files with 50 additions and 39 deletions

View File

@ -43,10 +43,12 @@ try {
//$mail->AltBody =$user ;
return $mail->send();
echo 'Message has been sent';
$mail->send();
//echo 'Message has been sent';
return true;
} catch (Exception $e) {
echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo;
//echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo;
return false;
}
}

View File

@ -73,7 +73,7 @@ class Article extends BaseController
case 'jie':
$artList = ArticleModel::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot,jie,pv')->with([
'cate' => function($query){
$query->where('delete_time',0)->field('id,catename');
$query->where('delete_time',0)->field('id,catename,ename');
},
'user' => function($query){
$query->field('id,name,nickname,user_img,area_id,vip');
@ -89,7 +89,7 @@ class Article extends BaseController
case 'hot':
$artList = ArticleModel::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot,jie,pv')->with([
'cate' => function($query){
$query->where('delete_time',0)->field('id,catename');
$query->where('delete_time',0)->field('id,catename,ename');
},
'user' => function($query){
$query->field('id,name,nickname,user_img,area_id,vip');
@ -105,7 +105,7 @@ class Article extends BaseController
case 'top':
$artList = ArticleModel::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot,jie,pv')->with([
'cate' => function($query){
$query->where('delete_time',0)->field('id,catename');
$query->where('delete_time',0)->field('id,catename,ename');
},
'user' => function($query){
$query->field('id,name,nickname,user_img,area_id,vip');
@ -121,7 +121,7 @@ class Article extends BaseController
default:
$artList = ArticleModel::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot,jie,pv')->with([
'cate' => function($query){
$query->where('delete_time',0)->field('id,catename');
$query->where('delete_time',0)->field('id,catename,ename');
},
'user' => function($query){
$query->field('id,name,nickname,user_img,area_id,vip');
@ -153,11 +153,12 @@ class Article extends BaseController
public function detail($id)
{
$article = Cache::get('article_'.$id);
if(!$article){
//查询文章
$article = ArticleModel::field('id,title,content,status,cate_id,user_id,is_top,is_hot,is_reply,pv,jie,upzip,tags,title_color,create_time')->where('status',1)->with([
'cate' => function($query){
$query->where('delete_time',0)->field('id,catename');
$query->where('delete_time',0)->field('id,catename,ename');
},
'user' => function($query){
$query->field('id,name,nickname,user_img,area_id,vip');
@ -172,7 +173,7 @@ class Article extends BaseController
$comments = $article->comments()->where('status',1)->order(['cai'=>'asc','create_time'=>'asc'])->paginate(10);
$article->inc('pv')->update();
$pv = Db::name('article')->field('pv')->where('id',$id)->value('pv');
$download = download($article->upzip,'file');
$download = $article->upzip ? download($article->upzip,'file') : '';
/*
$nt = time();

View File

@ -30,7 +30,7 @@ class Index extends BaseController
if(!$artTop){
$artTop = Article::field('id,title,title_color,cate_id,user_id,create_time,is_top,jie,pv')->where(['is_top'=>1,'status'=>1,'delete_time'=>0])->with([
'cate' => function($query){
$query->where('delete_time',0)->field('id,catename');
$query->where('delete_time',0)->field('id,catename,ename');
},
'user' => function($query){
$query->field('id,name,nickname,user_img,area_id,vip');
@ -44,7 +44,7 @@ class Index extends BaseController
if(!$artList){
$artList = Article::field('id,title,title_color,cate_id,user_id,create_time,is_hot,jie,pv')->with([
'cate' => function($query){
$query->where('delete_time',0)->field('id,catename');
$query->where('delete_time',0)->field('id,catename,ename');
},
'user' => function($query){
$query->field('id,name,nickname,user_img,area_id,vip');

View File

@ -95,7 +95,7 @@ class Login extends BaseController
$result = $user->reg($data);
if ($result == 1) {
$res = ['code'=>0,'msg'=>'注册成功','url'=>'/index/login'];
$res = ['code'=>0,'msg'=>'注册成功','url'=>(string) url('login/index')];
}else {
$res = ['code'=>-1,'msg'=>$result];
}
@ -128,7 +128,7 @@ class Login extends BaseController
$result = mailto($data['email'],'重置密码','Hi亲爱的'.$user['name'].':</br>您正在维护您的信息请在10分钟内验证您的验证码为:'.$code);
if($result){
Cache::set('repass',1,60); //设置repass标志为1存入Cache
$res = ['code'=>0,'msg'=>'验证码已发送成功,请去邮箱查看!','url'=>'/index/postcode'];
$res = ['code'=>0,'msg'=>'验证码已发送成功,请去邮箱查看!','url'=>(string) url('login/postcode')];
} else {
$res = ['code'=>-1,'msg'=>'验证码发送失败!'];
}
@ -144,7 +144,7 @@ class Login extends BaseController
public function postcode()
{
if(Cache::get('repass') != 1){
return redirect('/index/forget');
return redirect((string) url('login/forget'));
}
if(Request::isAjax()){
$code = Request::only(['code']);
@ -159,7 +159,7 @@ class Login extends BaseController
if(Cache::get('code')==$code['code']) { //无任何输入情况下需排除code为0和Cache为0的情况
//Cache::delete('repass');
Cache::set('repass',2,60);
$res = ['code'=>0,'msg'=>'验证成功','url'=>'/index/respass'];
$res = ['code'=>0,'msg'=>'验证成功','url'=>(string) url('login/respass')];
} else {
$res = ['code'=>-1,'msg'=>'验证码错误或已过期!'];
}
@ -172,7 +172,7 @@ class Login extends BaseController
public function respass()
{
if(Cache::get('repass') != 2){
return redirect('/index/forget');
return redirect((string) url('login/forget'));
}
if(Request::isAjax()){
$data = Request::param();
@ -188,7 +188,7 @@ class Login extends BaseController
$user = new \app\common\model\User();
$res = $user->respass($data);
if ($res == 1) {
return json(['code'=>0,'msg'=>'修改成功','url'=>'/index/login']);
return json(['code'=>0,'msg'=>'修改成功','url'=>(string) url('login/index')]);
} else {
return json(['code'=>-1,'msg'=>'$res']);
}

View File

@ -8,7 +8,7 @@ return [
//menu
'index' => 'Index',
'home page' => 'Home page',
'home page' => 'Home',
'user center' => 'Center',
'set info' => 'Set info',
'my message' => 'Message',
@ -24,12 +24,15 @@ return [
'timeline' => 'Timeline',
//帖子
'poster' => 'poster',
'title color' => 'Title color',
'add_post' => 'Add post',
'collection' => 'collection',
'my collection' => 'My collection',
'cancel collection' => 'cancel collection',
'all' => 'All',
'finished' => 'Finished',
'end' => 'End',
'no finished' => 'no finished',
'hot' => 'Hot',
'top' => 'Top',
@ -43,7 +46,7 @@ return [
'links list' => 'Links list',
'statement' => 'Statement',
'trends' => 'Trends',
'sponsor' => 'Sponsor sponsor',
'sponsor' => 'Super sponsor',
'i want to join' => 'i want to join',
'official products' => 'Official products',
'no comments' => 'No comments',

View File

@ -24,12 +24,14 @@ return [
'timeline' => '框架日志',
//帖子
'poster' => '贴主',
'title color' => '颜色',
'add_post' => '添加帖子',
'my collection' => '我的收藏',
'cancel collection' => '取消收藏',
'all' => '综合',
'finished' => '已结',
'end' => '已结',
'no finished' => '未结',
'hot' => '热贴',
'top' => '精贴',

View File

@ -24,12 +24,14 @@ return [
'timeline' => '框架日誌',
//帖子
'poster' => '贴主',
'title color' => '顏色',
'add_post' => '添加帖子',
'my collection' => '我的收藏',
'cancel collection' => '取消收藏',
'all' => '綜合',
'finished' => '已結',
'end' => '已結',
'no finished' => '未結',
'hot' => '熱貼',
'top' => '精貼',

View File

@ -124,9 +124,9 @@ layui.define('fly', function(exports){
cid: div.data('id')
}, function(res){
if(type === 'add'){
othis.data('type', 'remove').html('取消收藏').addClass('layui-btn-danger');
othis.data('type', 'remove').html(langCancelCollection).addClass('layui-btn-danger');
} else if(type === 'remove'){
othis.data('type', 'add').html('收藏').removeClass('layui-btn-danger');
othis.data('type', 'add').html(langCollection).removeClass('layui-btn-danger');
}
});
}
@ -145,7 +145,7 @@ layui.define('fly', function(exports){
fly.json(collectionFind, {
cid: div.data('id')
}, function(res){
jieAdmin.append('<span class="layui-btn layui-btn-xs jie-admin '+ (res.data.collection ? 'layui-btn-danger' : '') +'" type="collect" data-type="'+ (res.data.collection ? 'remove' : 'add') +'">'+ (res.data.collection ? '取消收藏' : '收藏') +'</span>');
jieAdmin.append('<span class="layui-btn layui-btn-xs jie-admin '+ (res.data.collection ? 'layui-btn-danger' : '') +'" type="collect" data-type="'+ (res.data.collection ? 'remove' : 'add') +'">'+ (res.data.collection ? langCancelCollection : langCollection) +'</span>');
});
}
}();
@ -200,7 +200,6 @@ layui.define('fly', function(exports){
layer.prompt({
formType: 2
,value: data.content
,maxlength: 100000
,title: '编辑回帖'
,area: ['738px', '310px']

View File

@ -18,7 +18,7 @@
<img src="{$art.user.user_img}" alt="{$art.user.name}">
</a>
<h2>
<a class="layui-badge">{$art.cate.catename}</a>
<a class="layui-badge">{:cookie('think_lang') == 'en-us' ? $art.cate.ename : $art.cate.catename}</a>
<a href="{:url('article/detail',['id' => $art.id])}" style="color:{$art.title_color};">{$art.title}</a>
</h2>
<div class="fly-list-info">
@ -35,7 +35,7 @@
<span>{$art.create_time|date='Y-m-d'}</span>
<span class="layui-hide-xs" title="人气"><i class="iconfont" title="人气">&#xe60b;</i> {$art.pv}</span>
{if ($art.jie == 1)}<span class="layui-badge fly-badge-accept layui-hide-xs">{:lang('finished')}</span>{/if}
{if ($art.jie == 1)}<span class="layui-badge fly-badge-accept layui-hide-xs">{:lang('end')}</span>{/if}
<span class="fly-list-nums">
<i class="iconfont icon-pinglun1" title="回答"></i> {$art.comments_count}
</span>
@ -76,7 +76,7 @@
<div class="fly-panel">
<div class="fly-panel-title">
这里可作为广告区域
{:lang('ads area')}
</div>
<div class="fly-panel" style="padding: 20px 0; text-align: center;">
{volist name="ad_comm" id="vo"}

View File

@ -14,7 +14,7 @@
<div class="fly-detail-info">
<!-- <span class="layui-badge">审核中</span> -->
<span class="layui-badge layui-bg-green fly-detail-column">{$article.cate.catename}</span>
<span class="layui-badge layui-bg-green fly-detail-column">{:cookie('think_lang') == 'en-us' ? $article.cate.ename : $article.cate.catename}</span>
{if ($article.jie == 0)}
<span class="layui-badge" style="background-color: #999;">{:lang('no finished')}</span>
{else /}
@ -85,7 +85,7 @@
</fieldset>
<ul class="jieda" id="jieda">
{volist name="comments" id="vo" empty="lang('no comments')"}
{volist name="comments" id="vo" empty= ""}
<li data-id="{$vo.id}" class="jieda-daan">
<a name="item-1111111111"></a>
<div class="detail-about detail-about-reply">
@ -100,7 +100,7 @@
<i class="layui-badge fly-badge-vip">VIP3</i-->
</a>
{if condition="$article.user.id eq $vo.user.id"}
<span>(贴主)</span>
<span>({:lang('poster')})</span>
{/if}
<!--
<span style="color:#5FB878">(管理员)</span>
@ -220,7 +220,9 @@ var collectionFind = "{:url('index/Collection/find')}",
commentJiedaCai = "{:url('index/Comment/jiedaCai')}",
commentGetDa = "{:url('index/Comment/getDa')}",
commentUpdateDa = "{:url('index/Comment/updateDa')}",
commentJiedaDelete = "{:url('index/Comment/jiedaDelete')}";
commentJiedaDelete = "{:url('index/Comment/jiedaDelete')}",
langCollection = "{:lang('collection')}",
langCancelCollection = "{:lang('cancel collection')}";
layui.cache.page = 'jie';
layui.cache.user = {
username: '{$user.name??'游客'}'

View File

@ -1,7 +1,7 @@
<div class="fly-panel-title fly-filter">
<a href="{:url('article/cate',['ename' => $Request.param.ename ?:'all' ,'type' => ''])} " {if condition="$type eq ''" } class="layui-this" {/if} >{:lang('all')}</a>
<span class="fly-mid"></span>
<a href="{:url('article/cate',['ename' => $Request.param.ename ?:'all','type' => 'jie'])} " {if condition="$type eq 'jie'" } class="layui-this" {/if} >{:lang('finished')}</a>
<a href="{:url('article/cate',['ename' => $Request.param.ename ?:'all','type' => 'jie'])} " {if condition="$type eq 'jie'" } class="layui-this" {/if} >{:lang('end')}</a>
<span class="fly-mid"></span>
<a href="{:url('article/cate',['ename' => $Request.param.ename ?:'all','type' => 'top'])} " {if condition="$type eq 'top'" } class="layui-this" {/if} >{:lang('top')}</a>
<span class="fly-mid"></span>

View File

@ -3,7 +3,7 @@
<img src="{$art.user.user_img}" alt="{$art.user.name}">
</a>
<h2>
<a class="layui-badge">{$art.cate.catename}</a>
<a class="layui-badge">{:cookie('think_lang') == 'en-us' ? $art.cate.ename : $art.cate.catename}</a>
<a href="{:url('article/detail',['id' => $art.id])}" style="color:{$art.title_color};">{$art.title}</a>
</h2>
<div class="fly-list-info">
@ -20,14 +20,14 @@
<span>{$art.create_time|date='Y-m-d'}</span>
<span class="layui-hide-xs" title="人气"><i class="iconfont" title="人气">&#xe60b;</i> {$art.pv}</span>
{if ($art.jie == 1)}<span class="layui-badge fly-badge-accept layui-hide-xs">已结</span>{/if}
{if ($art.jie == 1)}<span class="layui-badge fly-badge-accept layui-hide-xs">{:lang('end')}</span>{/if}
<span class="fly-list-nums">
<i class="iconfont icon-pinglun1" title="回答"></i>{$art.comments_count}
</span>
</div>
<div class="fly-list-badge">
{if ($art.is_top == 1)} <span class="layui-badge layui-bg-black" >置顶</span> {/if}
{if ($art.is_hot == 1)} <span class="layui-badge layui-bg-red">精帖</span> {/if}
{if ($art.is_top == 1)} <span class="layui-badge layui-bg-black" >{:lang('top')}</span> {/if}
{if ($art.is_hot == 1)} <span class="layui-badge layui-bg-red">{:lang('hot')}</span> {/if}
</div>
</li>

View File

@ -3,7 +3,7 @@
<img src="{$top.user.user_img}" alt="{$top.user.name}">
</a>
<h2>
<a class="layui-badge">{$top.cate.catename}</a>
<a class="layui-badge">{:cookie('think_lang') == 'en-us' ? $top.cate.ename : $top.cate.catename}</a>
<a href="{:url('article/detail',['id' => $top.id])}" style="color:{$top.title_color};">{$top.title}</a>
</h2>
<div class="fly-list-info">
@ -18,13 +18,13 @@
<span>{$top.create_time|date='Y-m-d'}</span>
<span class=" layui-hide-xs" title="人气"><i class="iconfont" title="人气">&#xe60b;</i> {$top.pv}</span>
{if ($top.jie == 1)}<span class="layui-badge fly-badge-accept layui-hide-xs">已结</span>{/if}
{if ($top.jie == 1)}<span class="layui-badge fly-badge-accept layui-hide-xs">{:lang('end')}</span>{/if}
<span class="fly-list-nums">
<i class="iconfont icon-pinglun1" title="回答"></i> {$top.comments_count}
</span>
</div>
<div class="fly-list-badge">
{if ($top.is_top == 1)} <span class="layui-badge layui-bg-black" >置顶</span> {/if}
{if ($top.is_hot == 1)} <span class="layui-badge layui-bg-red">精帖</span> {/if}
{if ($top.is_top == 1)} <span class="layui-badge layui-bg-black" >{:lang('top')}</span> {/if}
{if ($top.is_hot == 1)} <span class="layui-badge layui-bg-red">{:lang('hot')}</span> {/if}
</div>
</li>