密码在mvc中更改30天一次 [英] password change 30 days once in mvc

查看:101
本文介绍了密码在mvc中更改30天一次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

这里我想一次更改密码30天。我在模型中有一个字段,如过期密码日期。现在我如何写控制器和视图可以任何人帮助我,因为我在网络搜索找不到解决方案所以请帮助我。

hi to all,
Here i want to change password 30 days once. i have a field in model like Expired password date. now how i write in controller and views can anyone help me because i search in net cant find the solution so kindly help me.

推荐答案

你的意思是你找不到您可以复制和粘贴的预编码解决方案?不足为奇......



这真的很容易。当用户登录时,在控制器中,您将根据数据库中的过期日期/时间检查当前日期/时间。如果当前日期/时间更长,您只需重定向到密码更改控制器和操作以显示适当的视图。
You mean you can't find a pre-coded solution you can copy and paste? Not surprising...

It's quite easy really. When the user logs in, in your controller, you check the current date/time against the Expires date/time in the database. If the current date/time is greater, you simply Redirect to a password change controller and action to show an appropriate view.


这篇关于密码在mvc中更改30天一次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆