Home > php教程 > php手册 > weiphp新增模块自动跳转至登陆页面的解决办法

weiphp新增模块自动跳转至登陆页面的解决办法

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 11:41:25
Original
890 people have browsed it

如题,weiphp对thinkphp和onethink的内核做了修改,导致我们使用普通方式不能够正常开发
第一种方式完全摆脱weiphp的操作,下载tp最新版本 找到thinkphp/library/think/controller.class.php复制到 项目app_path目录下的libs/system目录下
修改命名空间 和use namespace Libs\System;<br> use Think\Think;<br> use Think\Hook;这样就可用了。当然必须在config中增加自动导入命名空间配置    /* 命名空间 */<br>     'AUTOLOAD_NAMESPACE' => array(<br>         'Addons' => APP_PATH . '/../Addons',<br>         'Libs' => APP_PATH . '/Libs',<br>     ),第二种方法
修改weiphp项目下thinkphp/library/think/control.class.php 第117行
增加$index_1=='{你的模块名称}/*/*' 到&&上
具体参考可见http://typecho.hainuo.info/archives/weiphp-new-module.html 在这里的时候需要在模块的配置文件中增加
cookie和session相关的配置。    /* SESSION 和 COOKIE 配置 */<br>     'SESSION_PREFIX' => 'weiphp_home', //session前缀<br>     'COOKIE_PREFIX'  => 'weiphp_home_', // Cookie前缀 避免冲突<br>     'VAR_SESSION_ID' => 'session_id',    //修复uploadify插件无法传递session_id的bug

如果 有不懂的可以留言。。。

AD:真正免费,域名+虚机+企业邮箱=0元

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template