From f23d611bd24f43004162b4c721eda877edf87790 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 14 Sep 2018 15:45:10 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/account/_change_user_email.html.erb | 6 ++- app/views/account/email_activation.html.erb | 17 +------ app/views/account/email_valid.html.erb | 44 +++++++++---------- public/javascripts/application.js | 33 ++++++++++++++ 4 files changed, 61 insertions(+), 39 deletions(-) diff --git a/app/views/account/_change_user_email.html.erb b/app/views/account/_change_user_email.html.erb index 519ffb8a5..094620de2 100644 --- a/app/views/account/_change_user_email.html.erb +++ b/app/views/account/_change_user_email.html.erb @@ -67,7 +67,11 @@ $("#user_email_show").html(data.email); // 更改邮箱地址后,直接给用户发送邮件 $.ajax({ - url: "<%= resendmail_path(:user => @user) %>" + url: "<%= resendmail_path(:user => @user) %>", + type: 'get', + success:function(data){ + task = setInterval(get_email_info(<%= @user.try(:id) %>, "用户注册帐号激活通知"), 1000); + } }); hideModal(); return; diff --git a/app/views/account/email_activation.html.erb b/app/views/account/email_activation.html.erb index 41434afe7..40608b776 100644 --- a/app/views/account/email_activation.html.erb +++ b/app/views/account/email_activation.html.erb @@ -42,22 +42,7 @@ $(".email_verify_btn").replaceWith("

激活邮件已发送至您的注册邮箱("+mail+"),请及时登录邮箱进行验证。

"); - $.ajax({ - url:'<%= account_get_email_info_path(:user_id => @user.try(:id), :subject => "用户注册帐号激活通知") %>', - type:'get', - success:function(data){ - if(data.result == "succuss"){ - $("#email_log_detail").html("邮件概况:"+data.message); - } else{ - $("#email_log_detail").html("邮件概况:无法查询邮件概况"); - } - $("#email_log_detail").parent().show(); - }, - error:function(){ - $("#email_log_detail").html("邮件概况:无法查询邮件概况"); - $("#email_log_detail").parent().show(); - } - }); + get_email_info(<%= @user.try(:id) %>, "用户注册帐号激活通知"); } ); } diff --git a/app/views/account/email_valid.html.erb b/app/views/account/email_valid.html.erb index 8bb1020ae..d5c3fa12d 100644 --- a/app/views/account/email_valid.html.erb +++ b/app/views/account/email_valid.html.erb @@ -9,7 +9,7 @@

<%= l(:label_check_email)%> -     <%= link_to "".html_safe, { :controller => 'account', :action => 'resendmail', :user => @user}, :remote => true, :method => 'get' %> +

@@ -27,20 +27,7 @@