点击邮箱名跳转到相对应的邮箱登陆页面

用户注册后点击邮箱跳转相应的邮箱登陆页面

需求:激活链接已发送至xxx@xx.xxx,请在24小时内点击激活链接,当点击邮箱的时候跳转到相应的邮箱登陆页面

<p  @click="goToEmailAddress">{{email}}</p>
goToEmaulAddress(){
  let address =goToEmail(this.email)
  if(address){
    window.location.href=address
  }else{
    return
  }
}
//定义一个方法获取注册邮箱是属于哪个邮箱的
export function goToEmail(email){
  const hash = {
    'qq.com': 'http://mail.qq.com',
    'gmail.com': 'http://mail.google.com',
    'sina.com': 'http://mail.sina.com.cn',
  }
  //获取注册邮箱@后面的地址
  let _email=email.split("@")[1].toLowerCase()
  if(hash.hasOwnProperty(_email)){
    return hash[_email]
  }else{
    return false
  }
}
posted @ 2020-07-10 10:08  香荣如梦  阅读(639)  评论(0编辑  收藏  举报