作者 RuoYi

修改验证码开关变量名

@@ -46,9 +46,9 @@ public class CaptchaController @@ -46,9 +46,9 @@ public class CaptchaController
46 public AjaxResult getCode(HttpServletResponse response) throws IOException 46 public AjaxResult getCode(HttpServletResponse response) throws IOException
47 { 47 {
48 AjaxResult ajax = AjaxResult.success(); 48 AjaxResult ajax = AjaxResult.success();
49 - boolean captchaOnOff = configService.selectCaptchaOnOff();  
50 - ajax.put("captchaOnOff", captchaOnOff);  
51 - if (!captchaOnOff) 49 + boolean captchaEnabled = configService.selectCaptchaEnabled();
  50 + ajax.put("captchaEnabled", captchaEnabled);
  51 + if (!captchaEnabled)
52 { 52 {
53 return ajax; 53 return ajax;
54 } 54 }
@@ -60,9 +60,9 @@ public class SysLoginService @@ -60,9 +60,9 @@ public class SysLoginService
60 */ 60 */
61 public String login(String username, String password, String code, String uuid) 61 public String login(String username, String password, String code, String uuid)
62 { 62 {
63 - boolean captchaOnOff = configService.selectCaptchaOnOff(); 63 + boolean captchaEnabled = configService.selectCaptchaEnabled();
64 // 验证码开关 64 // 验证码开关
65 - if (captchaOnOff) 65 + if (captchaEnabled)
66 { 66 {
67 validateCaptcha(username, code, uuid); 67 validateCaptcha(username, code, uuid);
68 } 68 }
@@ -42,9 +42,9 @@ public class SysRegisterService @@ -42,9 +42,9 @@ public class SysRegisterService
42 { 42 {
43 String msg = "", username = registerBody.getUsername(), password = registerBody.getPassword(); 43 String msg = "", username = registerBody.getUsername(), password = registerBody.getPassword();
44 44
45 - boolean captchaOnOff = configService.selectCaptchaOnOff(); 45 + boolean captchaEnabled = configService.selectCaptchaEnabled();
46 // 验证码开关 46 // 验证码开关
47 - if (captchaOnOff) 47 + if (captchaEnabled)
48 { 48 {
49 validateCaptcha(username, registerBody.getCode(), registerBody.getUuid()); 49 validateCaptcha(username, registerBody.getCode(), registerBody.getUuid());
50 } 50 }
@@ -31,7 +31,7 @@ public interface ISysConfigService @@ -31,7 +31,7 @@ public interface ISysConfigService
31 * 31 *
32 * @return true开启,false关闭 32 * @return true开启,false关闭
33 */ 33 */
34 - public boolean selectCaptchaOnOff(); 34 + public boolean selectCaptchaEnabled();
35 35
36 /** 36 /**
37 * 查询参数配置列表 37 * 查询参数配置列表
@@ -86,14 +86,14 @@ public class SysConfigServiceImpl implements ISysConfigService @@ -86,14 +86,14 @@ public class SysConfigServiceImpl implements ISysConfigService
86 * @return true开启,false关闭 86 * @return true开启,false关闭
87 */ 87 */
88 @Override 88 @Override
89 - public boolean selectCaptchaOnOff() 89 + public boolean selectCaptchaEnabled()
90 { 90 {
91 - String captchaOnOff = selectConfigByKey("sys.account.captchaOnOff");  
92 - if (StringUtils.isEmpty(captchaOnOff)) 91 + String captchaEnabled = selectConfigByKey("sys.account.captchaEnabled");
  92 + if (StringUtils.isEmpty(captchaEnabled))
93 { 93 {
94 return true; 94 return true;
95 } 95 }
96 - return Convert.toBool(captchaOnOff); 96 + return Convert.toBool(captchaEnabled);
97 } 97 }
98 98
99 /** 99 /**
@@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
23 <svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" /> 23 <svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
24 </el-input> 24 </el-input>
25 </el-form-item> 25 </el-form-item>
26 - <el-form-item prop="code" v-if="captchaOnOff"> 26 + <el-form-item prop="code" v-if="captchaEnabled">
27 <el-input 27 <el-input
28 v-model="loginForm.code" 28 v-model="loginForm.code"
29 auto-complete="off" 29 auto-complete="off"
@@ -89,7 +89,7 @@ export default { @@ -89,7 +89,7 @@ export default {
89 }, 89 },
90 loading: false, 90 loading: false,
91 // 验证码开关 91 // 验证码开关
92 - captchaOnOff: true, 92 + captchaEnabled: true,
93 // 注册开关 93 // 注册开关
94 register: false, 94 register: false,
95 redirect: undefined 95 redirect: undefined
@@ -110,8 +110,8 @@ export default { @@ -110,8 +110,8 @@ export default {
110 methods: { 110 methods: {
111 getCode() { 111 getCode() {
112 getCodeImg().then(res => { 112 getCodeImg().then(res => {
113 - this.captchaOnOff = res.captchaOnOff === undefined ? true : res.captchaOnOff;  
114 - if (this.captchaOnOff) { 113 + this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled;
  114 + if (this.captchaEnabled) {
115 this.codeUrl = "data:image/gif;base64," + res.img; 115 this.codeUrl = "data:image/gif;base64," + res.img;
116 this.loginForm.uuid = res.uuid; 116 this.loginForm.uuid = res.uuid;
117 } 117 }
@@ -144,7 +144,7 @@ export default { @@ -144,7 +144,7 @@ export default {
144 this.$router.push({ path: this.redirect || "/" }).catch(()=>{}); 144 this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
145 }).catch(() => { 145 }).catch(() => {
146 this.loading = false; 146 this.loading = false;
147 - if (this.captchaOnOff) { 147 + if (this.captchaEnabled) {
148 this.getCode(); 148 this.getCode();
149 } 149 }
150 }); 150 });
@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
7 <el-input v-model="user.newPassword" placeholder="请输入新密码" type="password" show-password/> 7 <el-input v-model="user.newPassword" placeholder="请输入新密码" type="password" show-password/>
8 </el-form-item> 8 </el-form-item>
9 <el-form-item label="确认密码" prop="confirmPassword"> 9 <el-form-item label="确认密码" prop="confirmPassword">
10 - <el-input v-model="user.confirmPassword" placeholder="请确认密码" type="password" show-password/> 10 + <el-input v-model="user.confirmPassword" placeholder="请确认密码" type="password" show-password/>
11 </el-form-item> 11 </el-form-item>
12 <el-form-item> 12 <el-form-item>
13 <el-button type="primary" size="mini" @click="submit">保存</el-button> 13 <el-button type="primary" size="mini" @click="submit">保存</el-button>