feat: 项目基础框架+配置+Kernel
This commit is contained in:
@@ -0,0 +1 @@
|
||||
deny from all
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
namespace app\captcha\controller;
|
||||
use think\Session;
|
||||
use \think\Request;
|
||||
class Captcha
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$captcha = new \think\captcha\Captcha();
|
||||
$img=$captcha->entry();
|
||||
return $img;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: yunwuxin <448901948@qq.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
return [''];
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,243 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: liu21st <liu21st@gmail.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
return [
|
||||
// +----------------------------------------------------------------------
|
||||
// | 应用设置
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
// 应用调试模式
|
||||
'app_debug' => true,
|
||||
// 应用Trace
|
||||
'app_trace' => false,
|
||||
// 应用模式状态
|
||||
'app_status' => '',
|
||||
// 是否支持多模块
|
||||
'app_multi_module' => true,
|
||||
// 入口自动绑定模块
|
||||
'auto_bind_module' => false,
|
||||
// 注册的根命名空间
|
||||
'root_namespace' => [],
|
||||
// 扩展函数文件
|
||||
'extra_file_list' => [THINK_PATH . 'helper' . EXT],
|
||||
// 默认输出类型
|
||||
'default_return_type' => 'html',
|
||||
// 默认AJAX 数据返回格式,可选json xml ...
|
||||
'default_ajax_return' => 'json',
|
||||
// 默认JSONP格式返回的处理方法
|
||||
'default_jsonp_handler' => 'jsonpReturn',
|
||||
// 默认JSONP处理方法
|
||||
'var_jsonp_handler' => 'callback',
|
||||
// 默认时区
|
||||
'default_timezone' => 'PRC',
|
||||
// 是否开启多语言
|
||||
'lang_switch_on' => false,
|
||||
// 默认全局过滤方法 用逗号分隔多个
|
||||
'default_filter' => '',
|
||||
// 默认语言
|
||||
'default_lang' => 'zh-cn',
|
||||
// 应用类库后缀
|
||||
'class_suffix' => false,
|
||||
// 控制器类后缀
|
||||
'controller_suffix' => false,
|
||||
|
||||
// +----------------------------------------------------------------------
|
||||
// | 模块设置
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
// 默认模块名
|
||||
'default_module' => 'index',
|
||||
// 禁止访问模块
|
||||
'deny_module_list' => ['common'],
|
||||
// 默认控制器名
|
||||
'default_controller' => 'Index',
|
||||
// 默认操作名
|
||||
'default_action' => 'index',
|
||||
// 默认验证器
|
||||
'default_validate' => '',
|
||||
// 默认的空控制器名
|
||||
'empty_controller' => 'Error',
|
||||
// 操作方法后缀
|
||||
'action_suffix' => '',
|
||||
// 自动搜索控制器
|
||||
'controller_auto_search' => true,
|
||||
|
||||
// +----------------------------------------------------------------------
|
||||
// | URL设置
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
// PATHINFO变量名 用于兼容模式
|
||||
'var_pathinfo' => 's',
|
||||
// 兼容PATH_INFO获取
|
||||
'pathinfo_fetch' => ['ORIG_PATH_INFO', 'REDIRECT_PATH_INFO', 'REDIRECT_URL'],
|
||||
// pathinfo分隔符
|
||||
'pathinfo_depr' => '/',
|
||||
// URL伪静态后缀
|
||||
'url_html_suffix' => 'html',
|
||||
// URL普通方式参数 用于自动生成
|
||||
'url_common_param' => false,
|
||||
// URL参数方式 0 按名称成对解析 1 按顺序解析
|
||||
'url_param_type' => 0,
|
||||
// 是否开启路由
|
||||
'url_route_on' => false,
|
||||
// 路由使用完整匹配
|
||||
'route_complete_match' => false,
|
||||
// 路由配置文件(支持配置多个)
|
||||
'route_config_file' => ['route'],
|
||||
// 是否开启路由解析缓存
|
||||
'route_check_cache' => false,
|
||||
// 是否强制使用路由
|
||||
'url_route_must' => false,
|
||||
// 域名部署
|
||||
'url_domain_deploy' => false,
|
||||
// 域名根,如thinkphp.cn
|
||||
'url_domain_root' => '',
|
||||
// 是否自动转换URL中的控制器和操作名
|
||||
'url_convert' => true,
|
||||
// 默认的访问控制器层
|
||||
'url_controller_layer' => 'controller',
|
||||
// 表单请求类型伪装变量
|
||||
'var_method' => '_method',
|
||||
// 表单ajax伪装变量
|
||||
'var_ajax' => '_ajax',
|
||||
// 表单pjax伪装变量
|
||||
'var_pjax' => '_pjax',
|
||||
// 是否开启请求缓存 true自动缓存 支持设置请求缓存规则
|
||||
'request_cache' => false,
|
||||
// 请求缓存有效期
|
||||
'request_cache_expire' => null,
|
||||
// 全局请求缓存排除规则
|
||||
'request_cache_except' => [],
|
||||
|
||||
// +----------------------------------------------------------------------
|
||||
// | 模板设置
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
'template' => [
|
||||
// 模板引擎类型 支持 php think 支持扩展
|
||||
'type' => 'Think',
|
||||
// 默认模板渲染规则 1 解析为小写+下划线 2 全部转换小写
|
||||
'auto_rule' => 1,
|
||||
// 模板路径
|
||||
'view_path' => '../application/tpl/',
|
||||
// 模板后缀
|
||||
'view_suffix' => 'html',
|
||||
// 模板文件名分隔符
|
||||
'view_depr' => DS,
|
||||
// 模板引擎普通标签开始标记
|
||||
'tpl_begin' => '{',
|
||||
// 模板引擎普通标签结束标记
|
||||
'tpl_end' => '}',
|
||||
// 标签库标签开始标记
|
||||
'taglib_begin' => '{',
|
||||
// 标签库标签结束标记
|
||||
'taglib_end' => '}',
|
||||
],
|
||||
|
||||
// 视图输出字符串内容替换
|
||||
'view_replace_str' => [],
|
||||
// 默认跳转页面对应的模板文件
|
||||
'dispatch_success_tmpl' => THINK_PATH . 'tpl' . DS . 'dispatch_jump.tpl',
|
||||
'dispatch_error_tmpl' => THINK_PATH . 'tpl' . DS . 'dispatch_jump.tpl',
|
||||
|
||||
// +----------------------------------------------------------------------
|
||||
// | 异常及错误设置
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
// 异常页面的模板文件
|
||||
'exception_tmpl' => THINK_PATH . 'tpl' . DS . 'think_exception.tpl',
|
||||
|
||||
// 错误显示信息,非调试模式有效
|
||||
'error_message' => '页面错误!',
|
||||
// 显示错误信息
|
||||
'show_error_msg' => false,
|
||||
// 异常处理handle类 留空使用 \think\exception\Handle
|
||||
'exception_handle' => '',
|
||||
|
||||
// +----------------------------------------------------------------------
|
||||
// | 日志设置
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
'log' => [
|
||||
// 日志记录方式,内置 file socket 支持扩展
|
||||
'type' => 'File',
|
||||
// 日志保存目录
|
||||
'path' => LOG_PATH,
|
||||
// 日志记录级别
|
||||
'level' => [],
|
||||
],
|
||||
|
||||
// +----------------------------------------------------------------------
|
||||
// | Trace设置 开启 app_trace 后 有效
|
||||
// +----------------------------------------------------------------------
|
||||
'trace' => [
|
||||
// 内置Html Console 支持扩展
|
||||
'type' => 'Html',
|
||||
],
|
||||
|
||||
// +----------------------------------------------------------------------
|
||||
// | 缓存设置
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
'cache' => [
|
||||
// 驱动方式
|
||||
'type' => 'File',
|
||||
// 缓存保存目录
|
||||
'path' => CACHE_PATH,
|
||||
// 缓存前缀
|
||||
'prefix' => '',
|
||||
// 缓存有效期 0表示永久缓存
|
||||
'expire' => 0,
|
||||
],
|
||||
|
||||
// +----------------------------------------------------------------------
|
||||
// | 会话设置
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
'session' => [
|
||||
'id' => '',
|
||||
// SESSION_ID的提交变量,解决flash上传跨域
|
||||
'var_session_id' => '',
|
||||
// SESSION 前缀
|
||||
'prefix' => 'think',
|
||||
// 驱动方式 支持redis memcache memcached
|
||||
'type' => '',
|
||||
// 是否自动开启 SESSION
|
||||
'auto_start' => true,
|
||||
],
|
||||
|
||||
// +----------------------------------------------------------------------
|
||||
// | Cookie设置
|
||||
// +----------------------------------------------------------------------
|
||||
'cookie' => [
|
||||
// cookie 名称前缀
|
||||
'prefix' => '',
|
||||
// cookie 保存时间
|
||||
'expire' => 0,
|
||||
// cookie 保存路径
|
||||
'path' => '/',
|
||||
// cookie 有效域名
|
||||
'domain' => '',
|
||||
// cookie 启用安全传输
|
||||
'secure' => false,
|
||||
// httponly设置
|
||||
'httponly' => '',
|
||||
// 是否使用 setcookie
|
||||
'setcookie' => true,
|
||||
],
|
||||
|
||||
//分页配置
|
||||
'paginate' => [
|
||||
'type' => 'bootstrap',
|
||||
'var_page' => 'page',
|
||||
'list_rows' => 15,
|
||||
],
|
||||
];
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: liu21st <liu21st@gmail.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
return [
|
||||
// 数据库类型
|
||||
'type' => 'mysql',
|
||||
// 服务器地址
|
||||
'hostname' => '127.0.0.1',
|
||||
// 数据库名
|
||||
'database' => 'admin_usdtserver',
|
||||
// 用户名
|
||||
'username' => 'admin_usdtserver',
|
||||
// 密码
|
||||
'password' => 'cnFmKK7SzmkCiKET',
|
||||
// 端口
|
||||
'hostport' => '',
|
||||
// 连接dsn
|
||||
'dsn' => '',
|
||||
// 数据库连接参数
|
||||
'params' => [],
|
||||
// 数据库编码默认采用utf8
|
||||
'charset' => 'utf8',
|
||||
// 数据库表前缀
|
||||
'prefix' => '',
|
||||
// 数据库调试模式
|
||||
'debug' => true,
|
||||
// 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
|
||||
'deploy' => 0,
|
||||
// 数据库读写是否分离 主从式有效
|
||||
'rw_separate' => false,
|
||||
// 读写分离后 主服务器数量
|
||||
'master_num' => 1,
|
||||
// 指定从服务器序号
|
||||
'slave_no' => '',
|
||||
// 自动读取主库数据
|
||||
'read_master' => false,
|
||||
// 是否严格检查字段是否存在
|
||||
'fields_strict' => true,
|
||||
// 数据集返回类型
|
||||
'resultset_type' => 'array',
|
||||
// 自动写入时间戳字段
|
||||
'auto_timestamp' => false,
|
||||
// 时间字段取出后的默认时间格式
|
||||
'datetime_format' => 'Y-m-d H:i:s',
|
||||
// 是否需要进行SQL性能分析
|
||||
'sql_explain' => false,
|
||||
];
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: yunwuxin <448901948@qq.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
return [
|
||||
'connector' => 'Sync'
|
||||
];
|
||||
@@ -0,0 +1,293 @@
|
||||
<?php
|
||||
//html-WEB标签处理
|
||||
//统计字符长度
|
||||
function getStrlen($str,$code = 'UTF-8'){
|
||||
$strlen=0;
|
||||
if($code == 'UTF-8'){
|
||||
$pa = "/[\x01-\x7f]|[\xc2-\xdf][\x80-\xbf]|\xe0[\xa0-\xbf][\x80-\xbf]|[\xe1-\xef][\x80-\xbf][\x80-\xbf]|\xf0[\x90-\xbf][\x80-\xbf][\x80-\xbf]|[\xf1-\xf7][\x80-\xbf][\x80-\xbf][\x80-\xbf]/";
|
||||
preg_match_all($pa, $str, $t_string);
|
||||
$strlen=count($t_string[0]);
|
||||
}else{
|
||||
$strlen = strlen($str);
|
||||
}
|
||||
return $strlen;
|
||||
}
|
||||
//获取中英文字符的长度
|
||||
function getStrlen2($str){
|
||||
if ($str){
|
||||
return mb_strlen($str,'utf8');
|
||||
}else{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
//截字,不够数时末尾加省略号
|
||||
function cut_str($string, $sublen,$after='', $start = 0, $code = 'UTF-8')
|
||||
{
|
||||
if($code == 'UTF-8')
|
||||
{
|
||||
$pa = "/[\x01-\x7f]|[\xc2-\xdf][\x80-\xbf]|\xe0[\xa0-\xbf][\x80-\xbf]|[\xe1-\xef][\x80-\xbf][\x80-\xbf]|\xf0[\x90-\xbf][\x80-\xbf][\x80-\xbf]|[\xf1-\xf7][\x80-\xbf][\x80-\xbf][\x80-\xbf]/";
|
||||
preg_match_all($pa, $string, $t_string);
|
||||
if(count($t_string[0]) - $start > $sublen) return join('', array_slice($t_string[0], $start, $sublen)).$after;
|
||||
return join('', array_slice($t_string[0], $start, $sublen));
|
||||
}
|
||||
else
|
||||
{
|
||||
$start = $start*2;
|
||||
$sublen = $sublen*2;
|
||||
$strlen = strlen($string);
|
||||
$tmpstr = '';
|
||||
for($i=0; $i<$strlen; $i++)
|
||||
{
|
||||
if($i>=$start && $i<($start+$sublen))
|
||||
{
|
||||
if(ord(substr($string, $i, 1))>129)
|
||||
{
|
||||
$tmpstr.= substr($string, $i, 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
$tmpstr.= substr($string, $i, 1);
|
||||
}
|
||||
}
|
||||
if(ord(substr($string, $i, 1))>129) $i++;
|
||||
}
|
||||
if(strlen($tmpstr)<$strlen ) $tmpstr.= $after;
|
||||
return $tmpstr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//HTML转txt
|
||||
function html2txt($html){
|
||||
$html=strip_tags($html);
|
||||
$html=str_replace(" ",'',$html);
|
||||
$html=str_replace(" ",'',$html);
|
||||
$html=str_replace(" ",'',$html);
|
||||
$html=str_replace(chr(13),'',$html);
|
||||
$html=str_replace(array("\r\n","\n","\r"),'',$html);
|
||||
return $html;
|
||||
}
|
||||
//去掉HTML样式style
|
||||
function removeA_Style($html){
|
||||
$html=str_replace(" ",'',$html);
|
||||
$html=str_replace(" ",'',$html);
|
||||
$html=str_replace(" ",'',$html);
|
||||
$html=preg_replace("/style=.+?['|\"]/i",'',$html);
|
||||
$html=preg_replace("/<a[^>]*>(.*?)<\/a>/is", "$1",$html);
|
||||
return $html;
|
||||
}
|
||||
|
||||
|
||||
//url base64编码
|
||||
function urlsafe_b64encode($string) {
|
||||
$data = base64_encode($string);
|
||||
$data = str_replace(array('+','/','='),array('-','_',''),$data);
|
||||
return $data;
|
||||
}
|
||||
//url base64解码
|
||||
function urlsafe_b64decode($string) {
|
||||
$data = str_replace(array('-','_'),array('+','/'),$string);
|
||||
$mod4 = strlen($data) % 4;
|
||||
if ($mod4) {
|
||||
$data .= substr('====', $mod4);
|
||||
}
|
||||
return base64_decode($data);
|
||||
}
|
||||
|
||||
function CutAbnormalHtml($str){//去掉yi2,zhu2,shang2的非法格式
|
||||
$str=str_replace(array("\r\n", "\r", "\n",chr(13),"↵"),'',$str);
|
||||
$str=str_replace(array("</div>", "</div >"),'<br>',$str);
|
||||
$str=str_replace(array("<span>", "<span >","<div>", "<div >","</span>", "</span >"),'',$str);
|
||||
$str=str_replace(array("<span", "<spa", "<sp", "<s", "<div", "<di", "<d"),'',$str);
|
||||
$str=str_replace(array("</div", "</span"),'',$str);
|
||||
$str=str_replace(array("</di", "</spa"),'',$str);
|
||||
$str=str_replace(array("</d", "</sp"),'',$str);
|
||||
$str=str_replace(array("</", "</s"),'',$str);
|
||||
//$str=strip_tags($str);
|
||||
return $str;
|
||||
}
|
||||
|
||||
//闭合HTML标签
|
||||
function fix_html_tags($input, $single_tags = array()) {
|
||||
$result = null;
|
||||
$stack = array();//标签栈
|
||||
$_single_tags = array('br', 'hr', 'img', 'input');//合理的单标签
|
||||
|
||||
if ($single_tags && is_array($single_tags)) {
|
||||
$_single_tags = array_merge($_single_tags, $single_tags);
|
||||
$_single_tags = array_map('strtolower', $_single_tags);
|
||||
$_single_tags = array_unique($_single_tags);
|
||||
}
|
||||
//返回标签分隔之后的内容,包括标签本身
|
||||
$content = preg_split('/(<[^>]+>)/si', $input, null, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
|
||||
|
||||
foreach ($content as $val) {
|
||||
//匹配未闭合的自闭合标签 如 <br> <hr> 等
|
||||
if (preg_match('/<(\w+)[^\/]*>/si', $val, $m) && in_array(strtolower($m[1]), $_single_tags) ) {
|
||||
$result .= "\r\n" . $val;
|
||||
}
|
||||
//匹配标准书写的自闭合标签,直接返回,不入栈
|
||||
else if (preg_match('/<(\w+)[^\/]*\/>/si', $val, $m)) {
|
||||
$result .= $val;
|
||||
}
|
||||
//匹配开始标签,并入栈
|
||||
else if (preg_match('/<(\w+)[^\/]*>/si', $val, $m)) {
|
||||
$result .= "\r\n" . str_repeat("\t", count($stack)) . $val;
|
||||
array_push($stack, $m[1]);
|
||||
}
|
||||
//匹配闭合标签,匹配前先判断当前闭合标签是栈顶标签的闭合,优先闭合栈顶标签
|
||||
else if (preg_match('/<\/(\w+)[^\/]*>/si', $val, $m)) {
|
||||
//出栈,多余的闭合标签直接舍弃
|
||||
if (strtolower(end($stack)) == strtolower($m[1])) {
|
||||
array_pop($stack);
|
||||
$result .= $val;
|
||||
}
|
||||
} else {
|
||||
$result .= $val;
|
||||
}
|
||||
}
|
||||
|
||||
//倒出所有栈内元素
|
||||
while ($stack) {
|
||||
$result .= "</".array_pop($stack).">";
|
||||
$result .= "\r\n";
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//生成拼音
|
||||
function str2pinyin($str){
|
||||
require_once('pinyin/ChinesePinyin.class.php');
|
||||
$Pinyin=new ChinesePinyin();
|
||||
$strPinyin = $Pinyin->TransformWithTone($str);
|
||||
return $strPinyin;
|
||||
}
|
||||
function get_pinyinto($str){
|
||||
//拼音分行 start
|
||||
$str=str_replace(array("<p>","<P>"),'',$str);
|
||||
$str=str_replace(array("<br />","<br>","</p>","/P"),chr(13),$str);
|
||||
$pyarr=explode(chr(13),$str);
|
||||
//print_r($pyarr);
|
||||
$pybody="";
|
||||
//调用拼音程序
|
||||
//str2pinyin()
|
||||
require_once 'pinyin/ChinesePinyin.class.php';
|
||||
//require_once (dirname(__FILE__) . "/ChinesePinyin.class.php");
|
||||
$Pinyin=new ChinesePinyin();
|
||||
|
||||
foreach($pyarr as $k=> $v){
|
||||
$pys = $Pinyin->TransformWithTone($v);
|
||||
$pybody.='<div class="pyshowbox00999"><span class="py">'.$pys.'</span>';
|
||||
$pybody.='<b>'.$v.'</b></div>';
|
||||
}
|
||||
return $pybody;
|
||||
}
|
||||
|
||||
//取汉字首字母
|
||||
function getFirstCharter($str)
|
||||
{
|
||||
if (empty($str)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$fchar = ord($str{0});
|
||||
|
||||
if ($fchar >= ord('A') && $fchar <= ord('z'))
|
||||
return strtoupper($str{0});
|
||||
|
||||
$s1 = iconv('UTF-8', 'gb2312', $str);
|
||||
|
||||
$s2 = iconv('gb2312', 'UTF-8', $s1);
|
||||
|
||||
$s = $s2 == $str ? $s1 : $str;
|
||||
|
||||
$asc = ord($s{0}) * 256 + ord($s{1}) - 65536;
|
||||
|
||||
if ($asc >= -20319 && $asc <= -20284)
|
||||
return 'A';
|
||||
|
||||
if ($asc >= -20283 && $asc <= -19776)
|
||||
return 'B';
|
||||
|
||||
if ($asc >= -19775 && $asc <= -19219)
|
||||
return 'C';
|
||||
|
||||
if ($asc >= -19218 && $asc <= -18711)
|
||||
return 'D';
|
||||
|
||||
if ($asc >= -18710 && $asc <= -18527)
|
||||
return 'E';
|
||||
|
||||
if ($asc >= -18526 && $asc <= -18240)
|
||||
return 'F';
|
||||
|
||||
if ($asc >= -18239 && $asc <= -17923)
|
||||
return 'G';
|
||||
|
||||
if ($asc >= -17922 && $asc <= -17418)
|
||||
return 'H';
|
||||
|
||||
if ($asc >= -17417 && $asc <= -16475)
|
||||
return 'J';
|
||||
|
||||
if ($asc >= -16474 && $asc <= -16213)
|
||||
return 'K';
|
||||
|
||||
if ($asc >= -16212 && $asc <= -15641)
|
||||
return 'L';
|
||||
|
||||
if ($asc >= -15640 && $asc <= -15166)
|
||||
return 'M';
|
||||
|
||||
if ($asc >= -15165 && $asc <= -14923)
|
||||
return 'N';
|
||||
|
||||
if ($asc >= -14922 && $asc <= -14915)
|
||||
return 'O';
|
||||
|
||||
if ($asc >= -14914 && $asc <= -14631)
|
||||
return 'P';
|
||||
|
||||
if ($asc >= -14630 && $asc <= -14150)
|
||||
return 'Q';
|
||||
|
||||
if ($asc >= -14149 && $asc <= -14091)
|
||||
return 'R';
|
||||
|
||||
if ($asc >= -14090 && $asc <= -13319)
|
||||
return 'S';
|
||||
|
||||
if ($asc >= -13318 && $asc <= -12839)
|
||||
return 'T';
|
||||
|
||||
if ($asc >= -12838 && $asc <= -12557)
|
||||
return 'W';
|
||||
|
||||
if ($asc >= -12556 && $asc <= -11848)
|
||||
return 'X';
|
||||
|
||||
if ($asc >= -11847 && $asc <= -11056)
|
||||
return 'Y';
|
||||
|
||||
if ($asc >= -11055 && $asc <= -10247)
|
||||
return 'Z';
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* 汉字转拼音类
|
||||
* @Author : Kin
|
||||
* @Date : 2014-03-16
|
||||
* @Email : Mr.kin@foxmail.com
|
||||
*
|
||||
*/
|
||||
|
||||
class ChinesePinyin{
|
||||
|
||||
//utf-8中国汉字集合
|
||||
private $ChineseCharacters;
|
||||
//编码
|
||||
private $charset = 'utf-8';
|
||||
|
||||
public function __construct(){
|
||||
if( empty($this->ChineseCharacters) ){
|
||||
$this->ChineseCharacters = file_get_contents('../application/inc/pinyin/ChineseCharacters.dat');
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 转成带有声调的汉语拼音
|
||||
* param $input_char String 需要转换的汉字
|
||||
* param $delimiter String 转换之后拼音之间分隔符
|
||||
* param $outside_ignore Boolean 是否忽略非汉字内容
|
||||
*/
|
||||
public function TransformWithTone($input_char,$delimiter=' ',$outside_ignore=false){
|
||||
|
||||
$input_len = mb_strlen($input_char,$this->charset);
|
||||
$output_char = '';
|
||||
for($i=0;$i<$input_len;$i++){
|
||||
$word = mb_substr($input_char,$i,1,$this->charset);
|
||||
if(preg_match('/^[\x{4e00}-\x{9fa5}]$/u',$word) && preg_match('/\,'.preg_quote($word).'(.*?)\,/',$this->ChineseCharacters,$matches) ){
|
||||
$output_char.=$matches[1].$delimiter;
|
||||
}else if(!$outside_ignore){
|
||||
$output_char.=$word;
|
||||
}
|
||||
}
|
||||
|
||||
return $output_char;
|
||||
}
|
||||
|
||||
/*
|
||||
* 转成带无声调的汉语拼音
|
||||
* param $input_char String 需要转换的汉字
|
||||
* param $delimiter String 转换之后拼音之间分隔符
|
||||
* param $outside_ignore Boolean 是否忽略非汉字内容
|
||||
*/
|
||||
public function TransformWithoutTone($input_char,$delimiter='',$outside_ignore=true){
|
||||
|
||||
$char_with_tone = $this->TransformWithTone($input_char,$delimiter,$outside_ignore);
|
||||
|
||||
$char_without_tone = str_replace(array('ā','á','ǎ','à','ō','ó','ǒ','ò','ē','é','ě','è','ī','í','ǐ','ì','ū','ú','ǔ','ù','ǖ','ǘ','ǚ','ǜ','ü'),
|
||||
array('a','a','a','a','o','o','o','o','e','e','e','e','i','i','i','i','u','u','u','u','v','v','v','v','v')
|
||||
,$char_with_tone );
|
||||
return $char_without_tone;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* 转成汉语拼音首字母
|
||||
* param $input_char String 需要转换的汉字
|
||||
* param $delimiter String 转换之后拼音之间分隔符
|
||||
*/
|
||||
public function TransformUcwords($input_char,$delimiter=''){
|
||||
|
||||
$char_without_tone = ucwords($this->TransformWithoutTone($input_char,' ',true));
|
||||
$ucwords = preg_replace('/[^A-Z]/','',$char_without_tone);
|
||||
if(!empty($delimiter)){
|
||||
$ucwords = implode($delimiter,str_split($ucwords));
|
||||
}
|
||||
return $ucwords;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
include 'ChinesePinyin.class.php';
|
||||
|
||||
$Pinyin = new ChinesePinyin();
|
||||
$words = '汉字转成拼音类';
|
||||
/*
|
||||
$words = '汉字转成拼音类';
|
||||
echo '<h2>'.$words.'</h2>';
|
||||
|
||||
|
||||
|
||||
echo '<p>转成带有声调的汉语拼音<br/>';*/
|
||||
echo $result = $Pinyin->TransformWithTone($words);
|
||||
/*echo $result,'</p>';
|
||||
|
||||
|
||||
|
||||
echo '<p>转成带无声调的汉语拼音<br/>';
|
||||
$result = $Pinyin->TransformWithoutTone($words,' ');
|
||||
echo($result),'</p>';
|
||||
|
||||
|
||||
|
||||
echo '<p>转成汉语拼音首字母<br/>';
|
||||
$result = $Pinyin->TransformUcwords($words);
|
||||
echo($result),'</p>';*/
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
define('LISTPREPAGE',10); #每页列表每页显示条数
|
||||
?>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
define('WEBSITE_IS_STOP',0); #网站是否暂停维护
|
||||
define('DOMAIN_NAME','abc.com'); #官方网址
|
||||
define('SITE_NAME','业务管理系统'); #网站名称
|
||||
define('KF_WEIXIN',''); #客服微信号
|
||||
define('KF_WXCODE','/upload/wxcode/20200109/f249b4eda5fc83b09c3e97ec36934452.png'); #客服微信二维码
|
||||
define('KF_QQ',''); #客服QQ
|
||||
define('KF_QQ2','客服QQ2'); #客服QQ2
|
||||
define('KF_400','400-800-8888'); #客服400
|
||||
define('SITE_KEYWORD','关键词1,关键词2'); #网站关键词
|
||||
define('SITE_DESC','这是一段描述。'); #网站描述
|
||||
define('CLIENT_NAME','业务管理系统'); #客户端title
|
||||
?>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
//其它邮箱主机 注意,25端口在阿里云主机是不可用的,只能用465的端口
|
||||
define("HOST_OT","");
|
||||
define("PORT_OT",465);
|
||||
define("USERNAME_OT","");
|
||||
define("PASSWORD_OT","");
|
||||
|
||||
//QQ邮箱主机
|
||||
define('HOST_QQ','smtp.qq.com'); //QQ主机
|
||||
define('PORT_QQ',465); //QQ端口
|
||||
define('USERNAME_QQ','1@qq.com'); //QQ用户名
|
||||
define('PASSWORD_QQ','1'); //QQ邮箱授权码
|
||||
//发件设置
|
||||
define('NICKNAME','系统服务'); //发件呢称
|
||||
define('CHARSET','UTF-8'); //邮件编码
|
||||
define('MAILSUFFIX',' '); //邮件后缀 36
|
||||
?>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
define("PS_ARR",'[{"id":1,"pid":0,"name":"\u7cfb\u7edf\u8bbe\u7f6e","item":[]},{"id":2,"pid":0,"name":"\u4f1a\u5458\u7ba1\u7406","item":[]}]'); #权限
|
||||
define("PS_ARR2",'[]'); #权限2,不仅其组
|
||||
?>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
define('PAYAPPID',''); #微信公众号APPID
|
||||
define('PAYPASSKEY',''); #商户API密码
|
||||
define('MERCHANTID',''); #商户ID
|
||||
?>
|
||||
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
require_once 'class.phpmailer.php';
|
||||
require_once 'class.smtp.php';
|
||||
|
||||
class QQMailer
|
||||
{
|
||||
public static $HOST = HOST_QQ; // QQ 邮箱的服务器地址
|
||||
public static $PORT = PORT_QQ; // smtp 服务器的远程服务器端口号
|
||||
public static $SMTP = 'ssl'; // 使用 ssl 加密方式登录
|
||||
public static $CHARSET = CHARSET; // 设置发送的邮件的编码
|
||||
private static $USERNAME = USERNAME_QQ; // 授权登录的账号
|
||||
private static $PASSWORD = PASSWORD_QQ; // 授权登录的密码
|
||||
private static $NICKNAME = NICKNAME; // 发件人的昵称
|
||||
|
||||
/**
|
||||
* QQMailer constructor.
|
||||
* @param bool $debug [调试模式]
|
||||
*/
|
||||
public function __construct($debug = false)
|
||||
{
|
||||
$this->mailer = new PHPMailer();
|
||||
$this->mailer->SMTPDebug = $debug ? 1 : 0;
|
||||
$this->mailer->isSMTP(); // 使用 SMTP 方式发送邮件
|
||||
}
|
||||
|
||||
/**
|
||||
* @return PHPMailer
|
||||
*/
|
||||
public function getMailer()
|
||||
{
|
||||
return $this->mailer;
|
||||
}
|
||||
|
||||
private function loadConfig()
|
||||
{
|
||||
/* Server Settings */
|
||||
$this->mailer->SMTPAuth = true; // 开启 SMTP 认证
|
||||
$this->mailer->Host = self::$HOST; // SMTP 服务器地址
|
||||
$this->mailer->Port = self::$PORT; // 远程服务器端口号
|
||||
$this->mailer->SMTPSecure = self::$SMTP; // 登录认证方式
|
||||
/* Account Settings */
|
||||
$this->mailer->Username = self::$USERNAME; // SMTP 登录账号
|
||||
$this->mailer->Password = self::$PASSWORD; // SMTP 登录密码
|
||||
$this->mailer->From = self::$USERNAME; // 发件人邮箱地址
|
||||
$this->mailer->FromName = self::$NICKNAME; // 发件人昵称(任意内容)
|
||||
/* Content Setting */
|
||||
$this->mailer->isHTML(true); // 邮件正文是否为 HTML
|
||||
$this->mailer->CharSet = self::$CHARSET; // 发送的邮件的编码
|
||||
}
|
||||
|
||||
/**
|
||||
* Add attachment
|
||||
* @param $path [附件路径]
|
||||
*/
|
||||
public function addFile($path)
|
||||
{
|
||||
$this->mailer->addAttachment($path);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Send Email
|
||||
* @param $email [收件人]
|
||||
* @param $title [主题]
|
||||
* @param $content [正文]
|
||||
* @return bool [发送状态]
|
||||
*/
|
||||
public function send($email, $title, $content)
|
||||
{
|
||||
$this->loadConfig();
|
||||
$this->mailer->addAddress($email); // 收件人邮箱
|
||||
$this->mailer->Subject = $title; // 邮件主题
|
||||
$this->mailer->Body = $content.MAILSUFFIX; // 邮件信息
|
||||
return (bool)$this->mailer->send(); // 发送邮件
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,979 @@
|
||||
<?php
|
||||
/*~ class.smtp.php
|
||||
.---------------------------------------------------------------------------.
|
||||
| Software: PHPMailer - PHP email class |
|
||||
| Version: 5.2.2 |
|
||||
| Site: https://code.google.com/a/apache-extras.org/p/phpmailer/ |
|
||||
| ------------------------------------------------------------------------- |
|
||||
| Admin: Jim Jagielski (project admininistrator) |
|
||||
| Authors: Andy Prevost (codeworxtech) codeworxtech@users.sourceforge.net |
|
||||
| : Marcus Bointon (coolbru) coolbru@users.sourceforge.net |
|
||||
| : Jim Jagielski (jimjag) jimjag@gmail.com |
|
||||
| Founder: Brent R. Matzelle (original founder) |
|
||||
| Copyright (c) 2010-2012, Jim Jagielski. All Rights Reserved. |
|
||||
| Copyright (c) 2004-2009, Andy Prevost. All Rights Reserved. |
|
||||
| Copyright (c) 2001-2003, Brent R. Matzelle |
|
||||
| ------------------------------------------------------------------------- |
|
||||
| License: Distributed under the Lesser General Public License (LGPL) |
|
||||
| http://www.gnu.org/copyleft/lesser.html |
|
||||
| This program is distributed in the hope that it will be useful - WITHOUT |
|
||||
| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. |
|
||||
'---------------------------------------------------------------------------'
|
||||
*/
|
||||
|
||||
/**
|
||||
* PHPMailer - PHP SMTP email transport class
|
||||
* NOTE: Designed for use with PHP version 5 and up
|
||||
* @package PHPMailer
|
||||
* @author Andy Prevost
|
||||
* @author Marcus Bointon
|
||||
* @copyright 2004 - 2008 Andy Prevost
|
||||
* @author Jim Jagielski
|
||||
* @copyright 2010 - 2012 Jim Jagielski
|
||||
* @license http://www.gnu.org/copyleft/lesser.html Distributed under the Lesser General Public License (LGPL)
|
||||
*/
|
||||
|
||||
/**
|
||||
* SMTP is rfc 821 compliant and implements all the rfc 821 SMTP
|
||||
* commands except TURN which will always return a not implemented
|
||||
* error. SMTP also provides some utility methods for sending mail
|
||||
* to an SMTP server.
|
||||
* original author: Chris Ryan
|
||||
*/
|
||||
require_once '../application/loadconfig/config_set.php';
|
||||
class SMTP {
|
||||
/**
|
||||
* SMTP server port
|
||||
* @var int
|
||||
*/
|
||||
public $SMTP_PORT = 25;
|
||||
|
||||
/**
|
||||
* SMTP reply line ending (don't change)
|
||||
* @var string
|
||||
*/
|
||||
public $CRLF = "\r\n";
|
||||
|
||||
/**
|
||||
* Sets whether debugging is turned on
|
||||
* @var bool
|
||||
*/
|
||||
public $do_debug; // the level of debug to perform
|
||||
|
||||
/**
|
||||
* Sets the function/method to use for debugging output.
|
||||
* Right now we only honor "echo" or "error_log"
|
||||
* @var string
|
||||
*/
|
||||
public $Debugoutput = "echo";
|
||||
|
||||
/**
|
||||
* Sets VERP use on/off (default is off)
|
||||
* @var bool
|
||||
*/
|
||||
public $do_verp = false;
|
||||
|
||||
/**
|
||||
* Sets the SMTP timeout value for reads, in seconds
|
||||
* @var int
|
||||
*/
|
||||
public $Timeout = 15;
|
||||
|
||||
/**
|
||||
* Sets the SMTP timelimit value for reads, in seconds
|
||||
* @var int
|
||||
*/
|
||||
public $Timelimit = 30;
|
||||
|
||||
/**
|
||||
* Sets the SMTP PHPMailer Version number
|
||||
* @var string
|
||||
*/
|
||||
public $Version = '5.2.2-rc1';
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
// PROPERTIES, PRIVATE AND PROTECTED
|
||||
/////////////////////////////////////////////////
|
||||
|
||||
private $smtp_conn; // the socket to the server
|
||||
private $error; // error if any on the last call
|
||||
private $helo_rply; // the reply the server sent to us for HELO
|
||||
|
||||
/**
|
||||
* Outputs debugging info via user-defined method
|
||||
* @param string $str
|
||||
*/
|
||||
private function edebug($str) {
|
||||
if ($this->Debugoutput == "error_log") {
|
||||
error_log($str);
|
||||
} else {
|
||||
echo $str;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the class so that the data is in a known state.
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->smtp_conn = 0;
|
||||
$this->error = null;
|
||||
$this->helo_rply = null;
|
||||
|
||||
$this->do_debug = 0;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
// CONNECTION FUNCTIONS
|
||||
/////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* Connect to the server specified on the port specified.
|
||||
* If the port is not specified use the default SMTP_PORT.
|
||||
* If tval is specified then a connection will try and be
|
||||
* established with the server for that number of seconds.
|
||||
* If tval is not specified the default is 30 seconds to
|
||||
* try on the connection.
|
||||
*
|
||||
* SMTP CODE SUCCESS: 220
|
||||
* SMTP CODE FAILURE: 421
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function Connect($host, $port = 0, $tval = 30) {
|
||||
// set the error val to null so there is no confusion
|
||||
$this->error = null;
|
||||
|
||||
// make sure we are __not__ connected
|
||||
if($this->connected()) {
|
||||
// already connected, generate error
|
||||
$this->error = array("error" => "Already connected to a server");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(empty($port)) {
|
||||
$port = $this->SMTP_PORT;
|
||||
}
|
||||
|
||||
// connect to the smtp server
|
||||
$this->smtp_conn = @fsockopen($host, // the host of the server
|
||||
$port, // the port to use
|
||||
$errno, // error number if any
|
||||
$errstr, // error message if any
|
||||
$tval); // give up after ? secs
|
||||
// verify we connected properly
|
||||
if(empty($this->smtp_conn)) {
|
||||
$this->error = array("error" => "Failed to connect to server",
|
||||
"errno" => $errno,
|
||||
"errstr" => $errstr);
|
||||
if($this->do_debug >= 1) {
|
||||
$this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": $errstr ($errno)" . $this->CRLF . '<br />');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// SMTP server can take longer to respond, give longer timeout for first read
|
||||
// Windows does not have support for this timeout function
|
||||
if(substr(PHP_OS, 0, 3) != "WIN") {
|
||||
$max = ini_get('max_execution_time');
|
||||
if ($max != 0 && $tval > $max) { // don't bother if unlimited
|
||||
@set_time_limit($tval);
|
||||
}
|
||||
stream_set_timeout($this->smtp_conn, $tval, 0);
|
||||
}
|
||||
|
||||
// get any announcement
|
||||
$announce = $this->get_lines();
|
||||
|
||||
if($this->do_debug >= 2) {
|
||||
$this->edebug("SMTP -> FROM SERVER:" . $announce . $this->CRLF . '<br />');
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiate a TLS communication with the server.
|
||||
*
|
||||
* SMTP CODE 220 Ready to start TLS
|
||||
* SMTP CODE 501 Syntax error (no parameters allowed)
|
||||
* SMTP CODE 454 TLS not available due to temporary reason
|
||||
* @access public
|
||||
* @return bool success
|
||||
*/
|
||||
public function StartTLS() {
|
||||
$this->error = null; # to avoid confusion
|
||||
|
||||
if(!$this->connected()) {
|
||||
$this->error = array("error" => "Called StartTLS() without being connected");
|
||||
return false;
|
||||
}
|
||||
|
||||
fputs($this->smtp_conn,"STARTTLS" . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
|
||||
if($this->do_debug >= 2) {
|
||||
$this->edebug("SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />');
|
||||
}
|
||||
|
||||
if($code != 220) {
|
||||
$this->error =
|
||||
array("error" => "STARTTLS not accepted from server",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
$this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Begin encrypted connection
|
||||
if(!stream_socket_enable_crypto($this->smtp_conn, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs SMTP authentication. Must be run after running the
|
||||
* Hello() method. Returns true if successfully authenticated.
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function Authenticate($username, $password, $authtype='LOGIN', $realm='',
|
||||
$workstation='') {
|
||||
if (empty($authtype)) {
|
||||
$authtype = 'LOGIN';
|
||||
}
|
||||
|
||||
switch ($authtype) {
|
||||
case 'PLAIN':
|
||||
// Start authentication
|
||||
fputs($this->smtp_conn,"AUTH PLAIN" . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
|
||||
if($code != 334) {
|
||||
$this->error =
|
||||
array("error" => "AUTH not accepted from server",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
$this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
// Send encoded username and password
|
||||
fputs($this->smtp_conn, base64_encode("\0".$username."\0".$password) . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
|
||||
if($code != 235) {
|
||||
$this->error =
|
||||
array("error" => "Authentication not accepted from server",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
$this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 'LOGIN':
|
||||
// Start authentication
|
||||
fputs($this->smtp_conn,"AUTH LOGIN" . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
|
||||
if($code != 334) {
|
||||
$this->error =
|
||||
array("error" => "AUTH not accepted from server",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
$this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Send encoded username
|
||||
fputs($this->smtp_conn, base64_encode($username) . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
|
||||
if($code != 334) {
|
||||
$this->error =
|
||||
array("error" => "Username not accepted from server",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
$this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Send encoded password
|
||||
fputs($this->smtp_conn, base64_encode($password) . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
|
||||
if($code != 235) {
|
||||
$this->error =
|
||||
array("error" => "Password not accepted from server",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
$this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 'NTLM':
|
||||
/*
|
||||
* ntlm_sasl_client.php
|
||||
** Bundled with Permission
|
||||
**
|
||||
** How to telnet in windows: http://technet.microsoft.com/en-us/library/aa995718%28EXCHG.65%29.aspx
|
||||
** PROTOCOL Documentation http://curl.haxx.se/rfc/ntlm.html#ntlmSmtpAuthentication
|
||||
*/
|
||||
require_once('ntlm_sasl_client.php');
|
||||
$temp = new stdClass();
|
||||
$ntlm_client = new ntlm_sasl_client_class;
|
||||
if(! $ntlm_client->Initialize($temp)){//let's test if every function its available
|
||||
$this->error = array("error" => $temp->error);
|
||||
if($this->do_debug >= 1) {
|
||||
$this->edebug("You need to enable some modules in your php.ini file: " . $this->error["error"] . $this->CRLF);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
$msg1 = $ntlm_client->TypeMsg1($realm, $workstation);//msg1
|
||||
|
||||
fputs($this->smtp_conn,"AUTH NTLM " . base64_encode($msg1) . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
|
||||
|
||||
if($code != 334) {
|
||||
$this->error =
|
||||
array("error" => "AUTH not accepted from server",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
$this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
$challange = substr($rply,3);//though 0 based, there is a white space after the 3 digit number....//msg2
|
||||
$challange = base64_decode($challange);
|
||||
$ntlm_res = $ntlm_client->NTLMResponse(substr($challange,24,8),$password);
|
||||
$msg3 = $ntlm_client->TypeMsg3($ntlm_res,$username,$realm,$workstation);//msg3
|
||||
// Send encoded username
|
||||
fputs($this->smtp_conn, base64_encode($msg3) . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
|
||||
if($code != 235) {
|
||||
$this->error =
|
||||
array("error" => "Could not authenticate",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
$this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if connected to a server otherwise false
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function Connected() {
|
||||
if(!empty($this->smtp_conn)) {
|
||||
$sock_status = socket_get_status($this->smtp_conn);
|
||||
if($sock_status["eof"]) {
|
||||
// the socket is valid but we are not connected
|
||||
if($this->do_debug >= 1) {
|
||||
$this->edebug("SMTP -> NOTICE:" . $this->CRLF . "EOF caught while checking if connected");
|
||||
}
|
||||
$this->Close();
|
||||
return false;
|
||||
}
|
||||
return true; // everything looks good
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes the socket and cleans up the state of the class.
|
||||
* It is not considered good to use this function without
|
||||
* first trying to use QUIT.
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function Close() {
|
||||
$this->error = null; // so there is no confusion
|
||||
$this->helo_rply = null;
|
||||
if(!empty($this->smtp_conn)) {
|
||||
// close the connection and cleanup
|
||||
fclose($this->smtp_conn);
|
||||
$this->smtp_conn = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
// SMTP COMMANDS
|
||||
/////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* Issues a data command and sends the msg_data to the server
|
||||
* finializing the mail transaction. $msg_data is the message
|
||||
* that is to be send with the headers. Each header needs to be
|
||||
* on a single line followed by a <CRLF> with the message headers
|
||||
* and the message body being seperated by and additional <CRLF>.
|
||||
*
|
||||
* Implements rfc 821: DATA <CRLF>
|
||||
*
|
||||
* SMTP CODE INTERMEDIATE: 354
|
||||
* [data]
|
||||
* <CRLF>.<CRLF>
|
||||
* SMTP CODE SUCCESS: 250
|
||||
* SMTP CODE FAILURE: 552,554,451,452
|
||||
* SMTP CODE FAILURE: 451,554
|
||||
* SMTP CODE ERROR : 500,501,503,421
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function Data($msg_data) {
|
||||
$this->error = null; // so no confusion is caused
|
||||
|
||||
if(!$this->connected()) {
|
||||
$this->error = array(
|
||||
"error" => "Called Data() without being connected");
|
||||
return false;
|
||||
}
|
||||
|
||||
fputs($this->smtp_conn,"DATA" . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
|
||||
if($this->do_debug >= 2) {
|
||||
$this->edebug("SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />');
|
||||
}
|
||||
|
||||
if($code != 354) {
|
||||
$this->error =
|
||||
array("error" => "DATA command not accepted from server",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
$this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* the server is ready to accept data!
|
||||
* according to rfc 821 we should not send more than 1000
|
||||
* including the CRLF
|
||||
* characters on a single line so we will break the data up
|
||||
* into lines by \r and/or \n then if needed we will break
|
||||
* each of those into smaller lines to fit within the limit.
|
||||
* in addition we will be looking for lines that start with
|
||||
* a period '.' and append and additional period '.' to that
|
||||
* line. NOTE: this does not count towards limit.
|
||||
*/
|
||||
|
||||
// normalize the line breaks so we know the explode works
|
||||
$msg_data = str_replace("\r\n","\n",$msg_data);
|
||||
$msg_data = str_replace("\r","\n",$msg_data);
|
||||
$lines = explode("\n",$msg_data);
|
||||
|
||||
/* we need to find a good way to determine is headers are
|
||||
* in the msg_data or if it is a straight msg body
|
||||
* currently I am assuming rfc 822 definitions of msg headers
|
||||
* and if the first field of the first line (':' sperated)
|
||||
* does not contain a space then it _should_ be a header
|
||||
* and we can process all lines before a blank "" line as
|
||||
* headers.
|
||||
*/
|
||||
|
||||
$field = substr($lines[0],0,strpos($lines[0],":"));
|
||||
$in_headers = false;
|
||||
if(!empty($field) && !strstr($field," ")) {
|
||||
$in_headers = true;
|
||||
}
|
||||
|
||||
$max_line_length = 998; // used below; set here for ease in change
|
||||
|
||||
while(list(,$line) = @each($lines)) {
|
||||
$lines_out = null;
|
||||
if($line == "" && $in_headers) {
|
||||
$in_headers = false;
|
||||
}
|
||||
// ok we need to break this line up into several smaller lines
|
||||
while(strlen($line) > $max_line_length) {
|
||||
$pos = strrpos(substr($line,0,$max_line_length)," ");
|
||||
|
||||
// Patch to fix DOS attack
|
||||
if(!$pos) {
|
||||
$pos = $max_line_length - 1;
|
||||
$lines_out[] = substr($line,0,$pos);
|
||||
$line = substr($line,$pos);
|
||||
} else {
|
||||
$lines_out[] = substr($line,0,$pos);
|
||||
$line = substr($line,$pos + 1);
|
||||
}
|
||||
|
||||
/* if processing headers add a LWSP-char to the front of new line
|
||||
* rfc 822 on long msg headers
|
||||
*/
|
||||
if($in_headers) {
|
||||
$line = "\t" . $line;
|
||||
}
|
||||
}
|
||||
$lines_out[] = $line;
|
||||
|
||||
// send the lines to the server
|
||||
while(list(,$line_out) = @each($lines_out)) {
|
||||
if(strlen($line_out) > 0)
|
||||
{
|
||||
if(substr($line_out, 0, 1) == ".") {
|
||||
$line_out = "." . $line_out;
|
||||
}
|
||||
}
|
||||
fputs($this->smtp_conn,$line_out . $this->CRLF);
|
||||
}
|
||||
}
|
||||
|
||||
// message data has been sent
|
||||
fputs($this->smtp_conn, $this->CRLF . "." . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
|
||||
if($this->do_debug >= 2) {
|
||||
$this->edebug("SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />');
|
||||
}
|
||||
|
||||
if($code != 250) {
|
||||
$this->error =
|
||||
array("error" => "DATA not accepted from server",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
$this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends the HELO command to the smtp server.
|
||||
* This makes sure that we and the server are in
|
||||
* the same known state.
|
||||
*
|
||||
* Implements from rfc 821: HELO <SP> <domain> <CRLF>
|
||||
*
|
||||
* SMTP CODE SUCCESS: 250
|
||||
* SMTP CODE ERROR : 500, 501, 504, 421
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function Hello($host = '') {
|
||||
$this->error = null; // so no confusion is caused
|
||||
|
||||
if(!$this->connected()) {
|
||||
$this->error = array(
|
||||
"error" => "Called Hello() without being connected");
|
||||
return false;
|
||||
}
|
||||
|
||||
// if hostname for HELO was not specified send default
|
||||
if(empty($host)) {
|
||||
// determine appropriate default to send to server
|
||||
$host = "localhost";
|
||||
}
|
||||
|
||||
// Send extended hello first (RFC 2821)
|
||||
if(!$this->SendHello("EHLO", $host)) {
|
||||
if(!$this->SendHello("HELO", $host)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a HELO/EHLO command.
|
||||
* @access private
|
||||
* @return bool
|
||||
*/
|
||||
private function SendHello($hello, $host) {
|
||||
fputs($this->smtp_conn, $hello . " " . $host . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
|
||||
if($this->do_debug >= 2) {
|
||||
$this->edebug("SMTP -> FROM SERVER: " . $rply . $this->CRLF . '<br />');
|
||||
}
|
||||
|
||||
if($code != 250) {
|
||||
$this->error =
|
||||
array("error" => $hello . " not accepted from server",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
$this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->helo_rply = $rply;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts a mail transaction from the email address specified in
|
||||
* $from. Returns true if successful or false otherwise. If True
|
||||
* the mail transaction is started and then one or more Recipient
|
||||
* commands may be called followed by a Data command.
|
||||
*
|
||||
* Implements rfc 821: MAIL <SP> FROM:<reverse-path> <CRLF>
|
||||
*
|
||||
* SMTP CODE SUCCESS: 250
|
||||
* SMTP CODE SUCCESS: 552,451,452
|
||||
* SMTP CODE SUCCESS: 500,501,421
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function Mail($from) {
|
||||
$this->error = null; // so no confusion is caused
|
||||
|
||||
if(!$this->connected()) {
|
||||
$this->error = array(
|
||||
"error" => "Called Mail() without being connected");
|
||||
return false;
|
||||
}
|
||||
|
||||
$useVerp = ($this->do_verp ? " XVERP" : "");
|
||||
fputs($this->smtp_conn,"MAIL FROM:<" . $from . ">" . $useVerp . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
|
||||
if($this->do_debug >= 2) {
|
||||
$this->edebug("SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />');
|
||||
}
|
||||
|
||||
if($code != 250) {
|
||||
$this->error =
|
||||
array("error" => "MAIL not accepted from server",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
$this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends the quit command to the server and then closes the socket
|
||||
* if there is no error or the $close_on_error argument is true.
|
||||
*
|
||||
* Implements from rfc 821: QUIT <CRLF>
|
||||
*
|
||||
* SMTP CODE SUCCESS: 221
|
||||
* SMTP CODE ERROR : 500
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function Quit($close_on_error = true) {
|
||||
$this->error = null; // so there is no confusion
|
||||
|
||||
if(!$this->connected()) {
|
||||
$this->error = array(
|
||||
"error" => "Called Quit() without being connected");
|
||||
return false;
|
||||
}
|
||||
|
||||
// send the quit command to the server
|
||||
fputs($this->smtp_conn,"quit" . $this->CRLF);
|
||||
|
||||
// get any good-bye messages
|
||||
$byemsg = $this->get_lines();
|
||||
|
||||
if($this->do_debug >= 2) {
|
||||
$this->edebug("SMTP -> FROM SERVER:" . $byemsg . $this->CRLF . '<br />');
|
||||
}
|
||||
|
||||
$rval = true;
|
||||
$e = null;
|
||||
|
||||
$code = substr($byemsg,0,3);
|
||||
if($code != 221) {
|
||||
// use e as a tmp var cause Close will overwrite $this->error
|
||||
$e = array("error" => "SMTP server rejected quit command",
|
||||
"smtp_code" => $code,
|
||||
"smtp_rply" => substr($byemsg,4));
|
||||
$rval = false;
|
||||
if($this->do_debug >= 1) {
|
||||
$this->edebug("SMTP -> ERROR: " . $e["error"] . ": " . $byemsg . $this->CRLF . '<br />');
|
||||
}
|
||||
}
|
||||
|
||||
if(empty($e) || $close_on_error) {
|
||||
$this->Close();
|
||||
}
|
||||
|
||||
return $rval;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends the command RCPT to the SMTP server with the TO: argument of $to.
|
||||
* Returns true if the recipient was accepted false if it was rejected.
|
||||
*
|
||||
* Implements from rfc 821: RCPT <SP> TO:<forward-path> <CRLF>
|
||||
*
|
||||
* SMTP CODE SUCCESS: 250,251
|
||||
* SMTP CODE FAILURE: 550,551,552,553,450,451,452
|
||||
* SMTP CODE ERROR : 500,501,503,421
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function Recipient($to) {
|
||||
$this->error = null; // so no confusion is caused
|
||||
|
||||
if(!$this->connected()) {
|
||||
$this->error = array(
|
||||
"error" => "Called Recipient() without being connected");
|
||||
return false;
|
||||
}
|
||||
|
||||
fputs($this->smtp_conn,"RCPT TO:<" . $to . ">" . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
|
||||
if($this->do_debug >= 2) {
|
||||
$this->edebug("SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />');
|
||||
}
|
||||
|
||||
if($code != 250 && $code != 251) {
|
||||
$this->error =
|
||||
array("error" => "RCPT not accepted from server",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
$this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends the RSET command to abort and transaction that is
|
||||
* currently in progress. Returns true if successful false
|
||||
* otherwise.
|
||||
*
|
||||
* Implements rfc 821: RSET <CRLF>
|
||||
*
|
||||
* SMTP CODE SUCCESS: 250
|
||||
* SMTP CODE ERROR : 500,501,504,421
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function Reset() {
|
||||
$this->error = null; // so no confusion is caused
|
||||
|
||||
if(!$this->connected()) {
|
||||
$this->error = array(
|
||||
"error" => "Called Reset() without being connected");
|
||||
return false;
|
||||
}
|
||||
|
||||
fputs($this->smtp_conn,"RSET" . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
|
||||
if($this->do_debug >= 2) {
|
||||
$this->edebug("SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />');
|
||||
}
|
||||
|
||||
if($code != 250) {
|
||||
$this->error =
|
||||
array("error" => "RSET failed",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
$this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts a mail transaction from the email address specified in
|
||||
* $from. Returns true if successful or false otherwise. If True
|
||||
* the mail transaction is started and then one or more Recipient
|
||||
* commands may be called followed by a Data command. This command
|
||||
* will send the message to the users terminal if they are logged
|
||||
* in and send them an email.
|
||||
*
|
||||
* Implements rfc 821: SAML <SP> FROM:<reverse-path> <CRLF>
|
||||
*
|
||||
* SMTP CODE SUCCESS: 250
|
||||
* SMTP CODE SUCCESS: 552,451,452
|
||||
* SMTP CODE SUCCESS: 500,501,502,421
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function SendAndMail($from) {
|
||||
$this->error = null; // so no confusion is caused
|
||||
|
||||
if(!$this->connected()) {
|
||||
$this->error = array(
|
||||
"error" => "Called SendAndMail() without being connected");
|
||||
return false;
|
||||
}
|
||||
|
||||
fputs($this->smtp_conn,"SAML FROM:" . $from . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
|
||||
if($this->do_debug >= 2) {
|
||||
$this->edebug("SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />');
|
||||
}
|
||||
|
||||
if($code != 250) {
|
||||
$this->error =
|
||||
array("error" => "SAML not accepted from server",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
$this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is an optional command for SMTP that this class does not
|
||||
* support. This method is here to make the RFC821 Definition
|
||||
* complete for this class and __may__ be implimented in the future
|
||||
*
|
||||
* Implements from rfc 821: TURN <CRLF>
|
||||
*
|
||||
* SMTP CODE SUCCESS: 250
|
||||
* SMTP CODE FAILURE: 502
|
||||
* SMTP CODE ERROR : 500, 503
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function Turn() {
|
||||
$this->error = array("error" => "This method, TURN, of the SMTP ".
|
||||
"is not implemented");
|
||||
if($this->do_debug >= 1) {
|
||||
$this->edebug("SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF . '<br />');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current error
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getError() {
|
||||
return $this->error;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
// INTERNAL FUNCTIONS
|
||||
/////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* Read in as many lines as possible
|
||||
* either before eof or socket timeout occurs on the operation.
|
||||
* With SMTP we can tell if we have more lines to read if the
|
||||
* 4th character is '-' symbol. If it is a space then we don't
|
||||
* need to read anything else.
|
||||
* @access private
|
||||
* @return string
|
||||
*/
|
||||
private function get_lines() {
|
||||
$data = "";
|
||||
$endtime = 0;
|
||||
/* If for some reason the fp is bad, don't inf loop */
|
||||
if (!is_resource($this->smtp_conn)) {
|
||||
return $data;
|
||||
}
|
||||
stream_set_timeout($this->smtp_conn, $this->Timeout);
|
||||
if ($this->Timelimit > 0) {
|
||||
$endtime = time() + $this->Timelimit;
|
||||
}
|
||||
while(is_resource($this->smtp_conn) && !feof($this->smtp_conn)) {
|
||||
$str = @fgets($this->smtp_conn,515);
|
||||
if($this->do_debug >= 4) {
|
||||
$this->edebug("SMTP -> get_lines(): \$data was \"$data\"" . $this->CRLF . '<br />');
|
||||
$this->edebug("SMTP -> get_lines(): \$str is \"$str\"" . $this->CRLF . '<br />');
|
||||
}
|
||||
$data .= $str;
|
||||
if($this->do_debug >= 4) {
|
||||
$this->edebug("SMTP -> get_lines(): \$data is \"$data\"" . $this->CRLF . '<br />');
|
||||
}
|
||||
// if 4th character is a space, we are done reading, break the loop
|
||||
if(substr($str,3,1) == " ") { break; }
|
||||
// Timed-out? Log and break
|
||||
$info = stream_get_meta_data($this->smtp_conn);
|
||||
if ($info['timed_out']) {
|
||||
if($this->do_debug >= 4) {
|
||||
$this->edebug("SMTP -> get_lines(): timed-out (" . $this->Timeout . " seconds) <br />");
|
||||
}
|
||||
break;
|
||||
}
|
||||
// Now check if reads took too long
|
||||
if ($endtime) {
|
||||
if (time() > $endtime) {
|
||||
if($this->do_debug >= 4) {
|
||||
$this->edebug("SMTP -> get_lines(): timelimit reached (" . $this->Timelimit . " seconds) <br />");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,104 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: liu21st <liu21st@gmail.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
return [
|
||||
'__pattern__' => [
|
||||
'name' => '\w+',
|
||||
],
|
||||
'[hello]' => [
|
||||
':id' => ['index/hello', ['method' => 'get'], ['id' => '\d+']],
|
||||
':name' => ['index/hello', ['method' => 'post']],
|
||||
],
|
||||
"/"=> ['index/Index/index',['method' => 'get']],
|
||||
"index"=> ['index/Index/index',['method' => 'get']],
|
||||
"okadmin"=> ['admin/Admin/index',['method' => 'get']],
|
||||
|
||||
|
||||
"okadmin/roles"=> ['admin/Sysset/roles',['method' => 'get']],
|
||||
"okadmin/api/roles"=> ['admin/Api/roles',['method' => 'post|get']],
|
||||
"okadmin/api/roles/:id"=> ['admin/Api/roles',['method' => 'patch|delete']],
|
||||
"okadmin/api/allPermissions"=> ['admin/Api/allPermissions',['method' => 'get']],
|
||||
|
||||
//管理员管理
|
||||
"okadmin/admins"=> ['admin/admin/logins',['method' => 'get']],
|
||||
"okadmin/api/admins"=> ['admin/Api/admins',['method' => 'post|get']],
|
||||
"okadmin/api/admins/:id"=> ['admin/Api/admins',['method' => 'patch|delete']],
|
||||
"okadmin/api/admins/:id/repass"=> ['admin/Api/adminrepass',['method' => 'patch']],
|
||||
"okadmin/api/admins/:id/state"=> ['admin/Api/adminstate',['method' => 'patch']],
|
||||
|
||||
//地区管理
|
||||
"okadmin/regions"=> ['admin/Html/regions',['method' => 'get']],
|
||||
"okadmin/api/regions"=> ['admin/Api/regions',['method' => 'post|get']],
|
||||
"okadmin/api/regions/:id"=> ['admin/Api/regions',['method' => 'patch|delete']],
|
||||
|
||||
//系统设置
|
||||
"okadmin/syssetting"=> ['admin/Admin/syssetting',['method' => 'get']],
|
||||
"okadmin/sysinfo"=> ['admin/Admin/sysinfo',['method' => 'get']],
|
||||
"okadmin/wxcodeup"=> ['admin/Admin/wxcodeup',['method' => 'post']],
|
||||
"okadmin/systemup"=> ['admin/Admin/systemup',['method' => 'put']],
|
||||
|
||||
|
||||
//暂弃
|
||||
|
||||
"okadmin/types"=> ['admin/Admin/types',['method' => 'get']],
|
||||
"okadmin/typelist"=> ['admin/Admin/typelist',['method' => 'get']],
|
||||
"okadmin/type"=> ['admin/Admin/type',['method' => 'post']],
|
||||
"okadmin/type/:id"=> ['admin/Admin/type',['method' => 'put|delete']],
|
||||
"okadmin/contents"=> ['admin/Admin/contents',['method' => 'get']],
|
||||
"okadmin/contentslist"=> ['admin/Admin/contentslist',['method' => 'get']],
|
||||
"okadmin/content"=> ['admin/Admin/content',['method' => 'post']],
|
||||
"okadmin/content/:id"=> ['admin/Admin/content',['method' => 'put|delete']],
|
||||
"okadmin/contentadds"=> ['admin/Admin/contentadds',['method' => 'post|get']],
|
||||
|
||||
|
||||
|
||||
"okadmin/templates"=> ['admin/Admin/templates',['method' => 'get|post']],
|
||||
"okadmin/template/:id"=> ['admin/Admin/template',['method' => 'delete']],
|
||||
"okadmin/templateslist"=> ['admin/Admin/templateslist',['method' => 'get']],
|
||||
"okadmin/templateupload"=> ['admin/Admin/templateupload',['method' => 'post']],
|
||||
|
||||
"okadmin/login"=> ['admin/admin',['method' => 'get']],
|
||||
"okadmin/adminlogin"=> ['admin/admin/loginlogin',['method' => 'post']],
|
||||
"okadmin/loginout"=> ['admin/adminout',['method' => 'get']],
|
||||
"okadmin/uppass"=> ['admin/Admin/uppass',['method' => 'post']],
|
||||
"okadmin/upuserxx"=> ['admin/Admin/upuserxx',['method' => 'post']],
|
||||
|
||||
"okadmin/getoneuser"=> ['admin/Admin/getoneuser',['method' => 'get']],
|
||||
"okadmin/delUser"=> ['admin/Admin/delUser',['method' => 'delete']],
|
||||
"okadmin/upStateUser"=> ['admin/Admin/upStateUser',['method' => 'put']],
|
||||
"okadmin/searchUsers"=> ['admin/Admin/searchUsers',['method' => 'get']],
|
||||
"okadmin/adduser"=> ['admin/Admin/adduser',['method' => 'post']],
|
||||
"okadmin/upuserpass"=> ['admin/Admin/upuserpass',['method' => 'post']],
|
||||
"okadmin/system"=> ['admin/Admin/system',['method' => 'get']],
|
||||
"okadmin/systemup"=> ['admin/Admin/systemup',['method' => 'put']],
|
||||
|
||||
"hanzi"=> ['index/Index/hanzi',['method' => 'get']],
|
||||
"showhanzi"=> ['index/Index/showhanzi',['method' => 'get']],
|
||||
//"server"=> ['server/Worker/onWorkerStart',['method' => 'get']],
|
||||
|
||||
"member"=> ['member/Member/index',['method' => 'get']],
|
||||
"member/index"=> ['member/Member/index',['method' => 'get']],
|
||||
"member/login"=> ['member/Member/login',['method' => 'get']],
|
||||
"member/logingo"=> ['member/Member/logingo',['method' => 'post']],
|
||||
"member/loginout"=> ['member/Member/loginout',['method' => 'get']],
|
||||
"member/reg"=> ['member/Member/reg',['method' => 'get']],
|
||||
"member/reggo"=> ['member/Member/reggo',['method' => 'post']],
|
||||
"member/ckmail"=> ['member/Member/ckmail',['method' => 'post']],
|
||||
"member/uppassto"=> ['member/Member/uppassto',['method' => 'post']],
|
||||
"member/uppass"=> ['member/Member/uppass',['method' => 'get']],
|
||||
|
||||
"member/accountcenter"=> ['member/Member/accountcenter',['method' => 'get']],
|
||||
"member/htmlcreation"=> ['member/Html/htmlcreation',['method' => 'get|post']],
|
||||
"member/htmlprogress"=> ['member/Html/htmlprogress',['method' => 'get']],
|
||||
"member/createtask"=> ['member/Html/createtask',['method' => 'post']],
|
||||
"member/templates"=> ['member/Html/templates',['method' => 'get']],
|
||||
"member/tp"=> ['member/Html/tp',['method' => 'get']],
|
||||
];
|
||||
@@ -0,0 +1,278 @@
|
||||
<?php
|
||||
namespace app\server\controller;
|
||||
use app\common\model\ArticleModel;
|
||||
use think\Controller;
|
||||
use Workerman\Lib\Timer;
|
||||
|
||||
class Collection extends Controller{
|
||||
|
||||
public function __construct(){
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function add_timer(){
|
||||
Timer::add(3, array($this, 'index'), array(), true);//时间间隔过小,运行会崩溃 5秒一次吧
|
||||
Timer::add(3, array($this, 'tips'), array(), true);//时间间隔过小,运行会崩溃 5秒一次吧
|
||||
}
|
||||
//后台提示音
|
||||
public function tips(){
|
||||
$cz=db("charge_req")->where("status",1)->order("id","desc")->find();
|
||||
$tx=db("users_wallet_out")->where("status",1)->order("id","desc")->find();
|
||||
if($cz && $tx){
|
||||
$msgdata=[
|
||||
"type"=>"chongzhitixian",
|
||||
"data"=>[
|
||||
"uid"=>"chongzhitixian"
|
||||
]
|
||||
];
|
||||
websocket_server_push($msgdata,"all","admin_admin");
|
||||
}else{
|
||||
if($cz){
|
||||
$msgdata=[
|
||||
"type"=>"chongzhi",
|
||||
"data"=>[
|
||||
"uid"=>"chongzhi"
|
||||
]
|
||||
];
|
||||
websocket_server_push($msgdata,"all","admin_admin");
|
||||
}
|
||||
if($tx){
|
||||
$msgdata=[
|
||||
"type"=>"tixian",
|
||||
"data"=>[
|
||||
"uid"=>"tixian"
|
||||
]
|
||||
];
|
||||
websocket_server_push($msgdata,"all","admin_admin");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* 采集数据
|
||||
*/
|
||||
|
||||
public function index(){
|
||||
//加载配置文件 tasks_matches
|
||||
$tasks_matches=getConfig("../config/tasks_matches.php");
|
||||
$sys_matches=$tasks_matches["tasks_matches"];//获取到“交易所”的交易对
|
||||
|
||||
$time=time();
|
||||
$time_now=strtotime(date("Y-m-d H:i"));//取整分钟
|
||||
$time_next=$time_now+60;
|
||||
foreach($sys_matches as $k=>$v){
|
||||
$current=db("myquotation")->where("base",$v["name"])->where("itime",$time_now)->find();//取出当前的数据
|
||||
if(!$current){
|
||||
continue;
|
||||
}
|
||||
$price=numZhiJian($current["high"],$current["low"]);//取出当前价格(从当前价的最高、最低价中取随机数)
|
||||
if($time_now==$time){
|
||||
$price=$current["close"]; //如果是整分钟,那么这个当前价就是本分钟的收盘价
|
||||
}
|
||||
//$next=db("myquotation")->where("itime",$time_next)->find();//取出下一条数据 好像不需要下一条
|
||||
$shu24=0;//$current["vol"] ->whereBetweenTime('create_time', '2017-01-01', '2017-06-30')
|
||||
$e=time();
|
||||
$s=$e-86400;
|
||||
$shu24=db("myquotation")->where("base",$v["name"])->whereTime('itime', 'between', [$s, $e])->sum("vol");
|
||||
$period="1min";//1分钟
|
||||
$php_time=$time_next;//要显示的时间戳
|
||||
$change=diychange($current["open"],$price);
|
||||
$str="<?php".PHP_EOL;
|
||||
$str.='return ['.PHP_EOL;
|
||||
$str.='"libra_data"=>['.PHP_EOL;
|
||||
$str.='"api_form"=>"diy",
|
||||
"change"=>"'.$change.'",
|
||||
"close"=>'.$price.',
|
||||
"currency_id"=>'.$v["currency_id"].',
|
||||
"currency_name"=>"'.$current["base"].'",
|
||||
"high"=>'.$current["high"].',
|
||||
"legal_id"=>'.$v["legal_id"].',
|
||||
"legal_name"=>"'.$v["legal_name"].'",
|
||||
"low"=>'.$current["low"].',
|
||||
"match_id"=>'.$v["id"].',
|
||||
"now_price"=>'.$price.',
|
||||
"open"=>'.$current["open"].',
|
||||
"period"=>"'.$period.'",
|
||||
"symbol"=>"'.$current["symbol"].'",
|
||||
"time"=>'.$time_next.'000,
|
||||
"type"=>"kline",
|
||||
"volume"=>'.$current["vol"].'
|
||||
'.PHP_EOL;
|
||||
$str.=']'.PHP_EOL.'];'.PHP_EOL;
|
||||
writeFile("../config/kline_1min_".strtolower($v["name"]).".php",$str);
|
||||
|
||||
//daymarket
|
||||
|
||||
$str2="<?php".PHP_EOL;
|
||||
$str2.='return ['.PHP_EOL;
|
||||
$str2.='"libra_data"=>['.PHP_EOL;
|
||||
$str2.='"api_form"=>"diy",
|
||||
"change"=>"'.$change.'",
|
||||
"close"=>'.$price.',
|
||||
"currency_id"=>'.$v["currency_id"].',
|
||||
"currency_name"=>"'.$current["base"].'",
|
||||
"high"=>'.$current["high"].',
|
||||
"legal_id"=>'.$v["legal_id"].',
|
||||
"legal_name"=>"'.$v["legal_name"].'",
|
||||
"low"=>'.$current["low"].',
|
||||
"match_id"=>'.$v["id"].',
|
||||
"now_price"=>'.$price.',
|
||||
"open"=>'.$current["open"].',
|
||||
"period"=>"'.$period.'",
|
||||
"symbol"=>"'.$current["symbol"].'",
|
||||
"time"=>'.$time_next.'000,
|
||||
"type"=>"daymarket",
|
||||
"volume"=>'.$shu24.'
|
||||
'.PHP_EOL;
|
||||
$str2.=']'.PHP_EOL.'];'.PHP_EOL;
|
||||
|
||||
|
||||
writeFile("../config/daymarket_".strtolower($v["name"]).".php",$str2);
|
||||
//成交量数据 market_detail
|
||||
$sj=mt_rand(1,100);
|
||||
$sjsl=mt_rand(1,10000);
|
||||
$direction="";
|
||||
if($sj<50){
|
||||
//买
|
||||
$direction="buy";
|
||||
}else{
|
||||
//卖
|
||||
$direction="sell";
|
||||
}
|
||||
|
||||
$str3="<?php".PHP_EOL;
|
||||
$str3.='return ['.PHP_EOL;
|
||||
$str3.='"libra_data"=>['.PHP_EOL;
|
||||
$str3.='"base-currency"=>"'.$current["base"].'",
|
||||
"currency_id"=>'.$v["currency_id"].',
|
||||
"currency_name"=>"'.$current["base"].'",
|
||||
"legal_id"=>'.$v["legal_id"].',
|
||||
"legal_name"=>"'.$v["legal_name"].'",
|
||||
"quote-currency"=>"'.$v["legal_name"].'",
|
||||
"symbol"=>"'.$current["symbol"].'",
|
||||
"type"=>"market_detail",
|
||||
"data"=>[
|
||||
"amount"=>'.$sjsl.',
|
||||
"direction"=>"'.$direction.'",
|
||||
"id"=>'.$time.'000,
|
||||
"price"=>'.$price.',
|
||||
"time"=>"'.date("H:i:s",$time).'",
|
||||
"ts"=>'.$time.'000,
|
||||
"tradeId"=>'.$time.'
|
||||
]
|
||||
'.PHP_EOL;
|
||||
$str3.=']'.PHP_EOL.'];'.PHP_EOL;
|
||||
writeFile("../config/market_detail_".strtolower($v["name"]).".php",$str3);
|
||||
|
||||
//修改基本价格
|
||||
$up=[
|
||||
"price"=>$price
|
||||
];
|
||||
db("currency")->where("id",$v["currency_id"])->update($up);
|
||||
|
||||
//修改成交量等
|
||||
$up2=[
|
||||
"now_price"=>$price,
|
||||
"change"=>$change
|
||||
];
|
||||
db("currency_quotation")->where("match_id",$v["id"])->where("currency_id",$v["currency_id"])->update($up2);
|
||||
//20 秒一次增加购买数量
|
||||
if($time%20==0){
|
||||
db("currency_quotation")->where("match_id",$v["id"])->where("currency_id",$v["currency_id"])->inc("volume",mt_rand(10,200))->update($up2);
|
||||
}
|
||||
}
|
||||
}
|
||||
public function get_curl($url){
|
||||
$ch=curl_init();
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($ch,CURLOPT_URL,$url);
|
||||
curl_setopt($ch,CURLOPT_HEADER,0);
|
||||
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
|
||||
$output = curl_exec($ch);
|
||||
|
||||
if($output === FALSE ){
|
||||
echo "CURL Error:".curl_error($ch);
|
||||
}
|
||||
curl_close($ch);
|
||||
// 4. 释放curl句柄
|
||||
|
||||
return $output;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function t50Obj2array($obj,$isstr=false){
|
||||
if($isstr){
|
||||
//字符串输出
|
||||
return json_encode($obj,JSON_UNESCAPED_UNICODE);
|
||||
}else{
|
||||
//输出array
|
||||
return json_decode(json_encode($obj,JSON_UNESCAPED_UNICODE),true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//调用配置文件
|
||||
function getConfig($file,$isstr=false){
|
||||
$cfg=include($file);
|
||||
return t50Obj2array($cfg,$isstr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//发送消息
|
||||
function websocket_server_push($data=array(),$to_type="admin",$to="admin_admin"){
|
||||
$param=[
|
||||
"type"=>"publish",
|
||||
"to"=>$to,
|
||||
"to_type"=>$to_type,//用户类型:all所有用户类型。admin后台管理员 alluser所有前端用户 agent 代理等。根据不同类型去查不同的表。用户登录时用type+uuid如"agent_xxxxxx";可以防止UUID在不同表中重复。
|
||||
"content"=>$data
|
||||
];
|
||||
$headers =[
|
||||
0=>"Content-Type:application/json; charset=utf-8"
|
||||
];
|
||||
return wsstPost("http:/127.0.0.1:3188",$param,$headers);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function wsstPost($url = '', $param =array(),$headers=array()) {
|
||||
$param=json_encode($param,JSON_UNESCAPED_UNICODE);
|
||||
//echo $param;
|
||||
if(!$param){
|
||||
return false;
|
||||
}
|
||||
if (empty($url)) {
|
||||
return false;
|
||||
}
|
||||
/*$headers = array();
|
||||
//array_push($headers, "Authorization:APPCODE " . $appcode);
|
||||
//根据API的要求,定义相对应的Content-Type
|
||||
if($param_type=="form"){
|
||||
array_push($headers, "Content-Type".":"."application/x-www-form-urlencoded; charset=UTF-8");
|
||||
}
|
||||
if($param_type=="json"){
|
||||
array_push($headers, "Content-Type".":"."application/json; charset=utf-8");
|
||||
}*/
|
||||
$curlPost = $param;
|
||||
$ch = curl_init();//初始化curl
|
||||
curl_setopt($ch, CURLOPT_URL,$url);//抓取指定网页
|
||||
curl_setopt($ch, CURLOPT_HEADER, 0);//设置header
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,false); // 跳过证书检查
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);//要求结果为字符串且输出到屏幕上
|
||||
curl_setopt($ch, CURLOPT_POST, 1);//post提交方式
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost);
|
||||
$data = curl_exec($ch);//运行curl
|
||||
curl_close($ch);
|
||||
//$data = json_decode($data);
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
namespace app\server\controller;
|
||||
use think\worker\Server;
|
||||
|
||||
class Worker extends Server
|
||||
{
|
||||
|
||||
public function onWorkerStart($work)
|
||||
{
|
||||
$handle=new Collection();
|
||||
$handle->add_timer();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: liu21st <liu21st@gmail.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
// 应用行为扩展定义文件
|
||||
return [
|
||||
// 应用初始化
|
||||
'app_init' => [],
|
||||
// 应用开始
|
||||
'app_begin' => [],
|
||||
// 模块初始化
|
||||
'module_init' => [],
|
||||
// 操作开始执行
|
||||
'action_begin' => [],
|
||||
// 视图内容过滤
|
||||
'view_filter' => [],
|
||||
// 日志写入
|
||||
'log_write' => [],
|
||||
// 应用结束
|
||||
'app_end' => [],
|
||||
];
|
||||
@@ -0,0 +1,74 @@
|
||||
{include file="../application/tpl/admin/head.html" /}
|
||||
<el-breadcrumb separator="/">
|
||||
<el-breadcrumb-item><i class="el-icon-s-home"></i><a href="/okadmin">系统首页</a></el-breadcrumb-item>
|
||||
<el-breadcrumb-item>{$pagemodel}</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
<div class="clearfix pdtb10">
|
||||
<div class="fl">
|
||||
<el-button type="success" icon="el-icon-plus" size="mini" @click="edit()">新增管理员</el-button>
|
||||
</div>
|
||||
<div class="fr">
|
||||
<el-button type="warning" plain size="mini" @click="getlist" icon="el-icon-search">刷新</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr><th>姓名</th><th>账号</th><th>角色</th><th>状态</th><th>添加时间</th><th>最后登录</th><th>登录IP</th><th width="220">操作</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(items,index) in lists">
|
||||
<td>{{items.user_name}}</td>
|
||||
<td>{{items.account_name}}</td>
|
||||
<td>{{items.role_name}}</td>
|
||||
<td><span v-if="items.state==1">启用</span><span v-else>禁用</span></td>
|
||||
<td>{{items.addtime}}</td>
|
||||
<td>{{items.logintime}}</td>
|
||||
<td>{{items.loginip}}</td>
|
||||
<td>
|
||||
<el-button type="text" @click="repass(index)" v-if="items.id!=1">重置密码</el-button>
|
||||
<el-button type="text" @click="editstate(index)" v-if="items.id!=1"><span v-if="items.state==1">禁用</span><span v-else>启用</span></el-button>
|
||||
<el-button type="text" @click="edit(index)" v-if="items.id!=1">修改</el-button>
|
||||
<el-button type="text" @click="del(index)" v-if="items.id!=1">删除</el-button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="listtip" style="display:none;" v-show="isloading || lists.length<1">{{datatxt}}</div>
|
||||
|
||||
<el-dialog
|
||||
:title="edittitle"
|
||||
:visible.sync="iseditshow"
|
||||
width="480px"
|
||||
:show-close="false"
|
||||
:close-on-press-escape="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div>
|
||||
<el-form ref="one" :model="one" :rules="oneRulue" label-width="80px">
|
||||
<el-form-item label="登录账号" prop="account_name">
|
||||
<el-input v-model.trim="one.account_name" placeholder="登录账号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="姓名" prop="user_name">
|
||||
<el-input v-model.trim="one.user_name" placeholder="姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="登录密码" prop="password" v-if="ac.type=='add'">
|
||||
<el-input v-model.trim="one.password" placeholder="登录密码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="角色" prop="role">
|
||||
<el-select v-model="one.role" placeholder="无">
|
||||
<el-option value="" label="无"></el-option>
|
||||
<el-option v-for="items in roles" :value="items.id" :key="items.id" :label="items.name"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="iseditshow = false" size="small"><span v-if="isedit">关 闭</span><span v-else>取 消</span></el-button>
|
||||
<el-button type="primary" @click="editSub('one')" size="small" v-if="!isedit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
{include file="../application/tpl/admin/foot.html" /}
|
||||
<script src="/model/admin/admins.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,42 @@
|
||||
{include file="../application/admin/view/inc/head.html" /}
|
||||
<el-breadcrumb separator="/">
|
||||
<el-breadcrumb-item><i class="el-icon-s-home"></i><a href="/okadmin">系统首页</a></el-breadcrumb-item>
|
||||
<el-breadcrumb-item><a href="/okadmin/contents">内容管理</a></el-breadcrumb-item>
|
||||
<el-breadcrumb-item>{$pagemodel}</el-breadcrumb-item>
|
||||
<div class="fr"><el-button type="primary" @click="adds('one')" size="small" icon="el-icon-check">保存</el-button></div>
|
||||
|
||||
</el-breadcrumb>
|
||||
<el-form :model="one" ref="one" :rules="ruleOne" label-width="72px" class="editoneshi">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="分类" prop="typeid">
|
||||
<el-select v-model="one.typeid" placeholder="请选择分类" size="small">
|
||||
<el-option
|
||||
v-for="item in types"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label=" ">
|
||||
<el-button type="success" @click="addonecontent" size="small" icon="el-icon-plus" v-if="one.contents.length<18">添加内容</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
|
||||
<el-row class="clearfix">
|
||||
<el-col :span="12" v-for="(items,index) in one.contents" class="nrgldnrone">
|
||||
<el-form-item :prop="'contents.'+index+'.c'" :label="'内容'+(index+1)" :rules="[{required: true, message: '请输入内容', trigger: 'blur'},{ type: 'string', min: 20, message: '内容至少20字符', trigger: 'blur' }]">
|
||||
<el-input type="textarea" v-model="items.c" :placeholder="'请输入内容'+(index+1)"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-form>
|
||||
{include file="../application/admin/view/inc/foot.html" /}
|
||||
<script src="/model/admin/contentadds.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,67 @@
|
||||
{include file="../application/admin/view/inc/head.html" /}
|
||||
<el-breadcrumb separator="/">
|
||||
<el-breadcrumb-item><i class="el-icon-s-home"></i><a href="/okadmin">系统首页</a></el-breadcrumb-item>
|
||||
<el-breadcrumb-item>{$pagemodel}</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
<div class="clearfix pdtb10">
|
||||
<div class="fl">
|
||||
<el-button type="success" icon="el-icon-plus" size="mini" @click="edit(-1)">添加内容</el-button>
|
||||
<el-button type="warning" icon="el-icon-plus" size="mini" @click="edits">批量添加内容</el-button>
|
||||
</div>
|
||||
<div class="fr">共{{total}}条内容</div>
|
||||
</div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="80">ID</th><th width="120">分类</th><th>内容</th><th width="120">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(items,index) in lists">
|
||||
<td>{{items.id}}</td>
|
||||
<td>{{typeid2str(items.typeid)}}</td>
|
||||
<td>{{comm.reduceStr(items.content,60)}}...</td>
|
||||
<td>
|
||||
<el-button type="text" @click="edit(index)">修改</el-button>
|
||||
<el-button type="text" @click="del(index)">删除</el-button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="listtip" style="display:none;" v-show="isloading || lists.length<1">{{datatxt}}</div>
|
||||
|
||||
<el-dialog
|
||||
:title="ac.type=='add'?'添加内容':'修改内容'"
|
||||
:visible.sync="iseditshow"
|
||||
width="800px"
|
||||
:show-close="false"
|
||||
:close-on-press-escape="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div>
|
||||
<el-form ref="one" :model="one" :rules="oneRulue" label-width="60px">
|
||||
<el-form-item label="分类" prop="typeid">
|
||||
<el-select v-model="one.typeid" placeholder="请选择分类">
|
||||
<el-option
|
||||
v-for="item in types"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="内容" prop="content">
|
||||
<el-input type="textarea" rows="10" v-model="one.content"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="iseditshow = false" size="small">取 消</el-button>
|
||||
<el-button type="primary" @click="editSub('one')" size="small">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
{include file="../application/admin/view/inc/foot.html" /}
|
||||
<script src="/model/admin/contents.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,37 @@
|
||||
|
||||
</el-main>
|
||||
</el-container>
|
||||
</div>
|
||||
|
||||
|
||||
<el-dialog
|
||||
title="修改登录密码"
|
||||
:visible.sync="comm.uppassISshow"
|
||||
width="30%"
|
||||
>
|
||||
<div>
|
||||
<el-form :model="comm.uppassForm" ref="uppassForm" :rules="comm.rule_uppass" label-width="100px" status-icon label-position="left">
|
||||
<el-form-item label="原 密 码" prop="oldpass">
|
||||
<el-input type="text" v-model="comm.uppassForm.oldpass" autocomplete="off" prefix-icon="el-icon-unlock" placeholder="原密码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="新 密 码" prop="newpass">
|
||||
<el-input type="password" v-model="comm.uppassForm.newpass" autocomplete="off" show-password prefix-icon="el-icon-lock" placeholder="新密码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="重复新密码" prop="repass">
|
||||
<el-input type="password" v-model="comm.uppassForm.repass" autocomplete="off" show-password prefix-icon="el-icon-lock" placeholder="重复新密码"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="comm.uppassISshow = false">取 消</el-button>
|
||||
<el-button type="primary" @click="uppassSub('uppassForm')">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/static/vue/jquery-1.9.0.min.js"></script>
|
||||
<script src="/static/vue/vue.min.js"></script>
|
||||
<script src="/static/vue/comm.js"></script>
|
||||
<script src="/static/eleui/admin.js"></script>
|
||||
@@ -0,0 +1,61 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,minimum-scale=1.0" />
|
||||
<title>{$pagemodel}-{$Think.const.SITE_NAME}管理后台</title>
|
||||
<link rel="stylesheet" href="/static/eleui/index.css"/>
|
||||
<link rel="stylesheet" href="/static/eleui/diy.css"/>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" v-show="comm.pageloadcomplete" style="display: none;">
|
||||
<div class="el-container is-vertical">
|
||||
<header class="el-header" style="height: 60px;">
|
||||
<div class="clearfix">
|
||||
<div class="logo fl"><i class="el-icon-magic-stick fl"></i><span class="fl">{$Think.const.SITE_NAME}管理后台</span></div>
|
||||
<div class="fr" style="padding-top: 16px;">
|
||||
<el-dropdown trigger="click" @command="comm.topRcommandClick">
|
||||
<span class="el-dropdown-link">
|
||||
{$Think.session.adminName}<i class="el-icon-arrow-down el-icon--right"></i>
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item icon="el-icon-edit-outline" command="uppass">修改密码</el-dropdown-item>
|
||||
<el-dropdown-item icon="el-icon-right" command="loginout">安全退出</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<el-container>
|
||||
<el-aside width="240px" class="leftmenu">
|
||||
<el-menu
|
||||
class="el-menu-vertical-demo"
|
||||
@open="comm.handleOpen"
|
||||
@close="comm.handleClose"
|
||||
:default-active="menuActive"
|
||||
:default-openeds="menuAOpeneds"
|
||||
@select="comm.leftnavclick"
|
||||
>
|
||||
<el-submenu index="1">
|
||||
<template slot="title"><i class="el-icon-user"></i><span>会员管理</span></template>
|
||||
<el-menu-item index="101">会员列表</el-menu-item>
|
||||
<el-menu-item index="102">充值记录</el-menu-item>
|
||||
<el-menu-item index="103">统计报表</el-menu-item>
|
||||
</el-submenu>
|
||||
<el-submenu index="8">
|
||||
<template slot="title"><i class="el-icon-setting"></i><span>系统设置</span></template>
|
||||
<el-menu-item index="8001">地区管理</el-menu-item>
|
||||
<el-menu-item index="801">分类管理</el-menu-item>
|
||||
<el-menu-item index="802">内容管理</el-menu-item>
|
||||
<el-menu-item index="803">模板管理</el-menu-item>
|
||||
<el-menu-item index="8005">角色管理</el-menu-item>
|
||||
<el-menu-item index="8006">管理员管理</el-menu-item>
|
||||
<el-menu-item index="8004">系统设置</el-menu-item>
|
||||
</el-submenu>
|
||||
</el-menu>
|
||||
</el-aside>
|
||||
<el-main>
|
||||
|
||||
<!--head end -->
|
||||
@@ -0,0 +1,9 @@
|
||||
{include file="../application/tpl/admin/head.html" /}
|
||||
<div class="indexadminbox">
|
||||
<div class="systitle">{$Think.const.SITE_NAME}管理后台</div>
|
||||
<div class="time">{{comm.nowtimes}}</div>
|
||||
</div>
|
||||
{include file="../application/tpl/admin/foot.html" /}
|
||||
<script src="/model/admin/index.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,118 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>管理员登录_{$Think.const.SITE_NAME}</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-touch-fullscreen" content="yes">
|
||||
<link rel="stylesheet" href="/static/eleui/index.css"/>
|
||||
<link rel="stylesheet" href="/static/eleui/diy.css"/>
|
||||
</head>
|
||||
<body class="admin_login_body">
|
||||
<div id="app">
|
||||
<div class="admin_loginbox">
|
||||
<el-form :model="loginForm" ref="loginForm" :rules="rule_login" label-width="0" class="demo-ruleForm">
|
||||
<div class="cctit">管理员登录</div>
|
||||
<el-form-item label="" prop="a_name">
|
||||
<el-input type="text" v-model="loginForm.a_name" autocomplete="off" prefix-icon="el-icon-user" placeholder="登录账号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="" prop="pwd">
|
||||
<el-input type="password" v-model="loginForm.pwd" autocomplete="off" show-password prefix-icon="el-icon-lock" placeholder="登录密码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="" prop="codeimg">
|
||||
<el-col :span="12">
|
||||
<el-input type="text" v-model="loginForm.codeimg" autocomplete="off" prefix-icon="el-icon-check" placeholder="验证码"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="10" :offset="2">
|
||||
<img :src="captcha" class="admin_captcha" rel="admin_captcha" class="yzmimg" id="code" @click="getcode"/>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="" class="adminlogin_btnbox">
|
||||
<el-button type="primary" @click="loginGo" v-if="!isthislogin">登 录</el-button>
|
||||
<el-button type="primary" v-else>登 录</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="loginbtxt"></div>
|
||||
</div>
|
||||
<script src="/static/vue/jquery-1.9.0.min.js"></script>
|
||||
<script src="/static/vue/vue.min.js"></script>
|
||||
<script src="/static/eleui/admin.js"></script>
|
||||
<script src="/static/vue/comm.js"></script>
|
||||
<script>
|
||||
var app=new Vue({
|
||||
el:"#app",
|
||||
data:{
|
||||
loginForm:{
|
||||
a_name:'',
|
||||
pwd:'',
|
||||
codeimg:''
|
||||
},
|
||||
captcha:"/captcha/captcha",
|
||||
rule_login:{
|
||||
|
||||
},
|
||||
isthislogin:false
|
||||
},
|
||||
created: function() {
|
||||
var that=this;
|
||||
|
||||
},
|
||||
methods: {
|
||||
init:function(){
|
||||
|
||||
},
|
||||
loginGo:function(){
|
||||
this.isthislogin=true;
|
||||
var arg={
|
||||
"a_name":comm.sTrim(this.loginForm.a_name),
|
||||
"pwd":comm.sTrim(this.loginForm.pwd),
|
||||
"codeimg":comm.sTrim(this.loginForm.codeimg),
|
||||
}
|
||||
//adminlogin
|
||||
$.ajax({
|
||||
url: "/admin/admin/adminlogin",
|
||||
type: 'post',
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:JSON.stringify(arg),
|
||||
success: function(data) {
|
||||
this.$message.success("登录成功");
|
||||
setTimeout(function () {
|
||||
window.location.href="/admin/admin";
|
||||
}, 3000)
|
||||
}.bind(this),
|
||||
error:function(res){
|
||||
//this.$message.error(JSON.parse(res.responseText).msg);
|
||||
this.getcode();
|
||||
this.isthislogin=false;
|
||||
}.bind(this)
|
||||
})
|
||||
},
|
||||
getcode:function(){
|
||||
this.captcha="/captcha/captcha?t="+new Date().getTime();
|
||||
},
|
||||
searchdata:function(){
|
||||
var arg={
|
||||
cs:null
|
||||
}
|
||||
$.ajax({
|
||||
url: "/api/getlist",
|
||||
type: "get",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:arg,
|
||||
success: function(data) {
|
||||
//$(".datalist").append(data.data)
|
||||
|
||||
this.alllists=this.alllists.concat(data.data);
|
||||
}.bind(this)
|
||||
});
|
||||
},
|
||||
}
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,241 @@
|
||||
{include file="../application/admin/view/inc/head.html" /}
|
||||
<el-breadcrumb separator="/">
|
||||
<el-breadcrumb-item><i class="el-icon-s-home"></i><a href="/okadmin">系统首页</a></el-breadcrumb-item>
|
||||
<el-breadcrumb-item><a href="/okadmin/poems">古诗管理</a></el-breadcrumb-item>
|
||||
<el-breadcrumb-item>{$pagemodel}</el-breadcrumb-item>
|
||||
<div class="fr">
|
||||
<div class="fl"><el-input type="text" v-model="cai_id" size="mini" placeholder="目标ID"></el-input></div>
|
||||
<div class="fl"><el-button type="warning" size="mini" @click="caiji">采集</el-button></div>
|
||||
</div>
|
||||
</el-breadcrumb>
|
||||
<el-form :model="one" ref="one" :rules="ruleOne" label-width="72px" class="editoneshi">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="标题" prop="title">
|
||||
<el-input type="text" v-model="one.title" size="mini" placeholder="标题"></el-input>
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="朝代" prop="author">
|
||||
<el-select v-model="one.dynastyid" size="mini" placeholder="朝代">
|
||||
<el-option v-for="item in comm.chaodais" :value="item.value" :key="item.value" :label="item.label"></el-option>
|
||||
</select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="作者" prop="author">
|
||||
<el-input type="text" v-model="one.author" size="mini" placeholder="作者姓名"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="年级" prop="title">
|
||||
<el-cascader :options="comm.gradetypes" v-model="one.gradeTaID" placeholder="年级" size="mini" clearable></el-cascader>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="诗集" prop="title">
|
||||
<el-select v-model="one.groupid" size="mini" placeholder="诗集" clearable>
|
||||
<el-option v-for="item in comm.groupids" :value="item.value" :key="item.value" :label="item.label"></el-option>
|
||||
</select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="详情" prop="contents">
|
||||
<el-input type="textarea" v-model="one.contents" size="mini" placeholder="详情" rows="27"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="翻译" prop="yi">
|
||||
<el-input type="textarea" v-model="one.yi" size="mini" placeholder="翻译" rows="11"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="注释" prop="zhu">
|
||||
<el-input type="textarea" v-model="one.zhu" size="mini" placeholder="注释" rows="11"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="赏析" prop="shang">
|
||||
<el-input type="textarea" v-model="one.shang" size="mini" placeholder="赏析" rows="11"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" style="text-align: center;">
|
||||
<el-form-item label=" " prop="title">
|
||||
<el-button type="primary" @click="saveto">保存</el-button>
|
||||
<span style="padding:0 100px 0 0;"></span><el-button type="danger" @click="next({$id+1})">保存并下一首</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
{include file="../application/admin/view/inc/foot.html" /}
|
||||
<script>
|
||||
var app=new Vue({
|
||||
el:"#app",
|
||||
data:{
|
||||
menuActive:"101",
|
||||
menuAOpeneds:[],
|
||||
nowtimes:"23",
|
||||
one:{
|
||||
title:'',
|
||||
gradeTaID:[],//根据学段,年级重新组成数组
|
||||
gradetype:null,
|
||||
gradeid:null,
|
||||
dynastyid:null,
|
||||
dynasty:'',
|
||||
groupid:null,
|
||||
author:"",
|
||||
contents:"",
|
||||
remark1:"",
|
||||
remark2:"",
|
||||
remark2:"",
|
||||
yi:'[]',
|
||||
zhu:'[]',
|
||||
shang:'[]'
|
||||
},
|
||||
id:null,
|
||||
ruleOne:{
|
||||
title:[
|
||||
|
||||
]
|
||||
},
|
||||
cai_id:null
|
||||
},
|
||||
created: function() {
|
||||
var that=this;
|
||||
{if $id}
|
||||
this.id={$id};
|
||||
this.getone();
|
||||
{/if}
|
||||
},
|
||||
methods: {
|
||||
init:function(){
|
||||
|
||||
},
|
||||
getone:function(){
|
||||
$.ajax({
|
||||
url: "/okadmin/oneshi?id="+{$id},
|
||||
type: "get",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:"",
|
||||
success: function(data) {
|
||||
this.one=data.data;
|
||||
if(!this.one.yi)this.one.yi='[]';
|
||||
if(!this.one.zhu)this.one.zhu='[]';
|
||||
if(!this.one.shang)this.one.shang='[]';
|
||||
//console.log(JSON.stringify(data.data))
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
|
||||
}.bind(this)
|
||||
});
|
||||
},
|
||||
caiji:function(){
|
||||
$.ajax({
|
||||
url: "/okadmin/caiji?id="+this.cai_id,
|
||||
type: "get",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:"",
|
||||
success: function(data) {
|
||||
this.one.yi=JSON.stringify(data.yi);
|
||||
this.one.zhu=JSON.stringify(data.zhu);
|
||||
this.one.shang=JSON.stringify(data.shang);
|
||||
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
|
||||
}.bind(this)
|
||||
});
|
||||
},
|
||||
next:function(id){
|
||||
if(id){
|
||||
$.ajax({
|
||||
url: "/okadmin/saveshi?id="+this.id,
|
||||
type: "patch",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:JSON.stringify(this.one),
|
||||
success: function(data) {
|
||||
this.$message.success("修改成功");
|
||||
$.ajax({
|
||||
url: "/okadmin/getnext?id="+this.id,
|
||||
type: "get",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:"",
|
||||
success: function(data) {
|
||||
window.location.href="/okadmin/poetry/"+data.id;
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
|
||||
}.bind(this)
|
||||
});
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
|
||||
}.bind(this)
|
||||
});
|
||||
}else{
|
||||
|
||||
}
|
||||
},
|
||||
saveto:function(){
|
||||
var id=this.id;
|
||||
if(id){
|
||||
$.ajax({
|
||||
url: "/okadmin/saveshi?id="+this.id,
|
||||
type: "patch",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:JSON.stringify(this.one),
|
||||
success: function(data) {
|
||||
this.$message.success("修改成功");
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
|
||||
}.bind(this)
|
||||
});
|
||||
}else{
|
||||
|
||||
}
|
||||
},
|
||||
uppassSub:function(formName){
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
var old=comm.sTrim(comm.uppassForm.oldpass)
|
||||
var newp=comm.sTrim(comm.uppassForm.newpass)
|
||||
var renewp=comm.sTrim(comm.uppassForm.repass)
|
||||
var query={
|
||||
password:old,
|
||||
newPassword:newp
|
||||
};
|
||||
$.ajax({
|
||||
url: "/okadmin/uppass",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data:JSON.stringify(query),
|
||||
success: function(data) {
|
||||
comm.uppassForm.newpass="";
|
||||
comm.uppassForm.oldpass="";
|
||||
comm.uppassForm.renewpass="";
|
||||
comm.uppassForm=false;
|
||||
this.$message.success("密码修改成功。请使用新密码重新登录!");
|
||||
setTimeout(function () {
|
||||
window.location.href="/okadmin/loginout";
|
||||
}, 3000)
|
||||
}.bind(this),
|
||||
error:function(err){
|
||||
this.$message.error(JSON.parse(err.responseText).msg);
|
||||
}.bind(this)
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,51 @@
|
||||
{include file="../application/tpl/admin/head.html" /}
|
||||
<el-breadcrumb separator="/">
|
||||
<el-breadcrumb-item><i class="el-icon-s-home"></i><a href="/okadmin">系统首页</a></el-breadcrumb-item>
|
||||
<el-breadcrumb-item>{$pagemodel}</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
<div class="clearfix pdtb10">
|
||||
<div class="fl">
|
||||
<el-button type="success" icon="el-icon-plus" size="mini" @click="edit(-1)">添加顶级地区</el-button>
|
||||
</div>
|
||||
<div class="fr">
|
||||
<el-button type="warning" plain size="mini" @click="getlist" icon="el-icon-search">刷新</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr><th width="180">顶级地区</th><th>二级地区</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(items,index) in lists">
|
||||
<td>{{items.initials}} {{items.title}}</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="listtip" style="display:none;" v-show="isloading || lists.length<1">{{datatxt}}</div>
|
||||
|
||||
<el-dialog
|
||||
:title="edittitle"
|
||||
:visible.sync="iseditshow"
|
||||
width="400px"
|
||||
:show-close="false"
|
||||
:close-on-press-escape="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div>
|
||||
<el-form ref="one" :model="one" :rules="oneRulue" label-width="80px">
|
||||
<el-form-item label="地区名称" prop="title">
|
||||
<el-input v-model.trim="one.title" placeholder="地区名称"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="iseditshow = false" size="small">取 消</el-button>
|
||||
<el-button type="primary" @click="editSub('one')" size="small">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
{include file="../application/tpl/admin/foot.html" /}
|
||||
<script src="/model/admin/regions.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,73 @@
|
||||
{include file="../application/tpl/admin/head.html" /}
|
||||
<el-breadcrumb separator="/">
|
||||
<el-breadcrumb-item><i class="el-icon-s-home"></i><a href="/okadmin">系统首页</a></el-breadcrumb-item>
|
||||
<el-breadcrumb-item>{$pagemodel}</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
<div class="clearfix pdtb10">
|
||||
<div class="fl">
|
||||
<el-button type="success" icon="el-icon-plus" size="mini" @click="edit()">新增角色</el-button>
|
||||
</div>
|
||||
<div class="fr">
|
||||
<el-button type="warning" plain size="mini" @click="getlist" icon="el-icon-search">刷新</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr><th width="200">角色名称</th><th>描述</th><th width="48">系统</th><th width="150">操作</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(items,index) in lists">
|
||||
<td>{{items.name}}</td>
|
||||
<td>{{items.desc}}</td>
|
||||
<td>
|
||||
<span v-if="items.issys">是</span><span v-else>-</span>
|
||||
</td>
|
||||
<td>
|
||||
<el-button type="text" @click="edit(index,'v')">查看</el-button>
|
||||
<el-button type="text" @click="edit(index)" v-if="!items.issys">修改</el-button>
|
||||
<el-button type="text" @click="del(index)" v-if="!items.issys">删除</el-button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="listtip" style="display:none;" v-show="isloading || lists.length<1">{{datatxt}}</div>
|
||||
|
||||
<el-dialog
|
||||
:title="edittitle"
|
||||
:visible.sync="iseditshow"
|
||||
width="800px"
|
||||
:show-close="false"
|
||||
:close-on-press-escape="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div>
|
||||
<el-form ref="one" :model="one" :rules="oneRulue" label-width="80px">
|
||||
<el-form-item label="角色名称" prop="name">
|
||||
<el-input v-model.trim="one.name" placeholder="角色名称" :disabled="isedit"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="角色描述" prop="desc">
|
||||
<el-input type="textarea" v-model.trim="one.desc" placeholder="角色描述" :disabled="isedit"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="权限" prop="permissions">
|
||||
<div class="qxselboxs">
|
||||
<div class="li" v-for="(items,index) in permissions">
|
||||
<b class="name1">{{items.name}}</b>
|
||||
<div class="u2 clearfix" v-if="items.item.length">
|
||||
<div class="li2" :class="comm.isArrayCon(selpss,items2.id)?'cur':''" :disabled="isedit" v-for="(items2,index2) in items.item" @click="isedit?'':selAp(items2.id)">{{items2.name}}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="iseditshow = false" size="small"><span v-if="isedit">关 闭</span><span v-else>取 消</span></el-button>
|
||||
<el-button type="primary" @click="editSub('one')" size="small" v-if="!isedit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
{include file="../application/tpl/admin/foot.html" /}
|
||||
<script src="/model/admin/roles.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,75 @@
|
||||
{include file="../application/tpl/admin/head.html" /}
|
||||
<el-breadcrumb separator="/">
|
||||
<el-breadcrumb-item><i class="el-icon-s-home"></i><a href="/okadmin">系统首页</a></el-breadcrumb-item>
|
||||
<el-breadcrumb-item>{$pagemodel}</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
<el-form :model="one" ref="one" :rules="ruleOne" label-width="150px" class="editoneshi">
|
||||
<el-row class="clearfix">
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="8">
|
||||
<el-form-item prop="sitename" label="系统名称">
|
||||
<el-input v-model.trim="one.sitename" placeholder="请输入系统名称"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="8">
|
||||
<el-form-item prop="domain_name" label="官方网址">
|
||||
<el-input v-model.trim="one.domain_name" placeholder="请输入官方网址"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="8">
|
||||
<el-form-item prop="kf_weixin" label="客服微信号">
|
||||
<el-input v-model.trim="one.kf_weixin" placeholder="请输入客服微信号"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="8">
|
||||
<el-form-item prop="kf_qq" label="客服QQ">
|
||||
<el-input v-model.trim="one.kf_qq" placeholder="请输入客服QQ"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="8">
|
||||
<el-form-item prop="kf_400" label="400热线">
|
||||
<el-input v-model.trim="one.kf_400" placeholder="请输入400热线"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="8">
|
||||
<el-form-item prop="kf_wxcode" label="微信客服二维码">
|
||||
<el-upload
|
||||
class="upload-demo"
|
||||
action="/okadmin/wxcodeup"
|
||||
:on-success="upok"
|
||||
:before-upload="beforeAvatarUpload"
|
||||
:show-file-list="false">
|
||||
<div style="position:relative;" v-if="one.kf_wxcode">
|
||||
<img :src="one.kf_wxcode" width="128" height="128" style="display:block;padding:4px;border:1px solid #e4e4e4;">
|
||||
<span style="position:absolute;bottom:0;left:0;right:0;background:rgba(0,0,0,.4);color:#fff;text-align:center;height:30px;line-height:30px;">更改</span>
|
||||
</div>
|
||||
<el-button size="small" type="warning" v-else>上传</el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="8">
|
||||
<el-form-item prop="client_name" label="客户端名称">
|
||||
<el-input type="textarea" v-model.trim="one.client_name" placeholder="请输入客户端名称。客户端title"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="8">
|
||||
<el-form-item prop="site_keyword" label="网站关键词">
|
||||
<el-input type="textarea" v-model.trim="one.site_keyword" placeholder="请输入网站关键词"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="8">
|
||||
<el-form-item prop="site_desc" label="网站描述">
|
||||
<el-input type="textarea" v-model.trim="one.site_desc" placeholder="请输入网站描述"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="text-align:center;padding:20px;">
|
||||
<el-button type="primary" @click="adds('one')" size="small" icon="el-icon-check">保存</el-button>
|
||||
</div>
|
||||
|
||||
</el-form>
|
||||
{include file="../application/tpl/admin/foot.html" /}
|
||||
<script src="/model/admin/syssetting.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,85 @@
|
||||
{include file="../application/admin/view/inc/head.html" /}
|
||||
<div class="mainconbox">
|
||||
<div class="Breadcrumbs">
|
||||
<span class="ico fa fa-home"></span><a href="/okadmin">系统首页</a><i class="i fa fa-angle-right"></i><span class="active">系统设置</span>
|
||||
</div>
|
||||
<!--面包屑 END -->
|
||||
<!--数据加载中的样式<div class="loadingbox"></div> -->
|
||||
<div class="col-sm-12 clearfix">
|
||||
<!--面包屑 -->
|
||||
|
||||
<!--面包屑 END -->
|
||||
<!--数据加载中的样式<div class="loadingbox"></div> -->
|
||||
<div class="qc8"></div>
|
||||
<div class="lmtab">
|
||||
<div class="f-l txt">基本设置</div>
|
||||
<div class="qc"></div>
|
||||
</div>
|
||||
<div class="qc8"></div>
|
||||
<div class="col-sm-12">
|
||||
<div class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-1 control-label no-padding-right"><span class="red">*</span>网站名称</label>
|
||||
<div class="col-sm-2"><input name="site_name" type="text" class="form-control" id="site_name" value="{$site_name}"></div>
|
||||
<label class="col-sm-1 control-label no-padding-right">域名</label>
|
||||
<div class="col-sm-2"><input name="domain_name" type="text" class="form-control" id="domain_name" value="{$domain_name}"></div>
|
||||
<label class="col-sm-1 control-label no-padding-right"><span class="red">*</span>预约收费</label>
|
||||
<div class="col-sm-2">
|
||||
<div class="input-group">
|
||||
<input name="yuyuefee" type="text" class="form-control" id="yuyuefee" value="{$yuyuefee}">
|
||||
<span class="input-group-addon">元 / 次</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="qc8"></div>
|
||||
|
||||
<div class="qc8"></div>
|
||||
|
||||
|
||||
<div class="h-20"></div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-12" style="text-align: center;">
|
||||
<a href="javascript:;" class="btn btn-info" type="button" onclick="saveok();"><i class="fa fa-save"></i> 保 存</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- -->
|
||||
|
||||
<script>topnavid="1";tonavjs();l_navid="1";lenavjs();/*头部,左部菜单选中样式*/</script>
|
||||
<script>
|
||||
function saveok(){
|
||||
|
||||
var arg={
|
||||
|
||||
"site_name":trim($("#site_name").val()),
|
||||
"domain_name":trim($("#domain_name").val()),
|
||||
"yuyuefee":trim($("#yuyuefee").val()),
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: "/okadmin/systemup",
|
||||
type: "put",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify(arg),
|
||||
success: function(data) {
|
||||
diytipshow('ok',data.msg);
|
||||
},error:function(err){
|
||||
diytipshow('err',JSON.parse(err.responseText).msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,71 @@
|
||||
{include file="../application/admin/view/inc/head.html" /}
|
||||
<el-breadcrumb separator="/">
|
||||
<el-breadcrumb-item><i class="el-icon-s-home"></i><a href="/okadmin">系统首页</a></el-breadcrumb-item>
|
||||
<el-breadcrumb-item>{$pagemodel}</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
<div class="clearfix pdtb10">
|
||||
<div class="fl">
|
||||
<el-button type="success" icon="el-icon-plus" size="mini" @click="edit(-1)">添加模板</el-button>
|
||||
</div>
|
||||
<div class="fr">共{{total}}个模板</div>
|
||||
</div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="80">ID</th><th>模板名称</th><th>描述</th><th width="120">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(items,index) in lists">
|
||||
<td>{{items.id}}</td>
|
||||
<td>{{items.name}}</td>
|
||||
<td>{{items.dec}}</td>
|
||||
<td>
|
||||
<el-button type="text" @click="yulan(index)">预览</el-button>
|
||||
<el-button type="text" @click="del(index)">删除</el-button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="listtip" style="display:none;" v-show="isloading || lists.length<1">{{datatxt}}</div>
|
||||
|
||||
<el-dialog
|
||||
:title="ac.type=='add'?'添加模板':'修改模板'"
|
||||
:visible.sync="iseditshow"
|
||||
width="800px"
|
||||
:show-close="false"
|
||||
:close-on-press-escape="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div>
|
||||
<el-form ref="one" :model="one" :rules="oneRulue" label-width="80px">
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="one.name"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="模板" prop="file">
|
||||
<el-input v-model="one.file" id="onefile" readonly placeholder="点击上传模板" @click="fileClick"></el-input>
|
||||
<el-upload
|
||||
class="upload-demo"
|
||||
action="/okadmin/templateupload"
|
||||
:on-success="upok"
|
||||
:before-upload="beforeAvatarUpload"
|
||||
|
||||
:show-file-list="false">
|
||||
<el-button size="small" type="primary">点击上传HTML文件</el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="dec">
|
||||
<el-input type="textarea" rows="4" v-model="one.dec"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="iseditshow = false" size="small">取 消</el-button>
|
||||
<el-button type="primary" @click="editSub('one')" size="small">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
{include file="../application/admin/view/inc/foot.html" /}
|
||||
<script src="/model/admin/templates.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,49 @@
|
||||
{include file="../application/admin/view/inc/head.html" /}
|
||||
<el-breadcrumb separator="/">
|
||||
<el-breadcrumb-item><i class="el-icon-s-home"></i><a href="/okadmin">系统首页</a></el-breadcrumb-item>
|
||||
<el-breadcrumb-item>{$pagemodel}</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
<div class="clearfix pdtb10">
|
||||
<div class="fl">
|
||||
<el-button type="success" icon="el-icon-plus" size="mini" @click="edit(-1)">添加分类</el-button>
|
||||
</div>
|
||||
<div class="fr">
|
||||
<el-button type="warning" plain size="mini" @click="getlist" icon="el-icon-search">刷新</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix typelistbox">
|
||||
<div class="li" v-for="(items,index) in lists">
|
||||
<span>{{items.name}}</span>
|
||||
<i class="el-icon-edit" @click="edit(index)"></i><i class="el-icon-error" @click="del(index)"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="listtip" style="display:none;" v-show="isloading || lists.length<1">{{datatxt}}</div>
|
||||
|
||||
<el-dialog
|
||||
:title="ac.type=='add'?'添加分类':'修改分类'"
|
||||
:visible.sync="iseditshow"
|
||||
width="400px"
|
||||
:show-close="false"
|
||||
:close-on-press-escape="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div>
|
||||
<el-form ref="one" :model="one" :rules="oneRulue" label-width="80px">
|
||||
<el-form-item label="分类名称" prop="name">
|
||||
<el-input v-model="one.name"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="px">
|
||||
<el-input-number v-model="one.px" controls-position="right" :min="1" :max="99999"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="iseditshow = false" size="small">取 消</el-button>
|
||||
<el-button type="primary" @click="editSub('one')" size="small">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
{include file="../application/admin/view/inc/foot.html" /}
|
||||
<script src="/model/admin/types.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,11 @@
|
||||
{include file="../application/admin/view/inc/head.html" /}
|
||||
<el-breadcrumb separator="/">
|
||||
<el-breadcrumb-item><i class="el-icon-s-home"></i><a href="/okadmin">系统首页</a></el-breadcrumb-item>
|
||||
<el-breadcrumb-item><a href="/okadmin/poems">古诗管理</a></el-breadcrumb-item>
|
||||
<el-breadcrumb-item>古诗管理</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
|
||||
{include file="../application/admin/view/inc/foot.html" /}
|
||||
<script src="/model/admin/poetry.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,37 @@
|
||||
|
||||
</el-main>
|
||||
</el-container>
|
||||
</el-container>
|
||||
|
||||
|
||||
<el-dialog
|
||||
title="修改登录密码"
|
||||
:visible.sync="comm.uppassISshow"
|
||||
width="30%"
|
||||
>
|
||||
<div>
|
||||
<el-form :model="comm.uppassForm" ref="uppassForm" :rules="comm.rule_uppass" label-width="100px" status-icon label-position="left">
|
||||
<el-form-item label="原 密 码" prop="oldpass">
|
||||
<el-input type="text" v-model="comm.uppassForm.oldpass" autocomplete="off" prefix-icon="el-icon-unlock" placeholder="原密码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="新 密 码" prop="newpass">
|
||||
<el-input type="password" v-model="comm.uppassForm.newpass" autocomplete="off" show-password prefix-icon="el-icon-lock" placeholder="新密码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="重复新密码" prop="repass">
|
||||
<el-input type="password" v-model="comm.uppassForm.repass" autocomplete="off" show-password prefix-icon="el-icon-lock" placeholder="重复新密码"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="comm.uppassISshow = false">取 消</el-button>
|
||||
<el-button type="primary" @click="uppassSub('uppassForm')">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/static/vue/jquery-1.9.0.min.js"></script>
|
||||
<script src="/static/vue/vue.min.js"></script>
|
||||
<script src="/static/vue/member.js"></script>
|
||||
<script src="/static/eleui/index.js"></script>
|
||||
@@ -0,0 +1,54 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,minimum-scale=1.0" />
|
||||
<title>{$pagemodel}-{$Think.const.SITE_NAME}</title>
|
||||
<link rel="stylesheet" href="/static/eleui/index.css"/>
|
||||
<link rel="stylesheet" href="/static/eleui/member.css"/>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
<el-container v-show="comm.pageloadcomplete" style="display: none;">
|
||||
<el-header>
|
||||
<div class="clearfix">
|
||||
<div class="logo fl"></div>
|
||||
<div class="fr" style="padding-top: 16px;">
|
||||
<el-dropdown trigger="click" @command="comm.topRcommandClick">
|
||||
<span class="el-dropdown-link">
|
||||
{$Think.session.uemail}<i class="el-icon-arrow-down el-icon--right"></i>
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item icon="el-icon-edit-outline" command="uppass">修改密码</el-dropdown-item>
|
||||
<el-dropdown-item icon="el-icon-right" command="loginout">安全退出</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-container>
|
||||
<el-aside width="240px" class="leftmenu">
|
||||
<el-menu
|
||||
class="el-menu-vertical-demo"
|
||||
@open="comm.handleOpen"
|
||||
@close="comm.handleClose"
|
||||
:default-active="menuActive"
|
||||
:default-openeds="menuAOpeneds"
|
||||
@select="comm.leftnavclick"
|
||||
>
|
||||
<el-submenu index="1">
|
||||
<template slot="title"><i class="el-icon-finished"></i><span>批量生成HTML</span></template>
|
||||
<el-menu-item index="101">创建任务</el-menu-item>
|
||||
<el-menu-item index="102">任务进度</el-menu-item>
|
||||
</el-submenu>
|
||||
<el-submenu index="8">
|
||||
<template slot="title"><i class="el-icon-user"></i><span>账号中心</span></template>
|
||||
<el-menu-item index="801">个人资料</el-menu-item>
|
||||
<el-menu-item index="802">修改密码</el-menu-item>
|
||||
</el-submenu>
|
||||
</el-menu>
|
||||
</el-aside>
|
||||
<el-main>
|
||||
<!--head end -->
|
||||
Reference in New Issue
Block a user