首页>代码>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);
	}

}

最近下载更多
2206371875  LV7 3月14日
hongdongdong  LV12 2023年12月3日
lbsers  LV5 2023年5月6日
15152729192  LV3 2023年2月20日
唐唐丶  LV33 2023年2月19日
赵宇豪  LV1 2022年12月8日
1532593037  LV8 2022年11月30日
云翳tel青  LV11 2022年11月19日
testuser1234567  LV24 2022年7月21日
mdz123456mao  LV3 2022年6月19日
最近浏览更多
爱学习的涵  LV6 3月25日
qqttuu  LV3 3月6日
好的好的  LV8 3月4日
Boss绝  LV8 3月3日
MHMHMHMH  LV12 2月28日
gnnhka  LV10 1月7日
LTPR66  LV1 1月2日
可乐123123  LV15 2023年12月20日
pokerf  LV5 2023年12月19日
123456lxw 2023年12月17日
暂无贡献等级
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友