作者 jinglong
1 个管道 的构建 通过 耗费 16 秒

增加隐私声明

... ... @@ -742,6 +742,18 @@ class PersonController extends RestBaseController
}
}
//获取隐私声明
public function getSecret(){
if($this->request->isGet()){
$res = $this->getAboutUs('secret');
$contentModel = new PortalPostModel();
$res['secret'] = $contentModel->getPostContentAttr($res['secret']);
$this->success('成功',$res);
}else{
$this->error('请求方式错误!');
}
}
//获取登录页使用说明
public function getManual(){
if($this->request->isGet()){
... ... @@ -763,7 +775,7 @@ class PersonController extends RestBaseController
}
/**
* @title 获取登录说明
* @title 获取登录说明/隐私声明
* @description 接口说明
* @author 开发者
* @url /api/admin/person/getLoginManual
... ... @@ -771,10 +783,12 @@ class PersonController extends RestBaseController
* @param name:is_token type:int require:1 default: other: desc:不用带token标识(传1)
*
* @return manual_url:登录页使用说明url
* @return secret_url:登录页隐私声明url
*/
public function getLoginManual(){
if($this->request->isGet()){
$res['manual_url'] = 'http://xiaofang.w.bronet.cn/manual.html';
$res['secret_url'] = 'http://xiaofang.w.bronet.cn/secret.html';
$this->success('成功',$res);
}else{
$this->error('请求方式错误!');
... ...
<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2019 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 小夏 < 449134904@qq.com>
// +----------------------------------------------------------------------
namespace app\admin\controller;
use cmf\controller\AdminBaseController;
use app\admin\model\AboutUsModel;
use think\Db;
use app\portal\model\PortalPostModel;
//隐私声明
class SysSecretController extends AdminBaseController
{
//编辑页面
public function edit(){
$res = Db::name('about_us')->where(['id'=>1])->field('id,secret')->find();
$contentModel = new PortalPostModel();
$res['secret'] = $contentModel->getPostContentAttr($res['secret']);
$this->assign('post', $res);
return $this->fetch();
}
//编辑保存页面
public function editPost(){
$data = $this->request->param();
$AboutUsModel = new AboutUsModel();
$contentModel = new PortalPostModel();
$data['secret'] = $contentModel->setPostContentAttr($data['secret']);
$AboutUsModel->allowField(true)->isUpdate(true)->save($data);
$this->success("保存成功!");
}
}
\ No newline at end of file
... ...
... ... @@ -93,9 +93,10 @@ return array (
'ADMIN_SLIDEITEM_LISTORDER' => '幻灯片页面排序',
'ADMIN_STORAGE_INDEX' => '文件存储',
'ADMIN_STORAGE_SETTINGPOST' => '文件存储设置提交',
'ADMIN_SYSEXPLAIN_EDIT' => '使用说明',
'ADMIN_SYSEXPLAIN_EDIT' => '用户协议',
'ADMIN_SYSINTRODUCE_EDIT' => '平台介绍',
'ADMIN_SYSMANUAL_EDIT' => '登录使用说明',
'ADMIN_SYSSECRET_EDIT' => '隐私声明',
'ADMIN_SYSSERVICE_EDIT' => '联系客服',
'ADMIN_SYSSTATEMENT_EDIT' => '登录声明',
'ADMIN_THEME_ACTIVE' => '启用模板',
... ...
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
</body>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script>
$(function(){
$.ajax({
type: 'GET',
url: "/api/admin/person/getSecret",
data: {
'is_token':1
},
dataType: 'json',
success: function(data) {
$('body').append(data.data.secret);
}
});
});
</script>
</html>
\ No newline at end of file
... ...
<include file="public@header"/>
<style type="text/css">
.pic-list li {
margin-bottom: 5px;
}
</style>
</head>
<body>
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li class="active"><a href="#">编辑隐私声明</a></li>
</ul>
<form action="{:url('SysSecret/editPost')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
<div class="row">
<div class="col-md-9">
<table class="table table-bordered">
<tr>
<th width="100">隐私声明<span class="form-required">*</span></th>
<td>
<input id="post-id" type="hidden" name="id" value="{$post.id}">
<script type="text/plain" id="content" name="secret">{$post.secret}</script>
</td>
</tr>
</table>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
</div>
</div>
</form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
//编辑器路径定义
var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
<script>
$(function(){
editorcontent = new baidu.editor.ui.Editor();
editorcontent.render('content');
try {
editorcontent.sync();
} catch (err) {
}
});
</script>
</body>
</html>
... ...