测试渤海

This commit is contained in:
2021-07-09 11:08:47 +08:00
parent f45fa30385
commit 7db8294c38
5 changed files with 129 additions and 25 deletions
@@ -63,6 +63,10 @@ public class UserController {
return model;
}
public Object bhydLoginPageAction(UserModel model) {
return model;
}
public void setXcxUserInfoService(XcxUserInfoService xcxUserInfoService) {
this.xcxUserInfoService = xcxUserInfoService;
}
@@ -226,7 +230,7 @@ public class UserController {
String pass = StringUtils.trimToNull(model.getPass());
String weiXinId = CookieUtils.getCookieValue(request,"we_chat_open_id");
if(StringUtils.isBlank(weiXinId) && StringUtils.isNotBlank(model.getSid())){
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());
@@ -243,25 +247,25 @@ public class UserController {
}
System.out.println("[sid]小程序微信OPEN_ID:" + weiXinId);
}
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());
WeChatAuthServiceImpl.WeChatWebToken token = weChatAuthService.getWeChatWebToken(model.getCode(), model.getAppId(), model.getAppSecret());
if(token != null) {
weiXinId = token.getOpenid();
} else {
weiXinId = CookieUtils.getCookieValue(request,"we_chat_open_id");
}
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("小程序微信OPEN_ID:" + weiXinId);
}
//
// 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());
// WeChatAuthServiceImpl.WeChatWebToken token = weChatAuthService.getWeChatWebToken(model.getCode(), model.getAppId(), model.getAppSecret());
// if(token != null) {
// weiXinId = token.getOpenid();
// } else {
// weiXinId = CookieUtils.getCookieValue(request,"we_chat_open_id");
// }
// 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("小程序微信OPEN_ID:" + weiXinId);
// }
//测试时可以先去掉
if (StringUtils.isBlank(username) || StringUtils.isBlank(pass) || StringUtils.isBlank(weiXinId)){
resultModel.setMsg(Message.PARAM_NOT_NULL);
Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

@@ -0,0 +1,104 @@
<#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/bohaiyidai2.jpg"></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">400-888-8811</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,
"code":"${code!''}",
"sid":"${sid!''}",
"appId":"${appId!''}",
"appSecret":"${appSecret!''}"
},
success : function(result) {
var re = $.parseJSON(result);
if(re.result == "fail"){
$.toast(re.msg);
} else {
window.location.href = "reqCityChoicePage?type=b";
}
},error:function (data, status) {
$.toast("发送失败,请重试");
}
});
}
});
});
</script>
</body>
</html>
</#compress>
@@ -77,11 +77,7 @@
url : "../user/enterpriseLogin",
data : {
"username" : username,
"pass":pass,
"code":"${code!''}",
"sid":"${sid!''}",
"appId":"${appId!''}",
"appSecret":"${appSecret!''}"
"pass":pass
},
success : function(result) {
var re = $.parseJSON(result);