framework icon indicating copy to clipboard operation
framework copied to clipboard

TP6下 验证码扩展库用不了(Session问题)

Open liuxiaojinla opened this issue 7 years ago • 12 comments

TP6下 验证码扩展库用不了(Session问题) : 主要原因: 因为扩展库里面直接输出图片并终止后续程序执行,造成了中间件end方法没有回调 ,从而导致SessionInit中间件 end 回调方法里面 $this->session->save(); 没有调用。所以session一直存储不上,captcha_check也一直返回false.

liuxiaojinla avatar Dec 03 '19 03:12 liuxiaojinla

验证码扩展什么时候中断执行了

liu21st avatar Dec 04 '19 00:12 liu21st

laji,是交钱了会提供好的版本。。。

Lightopus avatar Dec 09 '19 05:12 Lightopus

都没人回复,没人维护的。。。。

Lightopus avatar Dec 09 '19 05:12 Lightopus

laji,是交钱了会提供好的版本。。。

说话要负责,框架一直是提供的免费开源版本 没有第二个版本,凭啥一定要回复你呢?服务是免费的?

liu21st avatar Dec 09 '19 06:12 liu21st

都没人回复,没人维护的。。。。

不要乱发表,ThinkPHP作为国产开源框加,已经帮助多少程序员就业问题,而且一直免费开源,能做到这一步已经很不容易了,毕竟ThinkPHP官方也有自己的事情要处理,不能实时回复很正常。

liuxiaojinla avatar Dec 09 '19 06:12 liuxiaojinla

@liuxiaojinla 没有出现您所说的情况。 有可能是您没开启Session功能:https://www.kancloud.cn/manual/thinkphp6_0/1037635

Session功能默认是没有开启的(API应用通常不需要使用Session),如果你需要使用Seesion,需要在全局的中间件定义文件中加上下面的中间件定义: 'think\middleware\SessionInit'

liuwave avatar Dec 09 '19 06:12 liuwave

// Session初始化
\think\middleware\SessionInit::class

有开启的,我的是多应用模式

liuxiaojinla avatar Dec 10 '19 02:12 liuxiaojinla

我这边也是多应用模式,但是在app/middleware.php内设置的。

---原始邮件--- 发件人: "刘小晋啦"<[email protected]> 发送时间: 2019年12月10日(周二) 上午10:06 收件人: "top-think/framework"<[email protected]>; 抄送: "葡萄架"<[email protected]>;"Comment"<[email protected]>; 主题: Re: [top-think/framework] TP6下 验证码扩展库用不了(Session问题) (#2130)

// Session初始化 \think\middleware\SessionInit::class
有开启的,我的是多应用模式

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

liuwave avatar Dec 10 '19 02:12 liuwave

你可以试试放在app/index/middleware.php下面试试

liuxiaojinla avatar Dec 10 '19 02:12 liuxiaojinla

TP6是不是不推荐使用多应用模式,但是不使用多应用模式的话如何更好的划分各个模块呢?用路由+中间件吗?

liuxiaojinla avatar Dec 10 '19 02:12 liuxiaojinla

简单做了个测试,确实是没有问题。

我想你应该自己先想办法找原因,然后求助的话,把你遇到的问题描述详细一点,不要没头没脑的就说不行。

------------------ 原始邮件 ------------------ 发件人: "刘小晋啦"<[email protected]>; 发送时间: 2019年12月10日(星期二) 上午10:12 收件人: "top-think/framework"<[email protected]>; 抄送: "刘强"<[email protected]>; "Comment"<[email protected]>; 主题: Re: [top-think/framework] TP6下 验证码扩展库用不了(Session问题) (#2130)

TP6是不是不推荐使用多应用模式,但是不使用多应用模式的话如何更好的划分各个模块呢?用路由+中间件吗?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

liuwave avatar Dec 10 '19 02:12 liuwave

邮件发图片没成功,补一下: image image image

liuwave avatar Dec 10 '19 02:12 liuwave