use of com.bc.pmpheep.back.util.DesRun in project pmph by BCSquad.
the class JavaMailSenderUtil method JavaMailSenderConfig.
/**
* <pre>
* 功能描述:邮件配置
* 使用示范:
*
* @return
* </pre>
*/
private MimeMessage JavaMailSenderConfig(JavaMailSenderImpl senderImpl) {
properties = PropsUtil.loadProps("mail.properties");
// senderImpl.setHost("smtp.qq.com");// 发送邮件服务器
// 发送邮件服务器
senderImpl.setHost(PropsUtil.getString(properties, "mail.smtp.host"));
// 端口号,腾讯邮箱使用SSL协议端口号:465/587,163邮箱使用SSL协议端口号:465/994
// 腾讯邮箱使用非SSL协议,163邮箱,新浪邮箱端口号都是:25
senderImpl.setPort(PropsUtil.getInt(properties, "mail.smtp.port"));
// 用户名
senderImpl.setUsername(PropsUtil.getString(properties, "mail.smtp.username"));
// 密码
senderImpl.setPassword(new DesRun(PropsUtil.getString(properties, "mail.smtp.password")).depsw);
// 参数配置
Properties prop = new Properties();
// 使用SSL协议
prop.put("mail.smtp.ssl.enable", PropsUtil.getString(properties, "mail.smtp.ssl.enable"));
prop.put("mail.smtp.socketFactory.class", PropsUtil.getString(properties, "mail.smtp.socketFactory.class"));
// 是否需要验证密码
prop.put("mail.smtp.auth", PropsUtil.getString(properties, "mail.smtp.auth"));
// 超时时间
prop.put("mail.smtp.timeout", PropsUtil.getString(properties, "mail.smtp.timeout"));
senderImpl.setJavaMailProperties(prop);
// 创建一个邮件消息
MimeMessage mailMessage = senderImpl.createMimeMessage();
return mailMessage;
}
use of com.bc.pmpheep.back.util.DesRun in project pmph by BCSquad.
the class WriterLoginController method logout.
/**
* <pre>
* 功能描述:退出
* 使用示范:
*
* @param model
* @return
* </pre>
*/
@ResponseBody
@RequestMapping(value = "/logout", method = RequestMethod.GET)
public ResponseBean logout(HttpServletRequest request, @RequestParam("loginType") Short loginType) {
String sessionId = CookiesUtil.getSessionId(request);
HttpSession session = SessionContext.getSession(new DesRun(sessionId).depsw);
if (ObjectUtil.notNull(session)) {
if (Const.LOGIN_TYPE_WRITER == loginType) {
// 清除User信息
session.removeAttribute(Const.SESSION_WRITER_USER);
// 清除token
session.removeAttribute(Const.SEESION_WRITER_USER_TOKEN);
}
}
return new ResponseBean();
}
Aggregations