独角数卡添加找回密码功能的修改教程

更新于

发布于 2026-01-14 · 应用教程

本文介绍为独角数卡增加找回密码功能的开发主题,涉及恢复入口、身份核验与新密码设置,修改后需要检查原有登录流程。

独角数卡添加找回密码功能的修改教程

创建 password_resets 表的 SQL

CREATE TABLE `password_resets` (
  `email` VARCHAR(255) NOT NULL,
  `token` VARCHAR(255) NOT NULL,
  `created_at` TIMESTAMP NULL DEFAULT NULL,
  INDEX (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

补充控制器逻辑/app/Http/Controllers/Home/AuthController.php

添加视图页面

resources/views/static_pages/forgot.blade.php

resources/views/static_pages/reset.blade.php

添加路由(/web.php)

Route::get('/forgot-password', 'AuthController@forgotPasswordForm')->name('forgot.form');
Route::post('/forgot-password', 'AuthController@handleForgotPassword')->name('forgot.handle');
Route::get('/reset-password', 'AuthController@resetPasswordForm')->name('reset.form');
Route::post('/reset-password', 'AuthController@resetPassword')->name('reset.handle');

登录页加入口

<!-- 登录页加入口 -->
<div class="mt-2 text-center">
    <a href="https://henduohaopifa.com/ route('forgot.form') }}">忘记密码?</a>
</div>

延伸阅读与使用建议

平台规则和产品功能可能随时调整,请以对应平台最新官方说明为准,并妥善保护密码、验证码、私钥及恢复信息。

返回 很多号批发 首页

本文相关商品

相关阅读