lyq 5 月之前
父節點
當前提交
4b11bd9777

+ 1 - 0
src/main/java/com/sooka/module/web/system/service/impl/CmsUserServiceImpl.java

@@ -116,6 +116,7 @@ public class CmsUserServiceImpl implements CmsUserService {
             user.setSalt(randomSalt());
             user.setPassword(encryptPassword(user.getUsername(), user.getPassword(), user.getSalt()));
         }
+        user.setCreateTime(new Date());
         if (userMapper.insert(user) > 0) {
             return JsonUtil.toSUCCESS("注册成功");
         }

+ 1 - 0
src/main/resources/com/sooka/mybatis/mapper/TCmsUserMapper.xml

@@ -5,6 +5,7 @@
     <resultMap id="BaseResultMap" type="com.sooka.mybatis.model.TCmsUser">
         <id column="user_id" jdbcType="INTEGER" property="userId"/>
         <result column="username" jdbcType="VARCHAR" property="username"/>
+        <result column="nickname" jdbcType="VARCHAR" property="nickname"/>
         <result column="sex" jdbcType="VARCHAR" property="sex"/>
         <result column="idcard" jdbcType="VARCHAR" property="idcard"/>
         <result column="age" jdbcType="VARCHAR" property="age"/>

+ 28 - 28
src/main/resources/static/js/register/register.js

@@ -9,38 +9,38 @@ $(function () {
             return;
         }
         console.log({
-            username: username,
-            password: password,
-            nickname: nickname,
-            sex: $("input[name='sex']").filter(":checked").val(),
-            idcard: $("input[name='idcard']").val(),
-            age: $("input[name='age']").val(),
-            height: $("input[name='height']").val(),
-            weight: $("input[name='weight']").val(),
-            eduBg: $("select[name='eduBg']").val(),
-            auth: $("input[name='auth']").val(),
-            plan: $("select[name='plan']").val(),
-            post: $("input[name='post']").val(),
-            isPost: $("input[name='isPost']").filter(":checked").val(),
-            city: $("select[name='city']").val()
+            "username": username,
+            "password": password,
+            "nickname": nickname,
+            "sex": $("input[name='sex']").filter(":checked").val(),
+            "idcard": $("input[name='idcard']").val(),
+            "age": $("input[name='age']").val(),
+            "height": $("input[name='height']").val(),
+            "weight": $("input[name='weight']").val(),
+            "eduBg": $("select[name='eduBg']").val(),
+            "auth": $("input[name='auth']").val(),
+            "plan": $("select[name='plan']").val(),
+            "post": $("input[name='post']").val(),
+            "isPost": $("input[name='isPost']").filter(":checked").val(),
+            "city": $("select[name='city']").val()
         });
         show_loading();
         // ajax提交表单,#login_form为表单的ID。如:$('#login_form').ajaxSubmit(function(data)
         $.post("/register", {
-            username: username,
-            password: password,
-            nickname: nickname,
-            sex: $("input[name='sex']").val(),
-            idcard: $("input[name='idcard']").val(),
-            age: $("input[name='age']").val(),
-            height: $("input[name='height']").val(),
-            weight: $("input[name='weight']").val(),
-            eduBg: $("input[name='eduBg']").val(),
-            auth: $("input[name='auth']").val(),
-            plan: $("input[name='plan']").val(),
-            post: $("input[name='post']").val(),
-            isPost: $("input[name='isPost']").val(),
-            city: $("input[name='city']").val()
+            "username": username,
+            "password": password,
+            "nickname": nickname,
+            "sex": $("input[name='sex']").filter(":checked").val(),
+            "idcard": $("input[name='idcard']").val(),
+            "age": $("input[name='age']").val(),
+            "height": $("input[name='height']").val(),
+            "weight": $("input[name='weight']").val(),
+            "eduBg": $("select[name='eduBg']").val(),
+            "auth": $("input[name='auth']").val(),
+            "plan": $("select[name='plan']").val(),
+            "post": $("input[name='post']").val(),
+            "isPost": $("input[name='isPost']").filter(":checked").val(),
+            "city": $("select[name='city']").val()
         }, function (data) {
             var obj = eval(data);
             if (obj.statusCode == 200) {