随笔分类 -  ThinkPHP

摘要:1.Auth类文件引入 2.写一个公共类AuthInfo,所有要权限认证的类都继承此公共类AuthInfo class AuthInfo extends Controller{ protected function _initialize(){ if(!session("?intel_uid")){ 阅读全文
posted @ 2018-05-16 15:16 张忠冉 阅读(568) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2017-06-08 16:13 张忠冉 阅读(3) 评论(0) 推荐(0)
摘要:<?phpdefine('BIND_MODULE','Admin');define('APP_DEBUG',True);define('APP_PATH','./Application/');require './ThinkPHP/ThinkPHP.php'; 阅读全文
posted @ 2017-05-09 10:35 张忠冉 阅读(2714) 评论(0) 推荐(0)
摘要:define('BIND_MODULE','Admin');//生成admin模块后关闭//define('BUILD_MODEL_LIST','User,Menu');define('APP_PATH','./Application/');require './ThinkPHP/ThinkPHP. 阅读全文
posted @ 2017-03-09 10:53 张忠冉 阅读(596) 评论(0) 推荐(0)
摘要:public function _initialize(){ if(!$_SESSION['username']){ $this->error('请先登录',U('Admin/Login/index')); } } ​​​​ 阅读全文
posted @ 2017-03-09 10:52 张忠冉 阅读(657) 评论(0) 推荐(0)
摘要:修改TP里的session相当简单,TP也为我们考虑到了! 仅需要在项目配置文件里面加上: 'SESSION_OPTIONS' => array('path'=>'D:/thinkphp/sessions/') 也可以修改在php.ini里的配置session.save_path是注释掉的,那么Se 阅读全文
posted @ 2017-03-09 10:47 张忠冉 阅读(608) 评论(0) 推荐(0)
摘要:public function upload(){ $upload = new \Think\Upload();// 实例化上传类 $upload->maxSize = 3145728 ;// 设置附件上传大小 $upload->exts = array('jpg', 'gif', 'png', ' 阅读全文
posted @ 2017-03-09 10:23 张忠冉 阅读(2312) 评论(0) 推荐(0)