-
姓名
-
-
-
+
\ No newline at end of file
diff --git a/app/views/users/forgetpasswd.html.erb b/app/views/users/forgetpasswd.html.erb
new file mode 100644
index 0000000..28f254e
--- /dev/null
+++ b/app/views/users/forgetpasswd.html.erb
@@ -0,0 +1,22 @@
+<% provide(:title, '忘记密码') %>
+<% provide(:body_class, 'login2') %>
+
+
+
+
+ <%= form_tag("/forgetpasswd", method: "get") do %>
+
+
+
+
+ <%= submit_tag "找回密码", class: "btn btn-primary btn-block" %>
+ <% end %>
+
+
\ No newline at end of file
diff --git a/config/application.rb b/config/application.rb
index 94d17ee..161bf35 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -12,5 +12,15 @@ module GuorenPro
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
config.time_zone = 'Beijing'
+ config.action_mailer.delivery_method = :smtp
+ config.action_mailer.raise_delivery_errors = true
+ config.action_mailer.smtp_settings = {
+ :address => "smtp.163.com",
+ :port => 25,
+ :user_name => "zy_lovestar@163.com",
+ :password => "zy_lovestar+=*",
+ :authentication => "plain",
+ :enable_starttls_auto => true
+ }
end
end
diff --git a/config/environments/development.rb b/config/environments/development.rb
index 6f71970..3ad1cba 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -51,4 +51,15 @@ Rails.application.configure do
# Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem.
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
+
+ config.action_mailer.delivery_method = :smtp
+ config.action_mailer.raise_delivery_errors = true
+ config.action_mailer.smtp_settings = {
+ :address => "smtp.163.com",
+ :port => 25,
+ :user_name => "zy_lovestar@163.com",
+ :password => "zy_lovestar+=*",
+ :authentication => "plain",
+ :enable_starttls_auto => true
+ }
end
diff --git a/config/routes.rb b/config/routes.rb
index 183882f..fbb0f4c 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -8,6 +8,8 @@ Rails.application.routes.draw do
get '/signup', to: 'users#new'
get '/profile', to: 'users#edit'
+ get '/forgetpasswd', to: 'users#forgetpasswd'
+ get '/changepasswd', to: 'users#changepasswd'
get '/main', to: 'main#show'
get '/activity', to: 'main#activity'
diff --git a/db/development.sqlite3 b/db/development.sqlite3
index 1068a89..a6f22eb 100644
Binary files a/db/development.sqlite3 and b/db/development.sqlite3 differ
diff --git a/db/migrate/20170102130110_add_verify_code_to_users.rb b/db/migrate/20170102130110_add_verify_code_to_users.rb
new file mode 100644
index 0000000..96081e2
--- /dev/null
+++ b/db/migrate/20170102130110_add_verify_code_to_users.rb
@@ -0,0 +1,5 @@
+class AddVerifyCodeToUsers < ActiveRecord::Migration[5.0]
+ def change
+ add_column :users, :verify_code, :string
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 3ead5e8..00bcd1b 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20161227034933) do
+ActiveRecord::Schema.define(version: 20170102130110) do
create_table "comments", force: :cascade do |t|
t.string "content"
@@ -54,6 +54,7 @@ ActiveRecord::Schema.define(version: 20161227034933) do
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "password_digest"
+ t.string "verify_code"
end
end
diff --git a/test/mailers/previews/user_mailer_preview.rb b/test/mailers/previews/user_mailer_preview.rb
new file mode 100644
index 0000000..957e12b
--- /dev/null
+++ b/test/mailers/previews/user_mailer_preview.rb
@@ -0,0 +1,4 @@
+# Preview all emails at http://localhost:3000/rails/mailers/user_mailer
+class UserMailerPreview < ActionMailer::Preview
+
+end
diff --git a/test/mailers/user_mailer_test.rb b/test/mailers/user_mailer_test.rb
new file mode 100644
index 0000000..67a1629
--- /dev/null
+++ b/test/mailers/user_mailer_test.rb
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class UserMailerTest < ActionMailer::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end