首页>代码>SSM周测在线答题考试系统>/NCTestSSM0905/src/it/com/action/LoggAction.java
package it.com.action;

import it.com.log.EmailUser;
import it.com.service.UsersService;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class LoggAction {
@Resource
	UsersService us;
	public UsersService getTs() {
		return us;
	}
	public void setTs(UsersService us) {
		this.us = us;
	}



@RequestMapping("email.action")
	public ModelAndView emailLogin(String usernameA,String username,String email){
		EmailUser em=new EmailUser();
		String receiveMailAccount = email;
		String myEmailAccount = "zwy_bx@163.com";
		String myEmailPassword = "yy2234243040";
		String myEmailSMTPHost = "smtp.163.com";
		String uri="";
		
		System.out.println(username+" ****0**** "+usernameA);
		if(usernameA.equals(username)){
			em.smtpToEmail(myEmailSMTPHost, myEmailAccount,  receiveMailAccount, myEmailPassword);
			//System.out.println(" %%%%%%%%%%%% ");
			uri="findpwd/emailafter.jsp";
		}
		else{
			uri="findpwd/nofind.jsp";
		}
		return new ModelAndView(uri);
	}
@RequestMapping("upadateAdminUserpwd.action")
	public ModelAndView updateAdminUserpwd(String userpwd,String userpwd1,String usernameA,HttpSession session){
		System.out.println(userpwd+"==="+userpwd1);
		String uri="";
		int msg=0;
		int num;
		if(userpwd.equals(userpwd1)){
			num=0;
			int n=us.upAdminUserpwd(userpwd, usernameA);
			System.out.println(n);
			
			if(n==1){
				uri="admin/login.jsp";
			}else{
				msg=1;
				session.setAttribute("msg",msg );
				uri="findpwd/updatepwd.jsp";
			}
			
		}else{
			 num=1;
			session.setAttribute("num",num );
			uri="findpwd/updatepwd.jsp";
		}
		return new ModelAndView(uri);
	}

}

最近下载更多
初嘤嘤嘤未来  LV7 2024年12月18日
ma406805131  LV19 2024年12月9日
2206371875  LV7 2024年3月14日
hongdongdong  LV14 2023年12月3日
lbsers  LV5 2023年5月6日
15152729192  LV3 2023年2月20日
唐唐丶  LV34 2023年2月19日
赵宇豪  LV1 2022年12月8日
1532593037  LV8 2022年11月30日
云翳tel青  LV11 2022年11月19日
最近浏览更多
taoshen95  LV16 2024年12月21日
初嘤嘤嘤未来  LV7 2024年12月18日
ma406805131  LV19 2024年12月9日
Luis虎子  LV16 2024年9月25日
傲世彩云之南  LV5 2024年8月8日
TY0165  LV20 2024年6月24日
xzg123456  LV6 2024年6月18日
Adguard  LV3 2024年6月13日
yyhrhv  LV8 2024年5月31日
yuanshun  LV7 2024年5月31日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友