NO.8--邮箱激活, 用户登录,

客户邮箱激活


流程分析:
  • 页面输入正确的邮箱
  • 点击注册提交注册信息, 保存用户信息,
  • 发送激活邮件
    • 通过JavaMail发送+邮件(加入依赖)
    • 手机号&激活码36位, 存入Redis(速度快)
  • 用户接受邮件, 点击激活链接, 激活账号
    • 根据手机号码获取Redis中的激活码, 对比激活链接地址中激活码是否一致
步骤:
  • Redis使用
    • Redis下载安装
    • Jedis 使用
    • spring data redis使用
    • 在spring的配置文件applicationContext.xml文件中添加 jedis的连接池配置, jedis的连接工厂, spring data 提供的Redis的模板
  • 客户注册时发送邮件并保存激活码到Redis
  • 通过JavaMail发送邮件
  • 完成邮箱激活功能
    • CRM服务提供WebService方法完成激活
    • 在CustomerAction 提供 activeMail方法

web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://java.sun.com/xml/ns/javaee"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    version="2.5">
    <display-name>bos_fore</display-name>
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>default.html</welcome-file>
        <welcome-file>default.htm</welcome-file>
        <welcome-file>default.jsp</welcome-file>
    </welcome-file-list>

  <!-- 指定spring配置文件的位置 -->
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:applicationContext.xml</param-value>
    </context-param>

    <!-- 配置spring框架的监听器 -->
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <!-- 配置struts2框架的过滤器 -->

    <filter>
        <filter-name>struts2</filter-name>
        <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
    <filter-mapping>
        <filter-name>struts2</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

</web-app>

CustomerAction

@Action(value="customerAction_activeMail")
    public String activeMail(){

        ValueOperations<String, String> opsForValue = redisTemplate.opsForValue();

        if(StringUtils.isNotBlank(getModel().getTelephone())&&StringUtils.isNotBlank(activeCode)
                && activeCode.equals(opsForValue.get(getModel().getTelephone()))){
            customerService.activeByTelephone(getModel().getTelephone());
        }
         return NONE;
    }


@Action(value="customerAction_login" ,results={
            @Result(name = "success", location = "/index.html", type = "redirect"),
            @Result(name = "false", location = "/login-fail.html", type = "redirect")})
    public String login(){

        String sessionCode = (String) ServletActionContext.getRequest().getSession().getAttribute("validateCode");
        if(StringUtils.isNotBlank(getModel().getTelephone())&&
                StringUtils.isNotBlank(getModel().getPassword())
                && StringUtils.isNotBlank(sessionCode)
                && sessionCode.equals(checkcode)){
            String  falg = customerService.login(getModel().getTelephone(),getModel().getPassword());
            System.out.println(falg);
            if(falg.equals(SUCCESS)){
                return SUCCESS;
            }
        }

        return "false";
    }

2、前台系统客户登录


  • 在CRM中扩展登录方法
  • 在bos_fore中完成登录

3、省市区三级联动实现(city-picker)


  • 引入相关资源文件

  • 两种使用方式

    • HTML方式
    • JS方式

4、百度地图简介


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值