修复后台关键字页面字乱码

This commit is contained in:
sugar1569 2019-04-02 17:52:05 +08:00
parent 654d1a322a
commit b28b18797a
2 changed files with 16 additions and 4 deletions

View File

@ -23,10 +23,22 @@ class Reply extends AuthController
{ {
if(empty(input('key'))) return $this->failed('请输入参数key'); if(empty(input('key'))) return $this->failed('请输入参数key');
if(empty(input('title'))) return $this->failed('请输入参数title'); if(empty(input('title'))) return $this->failed('请输入参数title');
$replay = WechatReply::getDataByKey(input('key')); $key = input('key');
switch($key){
case 'subscribe':
$title = '编辑关注回复';
break;
case 'default':
$title = '编辑关键字默认回复';
break;
default:
$title = '编辑关键字回复';
break;
}
$replay = WechatReply::getDataByKey($key);
$this->assign('replay_arr',json_encode($replay)); $this->assign('replay_arr',json_encode($replay));
$this->assign('key',input('key')); $this->assign('key',$key);
$this->assign('title',urldecode(input('title'))); $this->assign('title',$title);
return $this->fetch(); return $this->fetch();
} }

View File

@ -216,7 +216,7 @@
methods: { methods: {
submit: function(){ submit: function(){
if(!this.check()) return false; if(!this.check()) return false;
$eb.axios.post("{:Url('save',array('key'=>$key,'title'=>$title))}",{key:this.key,status:this.status,data:this.dataGroup[this.type],type:this.type}).then(function(res){ $eb.axios.post("{:Url('save',array('key'=>$key))}",{key:this.key,status:this.status,data:this.dataGroup[this.type],type:this.type}).then(function(res){
if(res.status == 200 && res.data.code == 200){ if(res.status == 200 && res.data.code == 200){
$eb.message('success','设置成功!'); $eb.message('success','设置成功!');
} }