| | |
| | | public AjaxResult getCode(HttpServletResponse response) throws IOException
|
| | | {
|
| | | AjaxResult ajax = AjaxResult.success();
|
| | | boolean captchaOnOff = configService.selectCaptchaOnOff();
|
| | | ajax.put("captchaOnOff", captchaOnOff);
|
| | | if (!captchaOnOff)
|
| | | boolean captchaEnabled = configService.selectCaptchaEnabled();
|
| | | ajax.put("captchaEnabled", captchaEnabled);
|
| | | if (!captchaEnabled)
|
| | | {
|
| | | return ajax;
|
| | | }
|
| | |
| | | */
|
| | | public String login(String username, String password, String code, String uuid)
|
| | | {
|
| | | boolean captchaOnOff = configService.selectCaptchaOnOff();
|
| | | boolean captchaEnabled = configService.selectCaptchaEnabled();
|
| | | // 验证码开关
|
| | | if (captchaOnOff)
|
| | | if (captchaEnabled)
|
| | | {
|
| | | validateCaptcha(username, code, uuid);
|
| | | }
|
| | |
| | | {
|
| | | String msg = "", username = registerBody.getUsername(), password = registerBody.getPassword();
|
| | |
|
| | | boolean captchaOnOff = configService.selectCaptchaOnOff();
|
| | | boolean captchaEnabled = configService.selectCaptchaEnabled();
|
| | | // 验证码开关
|
| | | if (captchaOnOff)
|
| | | if (captchaEnabled)
|
| | | {
|
| | | validateCaptcha(username, registerBody.getCode(), registerBody.getUuid());
|
| | | }
|
| | |
| | | *
|
| | | * @return true开启,false关闭
|
| | | */
|
| | | public boolean selectCaptchaOnOff();
|
| | | public boolean selectCaptchaEnabled();
|
| | |
|
| | | /**
|
| | | * 查询参数配置列表
|
| | |
| | | * @return true开启,false关闭
|
| | | */
|
| | | @Override
|
| | | public boolean selectCaptchaOnOff()
|
| | | public boolean selectCaptchaEnabled()
|
| | | {
|
| | | String captchaOnOff = selectConfigByKey("sys.account.captchaOnOff");
|
| | | if (StringUtils.isEmpty(captchaOnOff))
|
| | | String captchaEnabled = selectConfigByKey("sys.account.captchaEnabled");
|
| | | if (StringUtils.isEmpty(captchaEnabled))
|
| | | {
|
| | | return true;
|
| | | }
|
| | | return Convert.toBool(captchaOnOff);
|
| | | return Convert.toBool(captchaEnabled);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | <svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
|
| | | </el-input>
|
| | | </el-form-item>
|
| | | <el-form-item prop="code" v-if="captchaOnOff">
|
| | | <el-form-item prop="code" v-if="captchaEnabled">
|
| | | <el-input
|
| | | v-model="loginForm.code"
|
| | | auto-complete="off"
|
| | |
| | | },
|
| | | loading: false,
|
| | | // 验证码开关
|
| | | captchaOnOff: true,
|
| | | captchaEnabled: true,
|
| | | // 注册开关
|
| | | register: false,
|
| | | redirect: undefined
|
| | |
| | | methods: {
|
| | | getCode() {
|
| | | getCodeImg().then(res => {
|
| | | this.captchaOnOff = res.captchaOnOff === undefined ? true : res.captchaOnOff;
|
| | | if (this.captchaOnOff) {
|
| | | this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled;
|
| | | if (this.captchaEnabled) {
|
| | | this.codeUrl = "data:image/gif;base64," + res.img;
|
| | | this.loginForm.uuid = res.uuid;
|
| | | }
|
| | |
| | | this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
|
| | | }).catch(() => {
|
| | | this.loading = false;
|
| | | if (this.captchaOnOff) {
|
| | | if (this.captchaEnabled) {
|
| | | this.getCode();
|
| | | }
|
| | | });
|
| | |
| | | <el-input v-model="user.newPassword" placeholder="请输入新密码" type="password" show-password/>
|
| | | </el-form-item>
|
| | | <el-form-item label="确认密码" prop="confirmPassword">
|
| | | <el-input v-model="user.confirmPassword" placeholder="请确认密码" type="password" show-password/>
|
| | | <el-input v-model="user.confirmPassword" placeholder="请确认新密码" type="password" show-password/>
|
| | | </el-form-item>
|
| | | <el-form-item>
|
| | | <el-button type="primary" size="mini" @click="submit">保存</el-button>
|
文件名从 sql/ry_20220625.sql 修改 |
| | |
| | | insert into sys_config values(1, '主框架页-默认皮肤样式名称', 'sys.index.skinName', 'skin-blue', 'Y', 'admin', sysdate(), '', null, '蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow' ); |
| | | insert into sys_config values(2, '用户管理-账号初始密码', 'sys.user.initPassword', '123456', 'Y', 'admin', sysdate(), '', null, '初始化密码 123456' ); |
| | | insert into sys_config values(3, '主框架页-侧边栏主题', 'sys.index.sideTheme', 'theme-dark', 'Y', 'admin', sysdate(), '', null, '深色主题theme-dark,浅色主题theme-light' ); |
| | | insert into sys_config values(4, '账号自助-验证码开关', 'sys.account.captchaOnOff', 'true', 'Y', 'admin', sysdate(), '', null, '是否开启验证码功能(true开启,false关闭)'); |
| | | insert into sys_config values(4, '账号自助-验证码开关', 'sys.account.captchaEnabled', 'true', 'Y', 'admin', sysdate(), '', null, '是否开启验证码功能(true开启,false关闭)');
|
| | | insert into sys_config values(5, '账号自助-是否开启用户注册功能', 'sys.account.registerUser', 'false', 'Y', 'admin', sysdate(), '', null, '是否开启注册用户功能(true开启,false关闭)'); |
| | | |
| | | |