Commit f67da0a4 by 罗承锋

添加移动端非微信授权登录,修改线上版本配置

parent 0f5790e1
......@@ -196,7 +196,7 @@ public class SyncController {
orderView.setOrderName(order.getCustomerName());
orderView.setOrderPhone(order.getContactNumber());
orderView.setOrderNumber(order.getIdCard());
orderView.setProductName("中国电信校园高速宽带");
orderView.setProductName(jsonObject.getString("prodName"));
orderView.setOrderSetMeal("无人厅");
orderView.setOrderDate(order.getCreateTime());
orderView.setOrderUniversityName(order.getHehuorenSchool());
......@@ -256,7 +256,7 @@ public class SyncController {
if (jsonObject.getString("termNo") == null // 终端编码
|| jsonObject.getString("orderTime") == null // 订单时间
|| jsonObject.getString("prodName") == null // 时间戳
|| jsonObject.getString("prodName") == null // 产品名
|| jsonObject.getString("custName") == null //客户姓名
|| jsonObject.getString("recNo") == null // 订单流水号
|| jsonObject.getString("userName") == null // 合伙人账号
......
......@@ -268,7 +268,7 @@ public class LoginPwdController extends BaseController {
String username, String verificationCode,
@RequestParam(value = "remember", defaultValue = "false") boolean remember) {
log.info(accessToken+":"+openid+":"+":"+username+":"+verificationCode + ":" + remember);
if (StringUtils.isBlank(accessToken) || StringUtils.isBlank(openid) || StringUtils.isBlank(username) || StringUtils.isBlank(verificationCode)) {
if (StringUtils.isBlank(username) || StringUtils.isBlank(verificationCode)) {
return ResponseData.error("绑定失败,授权失效或账号验证码为空!");
}
String str = stringRedisTemplate.opsForValue().get(username + GETPHONECODE);
......@@ -284,6 +284,9 @@ public class LoginPwdController extends BaseController {
if (users.size() == 0) {
return ResponseData.error("当前账号有误!");
}
SysUser sysUser = users.get(0);
// 没有openid和accessToken直接登录,不访问微信
if (StringUtils.isNotBlank(openid) && StringUtils.isNotBlank(accessToken)) {
log.info("openId:"+openid);
String url1 = "https://api.weixin.qq.com/sns/userinfo?access_token="+accessToken+"&openid="+openid+"&lang=zh_CN";
String jsonObject1 = null;
......@@ -302,7 +305,6 @@ public class LoginPwdController extends BaseController {
Map<String,Object> map1 = JSON.parseObject(jsonObject1, Map.class);
String headimgurl = map1.get("headimgurl").toString();
String nickname = map1.get("nickname").toString();
SysUser sysUser = users.get(0);
Wrapper wrapper = new EntityWrapper<>();
wrapper.eq("id", sysUser.getId());
Map<String, Object> dataMapping = new HashMap<>();
......@@ -317,6 +319,19 @@ public class LoginPwdController extends BaseController {
if (integer == 1) {
return this.loginvalid(null, sysUser.getAccount(), openid);
}
}else{
// 查询openid,模拟微信登录
HhrUser hhrUser = hhrUserMapper.selectById(sysUser.getId());
if (hhrUser == null) {
return ResponseData.error("合伙人信息有误!");
}
if (StringUtils.isBlank(hhrUser.getOpenId())) {
return ResponseData.error("请先在一人一码中绑定微信登录");
}
return this.loginvalid(null, sysUser.getAccount(), hhrUser.getOpenId());
}
return ResponseData.error("绑定失败!");
}
......
......@@ -96,8 +96,8 @@ spring:
prohibition: 600
datasource:
url: jdbc:mysql://localhost:3306/school_center?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&allowPublicKeyRetrieval=true
username: yzzx
password: yzzx123!@#
username: root
password: AMrGBg6ZSsRrDLs6
#用来搜集数据库的所有表
db-name: guns
filters: wall,mergeStat
......
......@@ -131,9 +131,9 @@ spring:
max-active: 30
datasource:
master:
url: jdbc:mysql://localhost:3306/school_center?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&allowPublicKeyRetrieval=true
username: yzzx
password: yzzx123!@#
url: ${spring.datasource.url}
username: ${spring.datasource.username}
password: ${spring.datasource.password}
driver-class-name: com.mysql.cj.jdbc.Driver
devtools:
restart:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment