Commit 78cc8074 by 唐功亮

【修改】 数据无默认值 和打印IP语句

parent 9485e338
...@@ -36,7 +36,7 @@ public interface MemberDao extends BaseMapper<MemberEntity> { ...@@ -36,7 +36,7 @@ public interface MemberDao extends BaseMapper<MemberEntity> {
@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}") @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); Integer selectCode_agen(@Param("userName") String userName);
@Select("INSERT INTO useraccess (UserName,GroupId,rights) values (#{userName},1,'100,')") @Select("INSERT INTO useraccess (UserName,GroupId,rights,Credit) values (#{userName},1,'100,','70')")
void insertUserAccess(@Param("userName")String userName); void insertUserAccess(@Param("userName")String userName);
@Update("UPDATE member SET phone = #{phone} WHERE id = #{id}") @Update("UPDATE member SET phone = #{phone} WHERE id = #{id}")
......
...@@ -116,11 +116,18 @@ public class MemberServiceImpl extends ServiceImpl<MemberDao, MemberEntity> impl ...@@ -116,11 +116,18 @@ public class MemberServiceImpl extends ServiceImpl<MemberDao, MemberEntity> impl
memberEntity.setOicq(""); memberEntity.setOicq("");
memberEntity.setPassword(passWord); memberEntity.setPassword(passWord);
memberEntity.setRegisterip(IPUtils.getIpAddr(request)); memberEntity.setRegisterip(IPUtils.getIpAddr(request));
System.out.println("注册IP为:"+IPUtils.getIpAddr(request));
memberEntity.setRegisterdate(new Date());
memberEntity.setUpdatedate(new Date());
memberEntity.setLevels(1);
memberEntity.setLasttime(new Date());
memberDao.insert(memberEntity); memberDao.insert(memberEntity);
memberDao.insertUserAccess(userName); memberDao.insertUserAccess(userName);
} }
@Override @Override
public void updatePass(Map<String, Object> params) { public void updatePass(Map<String, Object> params) {
String id = params.get("id") == null ? "" : String.valueOf(params.get("id"));//用户ID String id = params.get("id") == null ? "" : String.valueOf(params.get("id"));//用户ID
......
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