ソースを参照

feat[litemall-admin, litemal-admin-api]: 取消验证码相关逻辑。

linlinjava 4 年 前
コミット
27bf4fae07

+ 10 - 10
litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminAuthController.java

@@ -88,20 +88,20 @@ public class AdminAuthController {
     public Object login(@RequestBody String body, HttpServletRequest request) {
         String username = JacksonUtil.parseString(body, "username");
         String password = JacksonUtil.parseString(body, "password");
-        String code = JacksonUtil.parseString(body, "code");
+//        String code = JacksonUtil.parseString(body, "code");
 
         if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password)) {
             return ResponseUtil.badArgument();
         }
-        if (StringUtils.isEmpty(code)) {
-            return ResponseUtil.fail(ADMIN_INVALID_KAPTCHA_REQUIRED, "验证码不能空");
-        }
-
-        HttpSession session = request.getSession();
-        String kaptcha = (String)session.getAttribute("kaptcha");
-        if (Objects.requireNonNull(code).compareToIgnoreCase(kaptcha) != 0) {
-            return ResponseUtil.fail(ADMIN_INVALID_KAPTCHA, "验证码不正确", doKaptcha(request));
-        }
+//        if (StringUtils.isEmpty(code)) {
+//            return ResponseUtil.fail(ADMIN_INVALID_KAPTCHA_REQUIRED, "验证码不能空");
+//        }
+
+//        HttpSession session = request.getSession();
+//        String kaptcha = (String)session.getAttribute("kaptcha");
+//        if (Objects.requireNonNull(code).compareToIgnoreCase(kaptcha) != 0) {
+//            return ResponseUtil.fail(ADMIN_INVALID_KAPTCHA, "验证码不正确", doKaptcha(request));
+//        }
 
         Subject currentUser = SecurityUtils.getSubject();
         try {

+ 3 - 3
litemall-admin/src/views/login/index.vue

@@ -18,7 +18,7 @@
         <el-input v-model="loginForm.password" :type="passwordType" name="password" auto-complete="on" tabindex="2" show-password placeholder="管理员密码" @keyup.enter.native="handleLogin" />
       </el-form-item>
 
-      <el-form-item prop="code">
+      <!-- <el-form-item prop="code">
         <span class="svg-container">
           <svg-icon icon-class="lock" />
         </span>
@@ -26,7 +26,7 @@
         <div class="login-code">
           <img :src="codeImg" @click="getCode">
         </div>
-      </el-form-item>
+      </el-form-item> -->
 
       <el-button :loading="loading" type="primary" style="width:100%;margin-bottom:30px;" @click.native.prevent="handleLogin">登录</el-button>
 
@@ -47,7 +47,7 @@
     </el-form>
 
     <div class="copyright">
-      Copyright © 2020 xxx.com 版权所有 <a href="http://www.example.com/">沪ICP备xxx号</a>
+      Copyright © 2021 xxx.com 版权所有 <a href="https://github.com/linlinjava/litemall">沪ICP备xxx号</a>
     </div>
   </div>
 </template>