Commit 3e894816 by 唐功亮

【修改】 前台登录 手机用户返回条码卡号

【新增】 修改企业信息(不需要审批)
parent 070e2e88
......@@ -17,6 +17,7 @@ import io.office.common.utils.PageUtils;
import io.office.common.utils.R;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
/**
......@@ -44,11 +45,11 @@ public class LogLoginController {
@Login
// @RequiresPermissions("manage:member:list")
public R login(@RequestBody Map<String, Object> params, HttpServletRequest request, HttpServletResponse response){
DomesticCodeVo domesticCodeVo = new DomesticCodeVo(params.get("uuid").toString(),params.get("captcha").toString());
/* DomesticCodeVo domesticCodeVo = new DomesticCodeVo(params.get("uuid").toString(),params.get("captcha").toString());
boolean captcha = sysCaptchaService.validate(domesticCodeVo.getUuid(), domesticCodeVo.getCaptcha());
if(!captcha){
return R.error("验证码不正确");
}
}*/
return R.ok().put("data",logLoginService.login(params,request,response));
}
......
......@@ -12,6 +12,7 @@ import io.office.modules.manage.dao.MemberDao;
import io.office.modules.manage.dao.TycpdmFirmDao;
import io.office.modules.manage.entity.MemberEntity;
import io.office.modules.manage.service.TycpdmFirmChangeService;
import io.office.modules.manage.utils.DESUtils;
import io.office.modules.manage.utils.MD5Util;
import io.office.modules.sys.controller.AbstractController;
import org.apache.commons.beanutils.BeanUtils;
......@@ -117,8 +118,12 @@ public class TycpdmFirmController extends AbstractController {
public static void main(String[] args) throws InvocationTargetException, IllegalAccessException {
String s = MD5Util.md5Encrypt32Upper("123123");
System.out.println(s);
/* String s = MD5Util.md5Encrypt32Upper("123123");
System.out.println(s);*/
String userName_M = DESUtils.byteToHexString(DESUtils.DES_CBC_Encrypt("13515718321".getBytes(),"loginkey".getBytes()));
String pass_M = DESUtils.byteToHexString(DESUtils.DES_CBC_Encrypt("718321".getBytes(),"loginkey".getBytes()));
System.out.println(userName_M);
System.out.println(pass_M);
}
/**
* 根据用户名获取企业认证信息
......@@ -138,12 +143,20 @@ public class TycpdmFirmController extends AbstractController {
/**
* 修改
*/
@RequestMapping("/update")
@RequestMapping("/authApi/update")
// @RequiresPermissions("manage:tycpdmfirm:update")
public R update(@RequestBody TycpdmFirmEntity tycpdmFirm){
public R update(@RequestBody Map body){
TycpdmFirmEntity tycpdmFirm = new TycpdmFirmEntity();
try {
BeanUtils.populate(tycpdmFirm, body);
Integer fId = Integer.valueOf(String.valueOf(body.get("fId")));
tycpdmFirm.setFId(fId);
tycpdmFirmService.updateById(tycpdmFirm);
return R.ok();
} catch (Exception e) {
e.printStackTrace();
return R.error("修改失败");
}
}
/**
......
......@@ -99,7 +99,10 @@ public class LogLoginServiceImpl extends ServiceImpl<LogLoginDao, LogLoginEntity
search="manager";
phone=userName;
//TODO tgl 需要中国编码官网提供 条码卡数据 来判断是否是系统用户
JSONObject data = jsonObject.getJSONObject("data");
if (data!=null){
carno = data.getString("gdsCode");
}
}
}
}else {
......@@ -156,6 +159,7 @@ public class LogLoginServiceImpl extends ServiceImpl<LogLoginDao, LogLoginEntity
jsonObject.put("isQY",isQY);
jsonObject.put("isXT",isXT);
jsonObject.put("id",id);
jsonObject.put("carno",carno);
R token = sysUserTokenService.createToken("qianduan_",id);//将token信息存入 数据库
Object token1 = token.get("token");
jsonObject.put("token",token1);
......
package io.office.modules.manage.utils;
import com.sun.mail.smtp.DigestMD5;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
......@@ -10,6 +12,7 @@ public class DESUtils {
public static final String Key="loginkey";
//DES加密
public static byte[] DES_CBC_Encrypt(byte[] content, byte[] keyBytes){
try {
DESKeySpec keySpec=new DESKeySpec(keyBytes);
......@@ -27,6 +30,34 @@ public class DESUtils {
return null;
}
//DES解密
public static byte[] DES_CBC_Decrypt(String content, byte[] keyBytes){
try {
byte [] content1=decodeUtil(content);
DESKeySpec keySpec=new DESKeySpec(keyBytes);
SecretKeyFactory keyFactory=SecretKeyFactory.getInstance("DES");
SecretKey key=keyFactory.generateSecret(keySpec);
Cipher cipher=Cipher.getInstance("DES/CBC/PKCS5Padding");
cipher.init(Cipher.DECRYPT_MODE, key, new IvParameterSpec(keyBytes));
byte[] result=cipher.doFinal(content1);
return result;
} catch (Exception e) {
// TODO Auto-generated catch block
System.out.println("exception:"+e.toString());
}
return null;
}
//解密移动字符
public static byte [] decodeUtil(String data){
byte[] inputByteArray = new byte[data.length() / 2];
for (int x = 0; x < data.length() / 2; x++)
{
inputByteArray[x] = (byte)(0xff & Integer.parseInt(data.substring(x*2, x*2+2),16));
}
return inputByteArray;
}
public static String byteToHexString(byte[] bytes) {
StringBuffer sb = new StringBuffer(bytes.length);
......@@ -40,5 +71,25 @@ public class DESUtils {
return sb.toString();
}
public static void main(String[] args) {
String userName="test_tru";
String password="123123";
String password_MD5="4297f44b13955235245b2497399d7a93";
String userName_M = DESUtils.byteToHexString(DESUtils.DES_CBC_Encrypt(userName.getBytes(),"appsGdsn".getBytes()));
String password_M = DESUtils.byteToHexString(DESUtils.DES_CBC_Encrypt(password.getBytes(),"appsGdsn".getBytes()));
String password_M_MD5 = DESUtils.byteToHexString(DESUtils.DES_CBC_Encrypt(password_MD5.getBytes(),"appsGdsn".getBytes()));
System.out.println(userName_M);
System.out.println(password_M);
System.out.println(password_M_MD5);
String aaa="88DA15B9F9F602F0D32D46808652B06DC6E939D1424CE39F69A2AC39743F7ED7591975685B543E1D";
//String s = new String(DESUtils.DES_CBC_Decrypt(aaa, "appsGdsn".getBytes()));
String s = new String(DESUtils.DES_CBC_Decrypt(aaa, "appsGdsn".getBytes()));
System.out.println("解密"+s);
String s1 = MD5Util.md5Encrypt32Upper(-2 + "{regist_or_login_from_ancc}");
System.out.println(s1);
}
}
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