Commit 34e6378e240e527c1b91b1cd9b959222d92b6646

Authored by zhang
1 parent 121ad85a

[留言板]模块登录功能

logs/vcy_oa_error.log 0 → 100644
trunk/Message/Api/Controller/AbstractController.class.php
... ... @@ -11,5 +11,5 @@ use \Common\Controller\Api\AbstractController as BaseAbstractController;
11 11  
12 12 abstract class AbstractController extends BaseAbstractController
13 13 {
14   -
15   -}
16 14 \ No newline at end of file
  15 +
  16 +}
... ...
trunk/Message/Api/Controller/Person/LoginController.class.php 0 → 100644
  1 +<?php
  2 +namespace Api\Controller\Person;
  3 +
  4 +use Api\Controller\AbstractController;
  5 +use Common\Model\PersonModel;
  6 +
  7 +class LoginController extends AbstractController
  8 +{
  9 + /**
  10 + * 不强制指定系统登录
  11 + */
  12 + protected $_require_login = false;
  13 +
  14 + /**
  15 + * 留言板模块|用户登录
  16 + * @author <362431947@qq.com>
  17 + * @date 2018-10-09
  18 + */
  19 + public function Login_post()
  20 + {
  21 + $input = I('post.');
  22 +
  23 + if(! $input){
  24 + E('_ERR_POST_EMPTY');
  25 + }
  26 +
  27 + $name = $input['name'];
  28 + $pwd = $input['pwd'];
  29 +
  30 + if(! $name || ! $pwd){
  31 + E('_ERROR_LOGIN_EMPTY');
  32 + }
  33 +
  34 + $conds = [
  35 + 'name'=>$name,
  36 + 'pwd' =>md5($pwd),
  37 + ];
  38 +
  39 + $m_person = new PersonModel();
  40 + $user_info = $m_person->getUserByConds($conds);
  41 +
  42 +
  43 + $auth_login = false;
  44 + if($user_info){
  45 + $user_info ? session('user_info',$user_info) : session('user_info',$user_info);
  46 + $auth_login = true;
  47 + }
  48 +
  49 + $this->_result = $auth_login;
  50 + }
  51 +}
... ...
trunk/Message/Api/Lang/zh-cn.php 0 → 100644
  1 +<?php
  2 +return [
  3 + '_ERR_POST_EMPTY' => '2018001:提交数据为空',
  4 + '_ERROR_PERSON_EMPTY' => '2018002:姓名为空',
  5 + '_ERROR_PERSON_NAME_LENGTH' => '2018003:姓名不能大于15个字符',
  6 + '_ERROR_LOGIN_EMPTY' => '2018004:登录信息错误',
  7 +
  8 + '_ERROR_TITLE_EMPTY' => '2018005:标题为空',
  9 + '_ERROR_MESSAGE_TITLE_LENGTH'=> '2018006:标题长度不能大于80个字符',
  10 + '_ERROR_MESSAGE_EMPTY' => '2018007:内容为空',
  11 + '_ERROR_MESSAGE_LENGTH' => '2018007:内容长度不能大于500个字符',
  12 + '_ERR_ID_EMPTY' => '2091003:id为空',
  13 +];
... ...
trunk/Message/Common/Cli/Index.php 0 → 100644
  1 +<?php
  2 +// +----------------------------------------------------------------------
  3 +// | ThinkPHP [ WE CAN DO IT JUST THINK ]
  4 +// +----------------------------------------------------------------------
  5 +// | Copyright (c) 2006-2014 http://thinkphp.cn All rights reserved.
  6 +// +----------------------------------------------------------------------
  7 +// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8 +// +----------------------------------------------------------------------
  9 +// | Author: liu21st <liu21st@gmail.com>
  10 +// +----------------------------------------------------------------------
  11 +
  12 +/**
  13 + * 使用方式:
  14 + * /usr/local/php/bin/php -q /data/wwwroot/yuanquan.vchangyi.com/Exam/Common/Cli/Index.php /Frontend/Temp/UpdateNewData/
  15 + */
  16 +
  17 +// 应用入口文件
  18 +
  19 +// 检测PHP环境
  20 +if (version_compare(PHP_VERSION, '5.4.0', '<')) {
  21 + die('require PHP > 5.4.0 !');
  22 +}
  23 +
  24 +// 开启调试模式 建议开发阶段开启 部署阶段注释或者设为false
  25 +define('APP_DEBUG', true);
  26 +// 目录分隔符号
  27 +define('D_S', DIRECTORY_SEPARATOR);
  28 +
  29 +$path = isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1] : '';
  30 +if (! empty($path)) {
  31 + $params = explode(D_S, trim($path, D_S));
  32 +}
  33 +
  34 +// 获取控制器
  35 +$controller = array_shift($params);
  36 +$action = array_shift($params);
  37 +// 绑定控制器
  38 +$_GET['c'] = $controller = $controller . D_S . $action;
  39 +
  40 +// 解析剩余参数, 并采用 GET 方式获取
  41 +$params_ct = count($params);
  42 +for ($i = 1; $i + 1 < $params_ct; $i += 2) {
  43 + $_GET[$params[$i]] = $params[$i + 1];
  44 +}
  45 +
  46 +// 框架目录
  47 +define('THINK_PATH', dirname(dirname(dirname(dirname(dirname(__FILE__))))) . '/' . $_SERVER['argv'][2] . '/ThinkPHP/');
  48 +// 企业标识
  49 +define('QY_DOMAIN', 'comm');
  50 +// 代码根目录路径
  51 +define('CODE_ROOT', dirname(dirname(dirname(__DIR__))));
  52 +// 应用
  53 +$pathArr = explode('/', __DIR__);
  54 +$identifier = array_slice($pathArr, -3, 1)[0];
  55 +// 自定义公共的应用标识符
  56 +$identiferConfigFile = THINK_PATH . 'Conf' . D_S . 'identifier.php';
  57 +if (is_file($identiferConfigFile)) {
  58 + $identifierConfig = include($identiferConfigFile);
  59 + $configId = $identifierConfig['app'][strtolower($identifier)];
  60 + if (!empty($configId)) {
  61 + define('APP_IDENTIFIER', $configId);
  62 + }
  63 + unset($identifierConfig);
  64 +}
  65 +defined('APP_IDENTIFIER') or define('APP_IDENTIFIER', $identifier);
  66 +// 定义应用目录
  67 +define('APP_PATH', dirname(dirname(dirname(dirname(dirname(__FILE__))))) . '/' . $_SERVER['argv'][2] . '/' . $identifier . D_S);
  68 +// 当前请求的应用路径
  69 +define('PLUGIN_PATH', CODE_ROOT . D_S . ucfirst($identifier) . D_S);
  70 +
  71 +$_SERVER['HTTP_HOST'] = '127.0.0.1';
  72 +$_SERVER['CY_REQUEST_URI'] = D_S . QY_DOMAIN . D_S . $identifier . $_SERVER['argv'][1];
  73 +
  74 +// 引入ThinkPHP入口文件
  75 +set_time_limit(0);
  76 +require THINK_PATH . 'ThinkPHP.php';
  77 +
  78 +// 亲^_^ 后面不需要任何代码了 就是如此简单
... ...
trunk/Message/Common/Common/Constant.php 0 → 100644
  1 +<?php
  2 +
  3 +namespace Common\Common;
  4 +
  5 +class Constant
  6 +{
  7 + /**
  8 + * 分页:默认页数
  9 + */
  10 + const PAGING_DEFAULT_PAGE = 1;
  11 +
  12 + /**
  13 + * 分页:默认当前页数据总数
  14 + */
  15 + const PAGING_DEFAULT_LIMIT = 20;
  16 +
  17 + /**
  18 + * 图片上传大小
  19 + */
  20 + const UPLOAD_IMAGE_SIZE_AAA = 2000;
  21 +}
... ...
trunk/Message/Common/Lang/zh-cn.php 0 → 100644
  1 +<?php
  2 +return [
  3 + 'COPYRIGHT' => 'copyright@2014畅移',
  4 + '_FAILED_TITLE' => '访问失败',
  5 +];
... ...
trunk/Message/Common/Model/PersonModel.class.php 0 → 100644
  1 +<?php
  2 +namespace Common\Model;
  3 +
  4 +class PersonModel extends AbstractModel
  5 +{
  6 + /**
  7 + * 构造方法
  8 + * @author <362431947@qq.com>
  9 + * @date 2018-10-09
  10 + */
  11 + public function __construct()
  12 + {
  13 + parent::__construct();
  14 + }
  15 +
  16 + /**
  17 + * 更加条件数据获取用户信息
  18 + * @author <362431947@qq.com>
  19 + * @date 2018-10-09
  20 + * @param array $conds 条件数组
  21 + * @return array
  22 + */
  23 + public function getUserByConds($conds = [],$fields = '*')
  24 + {
  25 + $params = [];
  26 +
  27 + if (!$this->_parse_where($wheres, $params, $conds)) {
  28 + return false;
  29 + }
  30 +
  31 + $sql = "SELECT $fields FROM __TABLE__ WHERE `name` = ? AND `pwd` = ? ";
  32 +
  33 + return $this->_m->fetch_row($sql, $params);
  34 + }
  35 +}
... ...
trunk/Message/Common/Sql/data.php 0 → 100644
  1 +<?php
  2 +/**
  3 + * 应用安装时的初始数据文件
  4 + * @var [type]
  5 + */
  6 +return "";
... ...
trunk/Message/attachment/2018/10/message5bbc83c12739f1.59683518.png 0 → 100644

407 Bytes

trunk/Message/attachment/2018/10/message5bbc85846896d9.81984943.png 0 → 100644

407 Bytes

trunk/ThinkPHP/Conf/convention.php
... ... @@ -103,7 +103,8 @@ return array(
103 103  
104 104 // Cookie设置
105 105 'COOKIE_EXPIRE' => 1800, // Cookie有效期
106   - 'COOKIE_DOMAIN' => 'pg.ma', // Cookie有效域名
  106 + 'COOKIE_DOMAIN' => 'localhost.vchangyi.org', // Cookie有效域名
  107 +// 'COOKIE_DOMAIN' => 'pg.ma', // Cookie有效域名
107 108 'COOKIE_PATH' => '/', // Cookie路径
108 109 'COOKIE_PREFIX' => 'YQ', // Cookie前缀 避免冲突
109 110 'COOKIE_SECURE' => false, // Cookie安全传输
... ...