渤海
This commit is contained in:
+8
-1
@@ -1,8 +1,13 @@
|
||||
package com.fangjia.open.controllers;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.fangjia.core.util.AnalyticsUtil;
|
||||
import com.fangjia.dal.mongo.model.SendSmsLog;
|
||||
import com.fangjia.open.model.weixin.SendCodeJsonModel;
|
||||
import com.fangjia.open.model.weixin.SendCodeModel;
|
||||
import net.sf.json.JSONObject;
|
||||
|
||||
import org.apache.commons.codec.digest.DigestUtils;
|
||||
@@ -18,6 +23,8 @@ import com.fangjia.service.mongo.mobile.UserInfoService;
|
||||
import com.fangjia.service.sql.UserService;
|
||||
import com.fangjia.service.util.UsersUtils;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
public class UsersController {
|
||||
private UserService userService;
|
||||
private UserInfoService userInfoService;
|
||||
@@ -114,5 +121,5 @@ public class UsersController {
|
||||
this.userInfoService = userInfoService;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+143
-6
@@ -12,6 +12,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.fangjia.dal.common.XcxKey;
|
||||
import com.fangjia.dal.mongo.model.bkoff.XcxUserInfo;
|
||||
import com.fangjia.service.fangjia.FangJiaUserService;
|
||||
import com.fangjia.service.mongo.fangjia.XcxUserInfoService;
|
||||
import com.fangjia.service.open.WeChatAuthService;
|
||||
import com.fangjia.service.open.WeChatAuthServiceImpl;
|
||||
@@ -296,6 +297,70 @@ public class UserController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Object enterpriseLoginBHAction(UserModel model, HttpServletResponse response, HttpServletRequest request) {
|
||||
UserJsonModel resultModel = new UserJsonModel();
|
||||
resultModel.setResult(Message.RESULT_FAIL);
|
||||
String username = StringUtils.trimToNull(model.getUsername());
|
||||
String pass = StringUtils.trimToNull(model.getPass());
|
||||
String code = model.getCode();
|
||||
String type = StringUtils.trimToNull(model.getType());
|
||||
|
||||
String cacheCode = getCacheCode(username, type, request);
|
||||
if (cacheCode == null) {
|
||||
resultModel.setMsg(Message.MOBILE_NOT_SEND_CODE);
|
||||
return resultModel;
|
||||
}
|
||||
if (!cacheCode.equals(code)) {
|
||||
resultModel.setMsg(Message.CODE_ERROR);
|
||||
return resultModel;
|
||||
}
|
||||
|
||||
String weiXinId = CookieUtils.getCookieValue(request,"we_chat_open_id");
|
||||
|
||||
if(StringUtils.isBlank(weiXinId) && StringUtils.isNotBlank(model.getCode())){
|
||||
System.out.println("小程序code:"+model.getCode());
|
||||
System.out.println("小程序AppId:"+model.getAppId());
|
||||
System.out.println("小程序AppSecret:"+model.getAppSecret());
|
||||
System.out.println("sid:"+model.getSid());
|
||||
XcxKey sessionValue = getSessionValue(model.getCode(), null, model.getAppId(), model.getAppSecret());
|
||||
if(sessionValue!=null){
|
||||
weiXinId = sessionValue.getOpenId();
|
||||
}
|
||||
if(weiXinId == null) {
|
||||
weiXinId = CookieUtils.getCookieValue(request,"we_chat_open_id");
|
||||
}
|
||||
if(weiXinId != null && !weiXinId.equals("")){
|
||||
CookieUtils.setCookie("we_chat_open_id", weiXinId, "/", 60 * 60 * 24 *7, response);
|
||||
}
|
||||
System.out.println("[sid]小程序微信OPEN_ID:" + weiXinId);
|
||||
}
|
||||
|
||||
//测试时可以先去掉
|
||||
if (StringUtils.isBlank(username) || StringUtils.isBlank(pass) || StringUtils.isBlank(weiXinId)){
|
||||
resultModel.setMsg(Message.PARAM_NOT_NULL);
|
||||
return resultModel;
|
||||
}
|
||||
|
||||
try {
|
||||
FjtUsers user = usersInfoService.enterpriseLogin(username, pass);
|
||||
if(user == null) {
|
||||
resultModel.setMsg(Message.LOGIN_FAIL);
|
||||
return resultModel;
|
||||
}
|
||||
CookieUtils.setCookie("login_user_id", user.getId() + "", "/", 60 * 60 * 24 *7, response);
|
||||
CookieUtils.setCookie("login_user_type", "b", "/", 60 * 60 * 24 *7, response);
|
||||
CookieUtils.setCookie("login_enterpriseuser_weixinid", weiXinId, "/", 60 * 60 * 24 *7, response);
|
||||
//CacheUtils.putValue(CachePolicyEnum.LONG, UsersInfoService.class, weiXinId + "_" + Message.SMS_CODE_TYPE_ENTER_LOGIN , user.getId());
|
||||
resultModel.setResult(Message.RESULT_SUCCESS);
|
||||
return resultModel;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
resultModel.setMsg(e.getMessage());
|
||||
return resultModel;
|
||||
}
|
||||
}
|
||||
|
||||
public XcxKey getSessionValue(String code, String sid, String appId, String secret){
|
||||
XcxKey sessionValue = null;
|
||||
if(StringUtils.isNotBlank(sid)){
|
||||
@@ -347,18 +412,31 @@ public class UserController {
|
||||
String type = StringUtils.trimToNull(model.getType());
|
||||
String codeToken = StringUtils.trimToNull(model.getCodeToken());
|
||||
String code = StringUtils.trimToNull(model.getCode());
|
||||
if (StringUtils.isBlank(mobile) || StringUtils.isBlank(type) || StringUtils.isBlank(codeToken) || StringUtils.isBlank(code)) {
|
||||
resultModel.setResult(Message.RESULT_FAIL);
|
||||
resultModel.setMsg(Message.PARAM_NOT_NULL);
|
||||
return resultModel;
|
||||
if(StringUtils.isNotBlank(type) && type.equals("bindmobilebh")){
|
||||
if (StringUtils.isBlank(mobile)) {
|
||||
resultModel.setResult(Message.RESULT_FAIL);
|
||||
resultModel.setMsg(Message.PARAM_NOT_NULL);
|
||||
return resultModel;
|
||||
}
|
||||
}else{
|
||||
if (StringUtils.isBlank(mobile) || StringUtils.isBlank(type) || StringUtils.isBlank(codeToken) || StringUtils.isBlank(code)) {
|
||||
resultModel.setResult(Message.RESULT_FAIL);
|
||||
resultModel.setMsg(Message.PARAM_NOT_NULL);
|
||||
return resultModel;
|
||||
}
|
||||
}
|
||||
|
||||
String cacheCode = getCacheCode(codeToken, Message.SMS_CODE_TYPE_LOGIN, request);
|
||||
if(!code.equals(cacheCode)){
|
||||
if(!type.equals("bindmobilebh") && !code.equals(cacheCode)){
|
||||
resultModel.setResult(Message.RESULT_FAIL);
|
||||
resultModel.setMsg(Message.IMG_CODE_ERROR);
|
||||
return resultModel;
|
||||
}
|
||||
return sendCode(model, resultModel, mobile, type, resp);
|
||||
if(type.equals("bindmobilebh")){
|
||||
return sendBHCode(model, resultModel, mobile, type, resp);
|
||||
}else{
|
||||
return sendCode(model, resultModel, mobile, type, resp);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -399,6 +477,34 @@ public class UserController {
|
||||
return resultModel;
|
||||
}
|
||||
|
||||
|
||||
private Object sendBHCode(SendCodeModel model, SendCodeJsonModel resultModel, String mobile, String type, HttpServletResponse resp) {
|
||||
|
||||
Long sendCodeTime = (Long) CacheUtils.getValue(FjtUsers.class, mobile);
|
||||
if(sendCodeTime != null) {
|
||||
Long curTime = new Date().getTime();
|
||||
long second = (curTime - sendCodeTime)/1000;
|
||||
if(second < 300 ){
|
||||
resultModel.setResult(Message.RESULT_FAIL);
|
||||
resultModel.setMsg(Message.SMS_CODE_SEND_FAIL_TIME);
|
||||
return resultModel;
|
||||
}
|
||||
}
|
||||
|
||||
String code = usersInfoService.randomCode();
|
||||
System.out.println(code);
|
||||
try {
|
||||
smsService.send(model.getMobile(), "【渤海银行】你的验证码是" + code + ",请立即验证。");
|
||||
resultModel.setResult(Message.RESULT_SUCCESS);
|
||||
CookieUtils.setCookie(mobile + "_" + type, code, "/", 60 * 60 * 24 *7, resp);
|
||||
CacheUtils.putValue(CachePolicyEnum.TINY, FjtUsers.class, mobile, new Date().getTime());
|
||||
} catch (SmsException e) {
|
||||
resultModel.setResult(Message.RESULT_FAIL);
|
||||
resultModel.setMsg(Message.SMS_CODE_SEND_FAIL);
|
||||
}
|
||||
return resultModel;
|
||||
}
|
||||
|
||||
public void setWeChatAuthService(WeChatAuthService weChatAuthService) {
|
||||
this.weChatAuthService = weChatAuthService;
|
||||
}
|
||||
@@ -416,4 +522,35 @@ public class UserController {
|
||||
CacheUtils.putValue(CachePolicyEnum.LONG, "fangjia-weiXin-key", model.getWeiXinId(), model.getUsername());
|
||||
return resultModel;
|
||||
}
|
||||
|
||||
public Object setupAction(UserModel model){
|
||||
return model;
|
||||
}
|
||||
|
||||
public Object updateInfoAction(UserModel model, HttpServletRequest request){
|
||||
UserJsonModel resultModel = new UserJsonModel();
|
||||
Long userId = Long.parseLong(CookieUtils.getCookieValue(request,"login_user_id"));
|
||||
if(null != userId){
|
||||
if(!model.getPass1().equals(model.getPass2())){
|
||||
resultModel.setResult(Message.RESULT_FAIL);
|
||||
resultModel.setMsg(Message.PASS_REPEAT);
|
||||
return resultModel;
|
||||
}
|
||||
FjtUsers users = fjtUsersService.findById(userId);
|
||||
if(null != users){
|
||||
if(!users.getPassword().equals(model.getPass())){
|
||||
resultModel.setResult(Message.RESULT_FAIL);
|
||||
resultModel.setMsg(Message.LOGIN_UPPSW);
|
||||
return resultModel;
|
||||
}else{
|
||||
users.setPassword(model.getPass1());
|
||||
fjtUsersService.update(users);
|
||||
resultModel.setResult(Message.RESULT_SUCCESS);
|
||||
}
|
||||
}
|
||||
}
|
||||
return resultModel;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -46,4 +46,6 @@ public class Message {
|
||||
public static final String PAY_PASSWORD_ERROR = "支付密码错误,请重新输入";
|
||||
|
||||
public static final String NOT_LOGIN = "请先进行登录";
|
||||
|
||||
public static final String LOGIN_UPPSW = "原始密码输入错误";
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@ public class UserModel extends BaseModel {
|
||||
private String weiXinId;
|
||||
private String username;
|
||||
private String pass;
|
||||
private String pass1;
|
||||
private String pass2;
|
||||
private String code;
|
||||
private List<String> citys;
|
||||
|
||||
@@ -108,4 +110,20 @@ public class UserModel extends BaseModel {
|
||||
public void setSid(String sid) {
|
||||
this.sid = sid;
|
||||
}
|
||||
|
||||
public String getPass1() {
|
||||
return pass1;
|
||||
}
|
||||
|
||||
public void setPass1(String pass1) {
|
||||
this.pass1 = pass1;
|
||||
}
|
||||
|
||||
public String getPass2() {
|
||||
return pass2;
|
||||
}
|
||||
|
||||
public void setPass2(String pass2) {
|
||||
this.pass2 = pass2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,6 +52,9 @@
|
||||
<nav class="bar bar-tab">
|
||||
<a class="tab-item external" href="../weiXinEvaluation/recordList">估价记录</a>
|
||||
<a class="tab-item external" href="../report/downloadList">报告下载记录</a>
|
||||
<#if role?? && role == 17>
|
||||
<a class="tab-item external" href="../user/setup">我的</a>
|
||||
</#if>
|
||||
</nav>
|
||||
<#else>
|
||||
<nav class="bar bar-tab">
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 8.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 7.3 KiB |
@@ -60,6 +60,10 @@ input::-webkit-input-placeholder{
|
||||
/* 按钮 */
|
||||
.button.button-fill{background:#ec881d;border-radius:0;width:100%;position:fixed;bottom:0;z-index:20;}
|
||||
.button.button-fill:active{background:#bd6c16;}
|
||||
|
||||
.button.button-fill2{background:#ec881d;border-radius:0;width:100%;z-index:20;color: #fff; border: none;}
|
||||
.button.button-fill2:active{background:#bd6c16;}
|
||||
|
||||
.content-block{padding:0;margin:0;}
|
||||
.content-block p.di a{color:#a9a9a9;}
|
||||
.row{margin:0;}
|
||||
@@ -185,15 +189,19 @@ input::-webkit-input-placeholder{
|
||||
.login_icon01{width:20px;height:22px;background:url(../images/login_icon01.png) no-repeat;position:absolute;top:12px;left:8px;background-size:100%;}
|
||||
.login_icon02{width:18px;height:22px;background:url(../images/login_icon02.png) no-repeat;position:absolute;top:10px;left:9px;background-size:100%;}
|
||||
.login_icon03 {width:26px;height:24px;background:url(../images/login_icon03.png) no-repeat;position:absolute;top:10px;left:9px;background-size:100%;}
|
||||
.login_icon04{width: 28px;height: 28px;background:url(../images/login_code.png) no-repeat;position:absolute;top:10px;left: 4px;background-size:100%;}
|
||||
.login_icon05{width: 24px;height: 24px;background:url(../images/login_mobile.png) no-repeat;position:absolute;top:10px;left: 4px;background-size:100%;}
|
||||
.codeImg {width:68px;height:34px;position:absolute;right:0;top:8px;}
|
||||
.login_input input{width:100%;border:none;background:none;border-bottom:solid 1px #999;line-height:40px;padding-left:40px;}
|
||||
#smsCodeInput{width:70%;border:none;background:none;border-bottom:solid 1px #999;line-height:40px;padding-left:40px;}
|
||||
.inputInfo02, .inputInfo03{margin-top:10px;}
|
||||
.login_content p{font-size:0.65rem;color:#999;}
|
||||
.login_btn,.binding_btn{background:#ec881d;border-radius:4px;border:none;color:white;}
|
||||
.login_btn:active,.binding_btn:active{background:#bd6c16;}
|
||||
.sendCode{padding:0 4px;height:30px;border:solid 1px #a8a8a8;border-radius:2px;font-size:0.7rem;color:#333;text-align:center;line-height:30px;float:right;position:absolute;right:0;top:8px;cursor:pointer;}
|
||||
.waiting{padding:0 4px;height:30px;background:#808080;border:solid 1px #545454;border-radius:2px;font-size:0.7rem;color:white;text-align:center;line-height:30px;float:right;position:absolute;right:0;top:8px;cursor:pointer;}
|
||||
|
||||
.waiting1{height:30px;background:#808080;border:solid 1px #545454;border-radius:2px;font-size:0.7rem;color:white;text-align:center;line-height:30px;float:right;right:0;top:8px;cursor:pointer;}
|
||||
.change_btn{width:88px;height:38px;background:#f0f0f0;border:solid 1px #e1e1e1;text-align:center;line-height:38px;float:right;cursor:pointer;color: #333;font-size: 14px;}
|
||||
/* 自适应 */
|
||||
@media(max-width:1200px){
|
||||
.tabs{padding-top:67px;}
|
||||
@@ -202,5 +210,7 @@ input::-webkit-input-placeholder{
|
||||
.top .searchBox .cityChoice a span{max-width:35px;}
|
||||
.top .searchBox input{width:75%;}
|
||||
.inputTopic02 .topicTitle .input_lender{width:36%;}
|
||||
#smsCodeInput{width:65%;padding-left: 30px;}
|
||||
.change_btn{width:72px;}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,9 @@
|
||||
|
||||
<link rel="stylesheet" href="https://g.alicdn.com/msui/sm/0.6.2/css/sm.css">
|
||||
<link rel="stylesheet" href="../static/style/wx.css">
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
@@ -23,13 +26,13 @@
|
||||
<div class="page page-current">
|
||||
<div class="content login_bg2">
|
||||
<div class="login_logo" style="margin-top: 0px;"><img src="../static/images/bohaiyidai2.jpg" style="width: 80%;height: 100px;margin: 20px auto;"></div>
|
||||
<div class="login_logo" style="margin-top: 0px;"><img src="../static/images/bh1.png" id="bannersDiv" style="width: 100%;height: 250px;"></div>
|
||||
<div class="login_content">
|
||||
<div class="login_logo" style="margin-top: 0px;"><img src="../static/images/bh1.png" id="bannersDiv" style="width: 100%;height: 220px;"></div>
|
||||
<div class="login_content" style="margin-top: 8%;">
|
||||
<div class="login_input">
|
||||
<div class="inputInfo01">
|
||||
<span>
|
||||
<i class="login_icon01"></i>
|
||||
<input class="input_mobileNumber" id="username" type="text" autocomplete="off" placeholder="请输入用户名">
|
||||
<i class="login_icon05"></i>
|
||||
<input class="input_mobileNumber" id="username" type="text" autocomplete="off" placeholder="请输入手机号码">
|
||||
</span>
|
||||
</div>
|
||||
<div class="inputInfo02">
|
||||
@@ -38,6 +41,16 @@
|
||||
<input class="input_password" id="pass" type="password" autocomplete="off" placeholder="请输入密码">
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="inputInfo02">
|
||||
<span>
|
||||
<i class="login_icon04"></i>
|
||||
<input class="inpu inpu01" id="smsCodeInput" type="text" autocomplete="off" placeholder="请输入短信验证码">
|
||||
<a class="change_btn sendCode_before" id="sendCode">发送验证码</a>
|
||||
<a class="change_btn waiting dn">60s</a>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<p>忘记密码请拨打客服电话<a href="tel:4001883787">400-888-8811</a>进行查询</p>
|
||||
<div class="content-block">
|
||||
@@ -52,6 +65,7 @@
|
||||
<script type='text/javascript' src='https://g.alicdn.com/sj/lib/zepto/zepto.js' charset='utf-8'></script>
|
||||
<script type='text/javascript' src='https://g.alicdn.com/msui/sm/0.6.2/js/sm.js' charset='utf-8'></script>
|
||||
<script type='text/javascript' charset='utf-8'>
|
||||
|
||||
$(function() {
|
||||
var counter = 0
|
||||
var images = ["bh1.png","bh2.png", "bh3.png"]
|
||||
@@ -78,6 +92,7 @@
|
||||
}
|
||||
|
||||
|
||||
|
||||
//run();
|
||||
|
||||
var checkUsername = function(username) {
|
||||
@@ -102,11 +117,12 @@
|
||||
if(checkUsername(username) && checkPass(pass)){
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "../user/enterpriseLogin",
|
||||
url : "../user/enterpriseLoginBH",
|
||||
data : {
|
||||
"username" : username,
|
||||
"pass":pass,
|
||||
"code":"${code!''}",
|
||||
"type" : "bindmobilebh",
|
||||
"code":$("#smsCodeInput").val(),
|
||||
"sid":"${sid!''}",
|
||||
"appId":"${appId!''}",
|
||||
"appSecret":"${appSecret!''}"
|
||||
@@ -124,7 +140,108 @@
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$("#sendCode").click(function(){
|
||||
sendCode($(this));
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
// 发送验证码以及倒计时
|
||||
var countdown = 60;
|
||||
var sendCode = function(obj) {
|
||||
if (countdown < 60) {
|
||||
return;
|
||||
}
|
||||
var mobile = $("#username").val();
|
||||
if (checkBindMobile(mobile)) {
|
||||
obj.addClass("waiting1");
|
||||
settime(obj);
|
||||
doSendCode(mobile);
|
||||
}
|
||||
}
|
||||
|
||||
var doSendCode = function(mobile) {
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "../user/sendSmsCode",
|
||||
data : {
|
||||
"type" : "bindmobilebh",
|
||||
"mobile" : mobile
|
||||
},
|
||||
success : function(result) {
|
||||
var re = $.parseJSON(result);
|
||||
if (re.result == "fail") {
|
||||
countdown = 0;
|
||||
$.toast(re.msg);
|
||||
} else {
|
||||
$.toast("验证码已发送,请注意查收!");
|
||||
}
|
||||
},
|
||||
error : function(data, status) {
|
||||
countdown = 0;
|
||||
alert("发送失败,请重试");
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
var settime = function(obj) {
|
||||
if (countdown == 0) {
|
||||
obj.removeClass("waiting1");
|
||||
obj.html("发送验证码");
|
||||
countdown = 60;
|
||||
return;
|
||||
} else {
|
||||
obj.html("重新发送(" + countdown + ")");
|
||||
countdown--;
|
||||
}
|
||||
setTimeout(function() {
|
||||
settime(obj)
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
//验证手机号码
|
||||
var checkBindMobile = function(str) {
|
||||
if(str == "") {
|
||||
$.toast("手机号码不能为空");
|
||||
return false;
|
||||
} else {
|
||||
var re = /^1\d{10}$/
|
||||
if (re.test(str)) {
|
||||
return true;
|
||||
} else {
|
||||
$.toast("请输入11位数字的手机号码");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var checkBindCode =function(str) {
|
||||
if(str == "") {
|
||||
$.toast("短信验证码不能为空");
|
||||
return false;
|
||||
} else {
|
||||
var re = /^\d{4}$/
|
||||
if(re.test(str)) {
|
||||
return true;
|
||||
} else {
|
||||
$.toast("请输入4位数字的短信验证码");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,128 @@
|
||||
<#ftl attributes={"content_type":"text/html; charset=UTF-8"}>
|
||||
<#compress>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>帐户安全</title>
|
||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
|
||||
<link rel="shortcut icon" href="/favicon.ico">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<link rel="stylesheet" href="https://g.alicdn.com/msui/sm/0.6.2/css/sm.css">
|
||||
<link rel="stylesheet" href="../static/style/wx.css">
|
||||
|
||||
<style>
|
||||
.list-block .item-subtitle{padding-left:0.3rem;}
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="page-group">
|
||||
<div class="page page-current">
|
||||
<form id="userForm">
|
||||
<div class="content" style="padding-bottom:60px;">
|
||||
<div class="list-block">
|
||||
<ul>
|
||||
<li>
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title label">原始密码:</div>
|
||||
<div class="item-input">
|
||||
<input type="password" min="0" placeholder="请输入原始密码" name="psw" id="psw1">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title label">新密码:</div>
|
||||
<div class="item-input">
|
||||
<input type="password" min="0" placeholder="请输入新密码" name="psw1" id="psw2">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title label">确认密码:</div>
|
||||
<div class="item-input">
|
||||
<input type="password" min="0" placeholder="请确认密码" name="psw2" id="psw3">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="content-block">
|
||||
<p><a id="updateBtn" class="button button-big button-fill2">修改密码</a></p>
|
||||
<p><a id="updateBtn" class="button button-big button-fill2" href="../district/weXinList">返回首页</a></p>
|
||||
<p><a id="goBtn" class="button button-big button-fill2" href="../user/bhydLoginPage">退出登录</a></p>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<#include '/layout/footer.ftl'/>
|
||||
<script type='text/javascript' src='../static/js/wx.js' charset='utf-8'></script>
|
||||
|
||||
<script type='text/javascript'>
|
||||
$("#updateBtn").click(function(){
|
||||
var pass1 = $("#psw1").val()
|
||||
if(pass1 == "") {
|
||||
$.toast("请输入原始密码");
|
||||
return false;
|
||||
}
|
||||
|
||||
var pass2 = $("#psw2").val()
|
||||
if(pass2 == "") {
|
||||
$.toast("请输入新密码");
|
||||
return false;
|
||||
}else if(pass2.length<6){
|
||||
$.toast("输入新密码过短");
|
||||
return false;
|
||||
}
|
||||
|
||||
var pass3 = $("#psw3").val()
|
||||
if(pass3 == "") {
|
||||
$.toast("请输入确认密码");
|
||||
return false;
|
||||
}
|
||||
if(pass2!=pass3){
|
||||
$.toast("新密码输入不一致");
|
||||
return false;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "../user/updateInfo",
|
||||
data : {
|
||||
"pass" : pass1,
|
||||
"pass1" : pass2,
|
||||
"pass2" : pass3
|
||||
},
|
||||
success : function(result) {
|
||||
var re = $.parseJSON(result);
|
||||
if (re.result == "fail") {
|
||||
$.toast(re.msg);
|
||||
} else {
|
||||
$.toast("修改已成功");
|
||||
}
|
||||
},
|
||||
error : function(data, status) {
|
||||
alert("修改失败,请重试");
|
||||
}
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</#compress>
|
||||
Reference in New Issue
Block a user