新增优化

This commit is contained in:
shenjian
2024-12-09 11:15:44 +08:00
parent c61897d1ba
commit ab00d90310
3 changed files with 127 additions and 0 deletions
@@ -65,6 +65,10 @@ public class UserController {
return model;
}
public Object aiLoginPageAction(UserModel model) {
return model;
}
//渤海银行登录
public Object bhydLoginPageAction(UserModel model, HttpServletResponse response, HttpServletRequest request) {
String type = StringUtils.trimToNull(model.getType());
@@ -296,6 +300,15 @@ public class UserController {
String pass = StringUtils.trimToNull(model.getPass());
String weiXinId = CookieUtils.getCookieValue(request,"we_chat_open_id");
String source = model.getSource();
// AI估价小程序
if ("ai-price-mp".equals(source)) {
model.setCode(usersInfoService.randomCode());
model.setAppId("wx30979dc8c24a82b6");
model.setAppSecret("ec013ae42882368bf3b157545042249a");
}
if(StringUtils.isBlank(weiXinId) && StringUtils.isNotBlank(model.getCode())){
System.out.println("小程序code:"+model.getCode());
System.out.println("小程序AppId:"+model.getAppId());
@@ -22,6 +22,11 @@ public class UserModel extends BaseModel {
private String appId;//测试
private String appSecret;//测试
private String sid;//测试
/**
* 登录来源:AI估价小程序
*/
private String source;
public List<String> getCitys() {
return citys;
@@ -126,4 +131,12 @@ public class UserModel extends BaseModel {
public void setPass2(String pass2) {
this.pass2 = pass2;
}
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
}
@@ -0,0 +1,101 @@
<#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">
<link rel="stylesheet" href="https://g.alicdn.com/msui/sm/0.6.2/css/sm.css">
<link rel="stylesheet" href="../static/style/wx.css">
</head>
<body>
<div class="page-group">
<div class="page page-current">
<div class="content login_bg">
<div class="login_logo"><img src="../static/images/login_logo.png"></div>
<div class="login_content">
<div class="login_input">
<div class="inputInfo01">
<span>
<i class="login_icon01"></i>
<input class="input_mobileNumber" id="username" type="text" autocomplete="off" placeholder="请输入用户名">
</span>
</div>
<div class="inputInfo02">
<span>
<i class="login_icon02"></i>
<input class="input_password" id="pass" type="password" autocomplete="off" placeholder="请输入密码">
</span>
</div>
</div>
<p>忘记密码请拨打客服电话<a href="tel:4001883787">4001883787</a>进行查询</p>
<div class="content-block">
<p><a href="#" class="button button-big login_btn">登录</a></p>
</div>
</div>
</div>
</div>
</div>
<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 checkUsername = function(username) {
if(username == "") {
$.toast("用户名不能为空");
return false;
}
return true;
}
var checkPass = function(pass) {
if(pass == "") {
$.toast("密码不能为空");
return false;
}
return true;
}
$(".login_btn").click(function(){
var username = $("#username").val();
var pass = $("#pass").val();
if(checkUsername(username) && checkPass(pass)){
$.ajax({
type : "POST",
url : "../user/enterpriseLogin",
data : {
"username" : username,
"pass":pass,
"source": "ai-price-mp"
},
success : function(result) {
var re = $.parseJSON(result);
if(re.result == "fail"){
$.toast(re.msg);
} else {
window.location.href = "reqCityChoicePage?type=gb";
}
},error:function (data, status) {
$.toast("发送失败,请重试");
}
});
}
});
});
</script>
</body>
</html>
</#compress>