Commit 652f611a by 唐功亮

【修改】 手机用户登录token判断

parent 37de9b36
......@@ -90,7 +90,7 @@ public class MemberController extends AbstractController {
@RequestMapping("/authApi/info")
// @RequiresPermissions("manage:member:info")
public R info(){
Integer memberUserId = getMemberUserId();
Long memberUserId = getMemberUserId();
MemberEntity member = memberService.getById(memberUserId);
return R.ok().put("data", member);
......
......@@ -238,7 +238,7 @@ public class TycpdmFirmController extends AbstractController {
// @RequiresPermissions("manage:tycpdmfirm:delete")
public R audit(@RequestBody Map map){
MemberEntity memberUser = getMemberUser();
Integer memberUserId = getMemberUserId();
Long memberUserId = getMemberUserId();
try {
tycpdmFirmService.audit(map,memberUserId,memberUser.getUsername());
} catch (InvocationTargetException e) {
......@@ -289,7 +289,7 @@ public class TycpdmFirmController extends AbstractController {
Object id = params.get("id");
MemberEntity memberEntity=null;
if (id!=null){
memberEntity = memberDao.selectById(id.toString());
memberEntity = memberDao.selectById(Long.valueOf(id+""));
}
String url= tycpdmFirmService.redirectGDSURL(memberEntity,params);
try {
......@@ -327,7 +327,11 @@ public class TycpdmFirmController extends AbstractController {
public R redirectBusinessHall(@RequestBody Map<String, Object> params){
//由于member表中没有手机用户的信息 通过memberDao获取
Object id = params.get("id");
MemberEntity memberEntity = memberDao.selectById(id.toString());
/*MemberEntity memberEntity = memberDao.selectById(Long.valueOf(id.toString()));
if (memberEntity==null){
memberEntity=new MemberEntity();
}*/
MemberEntity memberEntity = getMemberUser();
String url= tycpdmFirmService.redirectBusinessHall(params,memberEntity);
try {
//response.sendRedirect(url);
......
......@@ -31,7 +31,7 @@ public interface MemberDao extends BaseMapper<MemberEntity> {
MemberEntity selectByName(@Param("userName") String userName);
@Update("UPDATE member SET pass = #{passWord} WHERE id = #{id}")
void updateByIdPassWord(@Param("id") Integer id,@Param("passWord") String passWord);
void updateByIdPassWord(@Param("id") Long id,@Param("passWord") String passWord);
@Select("select b.code_agen as code_agen from member a left join MemAgent b on a.username=b.user_id where a.username=#{userName}")
Integer selectCode_agen(@Param("userName") String userName);
......
......@@ -23,7 +23,7 @@ public class MemberEntity implements Serializable {
* $column.comments
*/
@TableId
private Integer id;
private Long id;
/**
* $column.comments
*/
......
......@@ -39,7 +39,7 @@ public interface TycpdmFirmService extends IService<TycpdmFirmEntity> {
Page<TycpdmFirmEntity> findlist(Map<String, Object> params, Page page);
void audit(Map map,Integer memberUserId,String username) throws InvocationTargetException, IllegalAccessException;
void audit(Map map,Long memberUserId,String username) throws InvocationTargetException, IllegalAccessException;
int findLogoutFlag(String userName);
......
......@@ -74,7 +74,7 @@ public class LogLoginServiceImpl extends ServiceImpl<LogLoginDao, LogLoginEntity
Integer isQY=2; //是否开通企业认证 1.开通 2.未开通
Integer isXT=2; //是否是业务大厅系统成员 1.是 2.否
Integer id=-99; //用户ID
Long id=-99L; //用户ID
String search="ws2";// 用户来源 manager:业务大厅手机号用户 ws2:member表用户
String carno=null;// 条码卡号
String phone=null;//手机号码
......@@ -82,6 +82,8 @@ public class LogLoginServiceImpl extends ServiceImpl<LogLoginDao, LogLoginEntity
if (matchPhoneNumber(userName)){
//用第三方登录接口
userType=1;
System.out.println("用户名称:"+userName);
id=Long.valueOf(userName);
//对 用户名密码进行DES加密
String phoen_M = DESUtils.byteToHexString(DESUtils.DES_CBC_Encrypt(userName.getBytes(),DESUtils.Key.getBytes()));
String passwrod_M = DESUtils.byteToHexString(DESUtils.DES_CBC_Encrypt(passWord.getBytes(),DESUtils.Key.getBytes()));
......@@ -112,7 +114,7 @@ public class LogLoginServiceImpl extends ServiceImpl<LogLoginDao, LogLoginEntity
if (memberEntity==null){
throw new RRException("用户不存在!");
}
id=memberEntity.getId();
id=Long.valueOf(memberEntity.getId());
//用户类型 www:为官网用户 条码卡:为条码卡用户
String source = memberEntity.getSource();
String applystate = memberEntity.getApplystate();// 未申请:普通用户 通过审核:完成厂商实名认证
......
......@@ -169,7 +169,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberDao, MemberEntity> impl
throw new RRException("旧密码输入错误");
}
//修改密码
memberDao.updateByIdPassWord(Integer.valueOf(id), MD5Util.md5Encrypt32Lower(newPass));
memberDao.updateByIdPassWord(Long.valueOf(id), MD5Util.md5Encrypt32Lower(newPass));
}
@Override
......
......@@ -68,7 +68,7 @@ public class TimescodeFindpsServiceImpl extends ServiceImpl<TimescodeFindpsDao,
}
MemberEntity memberEntity = memberDao.selectByName(userName);
if (memberEntity!=null){
Integer id = memberEntity.getId();
Long id = memberEntity.getId();
String phone_DB = memberEntity.getPhone();
if (phone.equals(phone_DB)){
//获取6位随机字符串
......@@ -161,7 +161,7 @@ public class TimescodeFindpsServiceImpl extends ServiceImpl<TimescodeFindpsDao,
}
MemberEntity memberEntity = memberDao.selectByName(userName);
if (memberEntity!=null){
Integer id = memberEntity.getId();
Long id = memberEntity.getId();
String emiail_DB = memberEntity.getEmail();
if (emiail.equals(emiail_DB)){
//获取6位随机字符串
......
......@@ -232,7 +232,7 @@ public class TycpdmFirmServiceImpl extends ServiceImpl<TycpdmFirmDao, TycpdmFirm
@Override
@Transactional
public void audit(Map map,Integer memberUserId,String username) throws InvocationTargetException, IllegalAccessException {
public void audit(Map map,Long memberUserId,String username) throws InvocationTargetException, IllegalAccessException {
Integer status= map.get("status")==null?0: Integer.valueOf(String.valueOf(map.get("status")));//1.新增(新增时id为fId) 2.变更(id为fId)
String id= map.get("id")==null?"": String.valueOf(map.get("id"));//id
String auditStatus= map.get("auditStatus")==null?"": String.valueOf(map.get("auditStatus"));//审核状态 1.通过 2.不通过
......@@ -561,7 +561,7 @@ public class TycpdmFirmServiceImpl extends ServiceImpl<TycpdmFirmDao, TycpdmFirm
//用户类型 1.业务大厅(手机号用户) 2.业务大厅(条码卡成员) 3.官网用户
Integer userType = Integer.valueOf(String.valueOf(map.get("userType")));
if (userType==1){
phone=memberUser.getUsername();//手机号
phone=memberUser.getId()+"";//手机号
}else if (userType==2){
//调用另一个接口
phone=memberUser.getUsername();//条码卡号
......
......@@ -34,7 +34,7 @@ public abstract class AbstractController {
return (MemberEntity) SecurityUtils.getSubject().getPrincipal();
}
protected Integer getMemberUserId() {
protected Long getMemberUserId() {
return getMemberUser().getId();
}
}
......@@ -80,6 +80,11 @@ public class OAuth2Realm extends AuthorizingRealm {
if(accessToken.startsWith("qianduan_")) {
//todo
MemberEntity memberEntity = memberDao.selectById(tokenEntity.getUserId());
if (memberEntity==null){
memberEntity=new MemberEntity();
Long userId = tokenEntity.getUserId();
memberEntity.setId(userId);
}
info = new SimpleAuthenticationInfo(memberEntity, accessToken, getName());
} else {
user = shiroService.queryUser(tokenEntity.getUserId());
......
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