Tank Auth 的 Codeigniter 路由设置
我正在为我的应用程序使用 Tank-Auth。我遇到的唯一问题是激活和重置帐户密码。
用于登录、注册、注销;我对这段代码没有任何问题;
$route['login'] = "/auth/login";
$route['logout'] = "/auth/logout";
$route['register'] = "/auth/register";
但对于激活帐户和重置密码,这些代码不起作用;
$route['activate/:num/:any'] = "/auth/activate/$1/$2";
$route['reset_password/:num/:any'] = "/auth/reset_password/$1/$2";
PS:“激活”后的第一段是“用户 ID”,第二段是关键,如下所示:example.com/activate/2/4784322e48916efec1153c53d25453c7
I'm using Tank-Auth for my application. And the only problem I have is activating and resetting passwords for accounts.
For login, register, logout; I have no problem with this codes;
$route['login'] = "/auth/login";
$route['logout'] = "/auth/logout";
$route['register'] = "/auth/register";
But for activating accounts and resetting passwords, those codes are not working;
$route['activate/:num/:any'] = "/auth/activate/$1/$2";
$route['reset_password/:num/:any'] = "/auth/reset_password/$1/$2";
PS: The first segment after 'activate' is 'user id' and second segment is key like this: example.com/activate/2/4784322e48916efec1153c53d25453c7
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决方案是将 (auth) 控制器中的 url 段从以下更改为
:
更改后,activate&reset_password 的路由将使用这些规则
The solution is changing url segments in the (auth) controller from this:
to this:
After this change, the routing for activate&reset_password is working with those rules