From 26b0dc336ac804d9b115bcb9606632cf0a07bd9f Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期三, 27 七月 2022 18:34:45 +0800 Subject: [PATCH] update 同步 ruoyi --- ruoyi-ui/src/views/system/dict/data.vue | 3 ruoyi-system/src/main/java/com/ruoyi/system/service/SysRegisterService.java | 4 ruoyi-common/src/main/java/com/ruoyi/common/exception/GlobalException.java | 104 +++++----- ruoyi-ui/src/views/system/user/profile/resetPwd.vue | 2 script/sql/ry_vue_4.X.sql | 12 ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/CacheController.java | 4 ruoyi-ui/src/store/index.js | 2 ruoyi-ui/src/layout/components/Settings/index.vue | 139 +++++++------ ruoyi-generator/src/main/resources/vm/vue/v3/index.vue.vm | 8 ruoyi-ui/src/store/getters.js | 1 ruoyi-ui/src/views/login.vue | 10 ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java | 2 ruoyi-ui/src/views/register.vue | 10 ruoyi-common/src/main/java/com/ruoyi/common/exception/ServiceException.java | 130 ++++++------ ruoyi-system/src/main/java/com/ruoyi/system/service/SysLoginService.java | 4 script/sql/postgres/postgres_ry_vue_4.X.sql | 2 ruoyi-ui/src/views/system/dict/index.vue | 1 script/sql/sqlserver/sqlserver_ry_vue_4.X.sql | 2 script/sql/oracle/oracle_ry_vue_4.X.sql | 8 ruoyi-ui/src/store/modules/dict.js | 50 +++++ ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java | 6 ruoyi-ui/src/components/RightPanel/index.vue | 43 ---- ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java | 8 ruoyi-ui/src/components/DictData/index.js | 30 ++ 24 files changed, 318 insertions(+), 267 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java index f4e7dff..2680c01 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java @@ -79,9 +79,9 @@ @GetMapping("/captchaImage") public R<Map<String, Object>> getCode() { Map<String, Object> ajax = new HashMap<>(); - boolean captchaOnOff = configService.selectCaptchaOnOff(); - ajax.put("captchaOnOff", captchaOnOff); - if (!captchaOnOff) { + boolean captchaEnabled = configService.selectCaptchaEnabled(); + ajax.put("captchaEnabled", captchaEnabled); + if (!captchaEnabled) { return R.ok(ajax); } // 淇濆瓨楠岃瘉鐮佷俊鎭� diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/CacheController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/CacheController.java index 0f82c4e..55b6ac0 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/CacheController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/CacheController.java @@ -87,8 +87,8 @@ @SaCheckPermission("monitor:cache:list") @GetMapping("/getKeys/{cacheName}") public R<Collection<String>> getCacheKeys(@PathVariable String cacheName) { - Collection<String> cacheKyes = RedisUtils.keys(cacheName + "*"); - return R.ok(cacheKyes); + Collection<String> cacheKeys = RedisUtils.keys(cacheName + "*"); + return R.ok(cacheKeys); } /** diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/exception/GlobalException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/GlobalException.java index 5584cbc..080785c 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/exception/GlobalException.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/exception/GlobalException.java @@ -1,52 +1,52 @@ -package com.ruoyi.common.exception; - -/** - * 鍏ㄥ眬寮傚父 - * - * @author ruoyi - */ -public class GlobalException extends RuntimeException { - - private static final long serialVersionUID = 1L; - - /** - * 閿欒鎻愮ず - */ - private String message; - - /** - * 閿欒鏄庣粏锛屽唴閮ㄨ皟璇曢敊璇� - * <p> - * 鍜� {@link CommonResult#getDetailMessage()} 涓�鑷寸殑璁捐 - */ - private String detailMessage; - - /** - * 绌烘瀯閫犳柟娉曪紝閬垮厤鍙嶅簭鍒楀寲闂 - */ - public GlobalException() { - } - - public GlobalException(String message) { - this.message = message; - } - - public String getDetailMessage() { - return detailMessage; - } - - public GlobalException setDetailMessage(String detailMessage) { - this.detailMessage = detailMessage; - return this; - } - - @Override - public String getMessage() { - return message; - } - - public GlobalException setMessage(String message) { - this.message = message; - return this; - } -} \ No newline at end of file +package com.ruoyi.common.exception; + +/** + * 鍏ㄥ眬寮傚父 + * + * @author ruoyi + */ +public class GlobalException extends RuntimeException { + + private static final long serialVersionUID = 1L; + + /** + * 閿欒鎻愮ず + */ + private String message; + + /** + * 閿欒鏄庣粏锛屽唴閮ㄨ皟璇曢敊璇� + * <p> + * 鍜� {@link CommonResult#getDetailMessage()} 涓�鑷寸殑璁捐 + */ + private String detailMessage; + + /** + * 绌烘瀯閫犳柟娉曪紝閬垮厤鍙嶅簭鍒楀寲闂 + */ + public GlobalException() { + } + + public GlobalException(String message) { + this.message = message; + } + + public String getDetailMessage() { + return detailMessage; + } + + public GlobalException setDetailMessage(String detailMessage) { + this.detailMessage = detailMessage; + return this; + } + + @Override + public String getMessage() { + return message; + } + + public GlobalException setMessage(String message) { + this.message = message; + return this; + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/exception/ServiceException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/ServiceException.java index 95ce6d8..53f41b3 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/exception/ServiceException.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/exception/ServiceException.java @@ -1,65 +1,65 @@ -package com.ruoyi.common.exception; - -/** - * 涓氬姟寮傚父 - * - * @author ruoyi - */ -public final class ServiceException extends RuntimeException { - private static final long serialVersionUID = 1L; - - /** - * 閿欒鐮� - */ - private Integer code; - - /** - * 閿欒鎻愮ず - */ - private String message; - - /** - * 閿欒鏄庣粏锛屽唴閮ㄨ皟璇曢敊璇� - * <p> - * 鍜� {@link CommonResult#getDetailMessage()} 涓�鑷寸殑璁捐 - */ - private String detailMessage; - - /** - * 绌烘瀯閫犳柟娉曪紝閬垮厤鍙嶅簭鍒楀寲闂 - */ - public ServiceException() { - } - - public ServiceException(String message) { - this.message = message; - } - - public ServiceException(String message, Integer code) { - this.message = message; - this.code = code; - } - - public String getDetailMessage() { - return detailMessage; - } - - @Override - public String getMessage() { - return message; - } - - public Integer getCode() { - return code; - } - - public ServiceException setMessage(String message) { - this.message = message; - return this; - } - - public ServiceException setDetailMessage(String detailMessage) { - this.detailMessage = detailMessage; - return this; - } -} \ No newline at end of file +package com.ruoyi.common.exception; + +/** + * 涓氬姟寮傚父 + * + * @author ruoyi + */ +public final class ServiceException extends RuntimeException { + private static final long serialVersionUID = 1L; + + /** + * 閿欒鐮� + */ + private Integer code; + + /** + * 閿欒鎻愮ず + */ + private String message; + + /** + * 閿欒鏄庣粏锛屽唴閮ㄨ皟璇曢敊璇� + * <p> + * 鍜� {@link CommonResult#getDetailMessage()} 涓�鑷寸殑璁捐 + */ + private String detailMessage; + + /** + * 绌烘瀯閫犳柟娉曪紝閬垮厤鍙嶅簭鍒楀寲闂 + */ + public ServiceException() { + } + + public ServiceException(String message) { + this.message = message; + } + + public ServiceException(String message, Integer code) { + this.message = message; + this.code = code; + } + + public String getDetailMessage() { + return detailMessage; + } + + @Override + public String getMessage() { + return message; + } + + public Integer getCode() { + return code; + } + + public ServiceException setMessage(String message) { + this.message = message; + return this; + } + + public ServiceException setDetailMessage(String detailMessage) { + this.detailMessage = detailMessage; + return this; + } +} diff --git a/ruoyi-generator/src/main/resources/vm/vue/v3/index.vue.vm b/ruoyi-generator/src/main/resources/vm/vue/v3/index.vue.vm index 6c9cdd6..64adcb4 100644 --- a/ruoyi-generator/src/main/resources/vm/vue/v3/index.vue.vm +++ b/ruoyi-generator/src/main/resources/vm/vue/v3/index.vue.vm @@ -492,8 +492,8 @@ function handleUpdate(row) { loading.value = true reset(); - const ${pkColumn.javaField} = row.${pkColumn.javaField} || ids.value - get${BusinessName}(${pkColumn.javaField}).then(response => { + const _${pkColumn.javaField} = row.${pkColumn.javaField} || ids.value + get${BusinessName}(_${pkColumn.javaField}).then(response => { loading.value = false; form.value = response.data; #foreach ($column in $columns) @@ -545,10 +545,10 @@ /** 鍒犻櫎鎸夐挳鎿嶄綔 */ function handleDelete(row) { - const ${pkColumn.javaField}s = row.${pkColumn.javaField} || ids.value; + const _${pkColumn.javaField}s = row.${pkColumn.javaField} || ids.value; proxy.#[[$modal]]#.confirm('鏄惁纭鍒犻櫎${functionName}缂栧彿涓�"' + ${pkColumn.javaField}s + '"鐨勬暟鎹」锛�').then(function() { loading.value = true; - return del${BusinessName}(${pkColumn.javaField}s); + return del${BusinessName}(_${pkColumn.javaField}s); }).then(() => { loading.value = true; getList(); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java index 10c4acd..f957b5b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java @@ -37,7 +37,7 @@ * * @return true寮�鍚紝false鍏抽棴 */ - boolean selectCaptchaOnOff(); + boolean selectCaptchaEnabled(); /** * 鏌ヨ鍙傛暟閰嶇疆鍒楄〃 diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/SysLoginService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/SysLoginService.java index 5a43203..acb27b7 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/SysLoginService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/SysLoginService.java @@ -59,9 +59,9 @@ */ public String login(String username, String password, String code, String uuid) { HttpServletRequest request = ServletUtils.getRequest(); - boolean captchaOnOff = configService.selectCaptchaOnOff(); + boolean captchaEnabled = configService.selectCaptchaEnabled(); // 楠岃瘉鐮佸紑鍏� - if (captchaOnOff) { + if (captchaEnabled) { validateCaptcha(username, code, uuid, request); } SysUser user = loadUserByUsername(username); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/SysRegisterService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/SysRegisterService.java index cefe4f7..6d861e0 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/SysRegisterService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/SysRegisterService.java @@ -43,9 +43,9 @@ // 鏍¢獙鐢ㄦ埛绫诲瀷鏄惁瀛樺湪 String userType = UserType.getUserType(registerBody.getUserType()).getUserType(); - boolean captchaOnOff = configService.selectCaptchaOnOff(); + boolean captchaEnabled = configService.selectCaptchaEnabled(); // 楠岃瘉鐮佸紑鍏� - if (captchaOnOff) { + if (captchaEnabled) { validateCaptcha(username, registerBody.getCode(), registerBody.getUuid(), request); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java index ab6a826..010c3be 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java @@ -87,12 +87,12 @@ * @return true寮�鍚紝false鍏抽棴 */ @Override - public boolean selectCaptchaOnOff() { - String captchaOnOff = selectConfigByKey("sys.account.captchaOnOff"); - if (StringUtils.isEmpty(captchaOnOff)) { + public boolean selectCaptchaEnabled() { + String captchaEnabled = selectConfigByKey("sys.account.captchaEnabled"); + if (StringUtils.isEmpty(captchaEnabled)) { return true; } - return Convert.toBool(captchaOnOff); + return Convert.toBool(captchaEnabled); } /** diff --git a/ruoyi-ui/src/components/DictData/index.js b/ruoyi-ui/src/components/DictData/index.js index 24e3e9c..d43d816 100644 --- a/ruoyi-ui/src/components/DictData/index.js +++ b/ruoyi-ui/src/components/DictData/index.js @@ -1,6 +1,22 @@ import Vue from 'vue' +import store from '@/store' import DataDict from '@/utils/dict' import { getDicts as getDicts } from '@/api/system/dict/data' + +function searchDictByKey(dict, key) { + if (key == null && key == "") { + return null + } + try { + for (let i = 0; i < dict.length; i++) { + if (dict[i].key == key) { + return dict[i].value + } + } + } catch (e) { + return null + } +} function install() { Vue.use(DataDict, { @@ -9,7 +25,19 @@ labelField: 'dictLabel', valueField: 'dictValue', request(dictMeta) { - return getDicts(dictMeta.type).then(res => res.data) + const storeDict = searchDictByKey(store.getters.dict, dictMeta.type) + if (storeDict) { + return new Promise(resolve => { resolve(storeDict) }) + } else { + return new Promise((resolve, reject) => { + getDicts(dictMeta.type).then(res => { + store.dispatch('dict/setDict', { key: dictMeta.type, value: res.data }) + resolve(res.data) + }).catch(error => { + reject(error) + }) + }) + } }, }, }, diff --git a/ruoyi-ui/src/components/RightPanel/index.vue b/ruoyi-ui/src/components/RightPanel/index.vue index fbf27eb..2d6122b 100644 --- a/ruoyi-ui/src/components/RightPanel/index.vue +++ b/ruoyi-ui/src/components/RightPanel/index.vue @@ -1,5 +1,5 @@ <template> - <div ref="rightPanel" :class="{show:show}" class="rightPanel-container"> + <div ref="rightPanel" class="rightPanel-container"> <div class="rightPanel-background" /> <div class="rightPanel"> <div class="rightPanel-items"> @@ -10,18 +10,12 @@ </template> <script> -import { addClass, removeClass } from '@/utils' - export default { name: 'RightPanel', props: { clickNotClose: { default: false, type: Boolean - }, - buttonTop: { - default: 250, - type: Number } }, computed: { @@ -35,20 +29,12 @@ value: val }) } - }, - theme() { - return this.$store.state.settings.theme - }, + } }, watch: { show(value) { if (value && !this.clickNotClose) { this.addEventClick() - } - if (value) { - addClass(document.body, 'showRightPanel') - } else { - removeClass(document.body, 'showRightPanel') } } }, @@ -65,7 +51,7 @@ window.addEventListener('click', this.closeSidebar) }, closeSidebar(evt) { - const parent = evt.target.closest('.rightPanel') + const parent = evt.target.closest('.el-drawer__body') if (!parent) { this.show = false window.removeEventListener('click', this.closeSidebar) @@ -79,14 +65,6 @@ } } </script> - -<style> -.showRightPanel { - overflow: hidden; - position: relative; - width: calc(100% - 15px); -} -</style> <style lang="scss" scoped> .rightPanel-background { @@ -111,21 +89,6 @@ transform: translate(100%); background: #fff; z-index: 40000; -} - -.show { - transition: all .3s cubic-bezier(.7, .3, .1, 1); - - .rightPanel-background { - z-index: 20000; - opacity: 1; - width: 100%; - height: 100%; - } - - .rightPanel { - transform: translate(0); - } } .handle-button { diff --git a/ruoyi-ui/src/layout/components/Settings/index.vue b/ruoyi-ui/src/layout/components/Settings/index.vue index f490b99..bb3c9ce 100644 --- a/ruoyi-ui/src/layout/components/Settings/index.vue +++ b/ruoyi-ui/src/layout/components/Settings/index.vue @@ -1,78 +1,76 @@ <template> - <div class="drawer-container"> - <div> - <div class="setting-drawer-content"> - <div class="setting-drawer-title"> - <h3 class="drawer-title">涓婚椋庢牸璁剧疆</h3> + <el-drawer size="280px" :visible="visible" :with-header="false" :append-to-body="true" :show-close="false"> + <div class="drawer-container"> + <div> + <div class="setting-drawer-content"> + <div class="setting-drawer-title"> + <h3 class="drawer-title">涓婚椋庢牸璁剧疆</h3> + </div> + <div class="setting-drawer-block-checbox"> + <div class="setting-drawer-block-checbox-item" @click="handleTheme('theme-dark')"> + <img src="@/assets/images/dark.svg" alt="dark"> + <div v-if="sideTheme === 'theme-dark'" class="setting-drawer-block-checbox-selectIcon" style="display: block;"> + <i aria-label="鍥炬爣: check" class="anticon anticon-check"> + <svg viewBox="64 64 896 896" data-icon="check" width="1em" height="1em" :fill="theme" aria-hidden="true" focusable="false" class=""> + <path d="M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 0 0-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"/> + </svg> + </i> + </div> + </div> + <div class="setting-drawer-block-checbox-item" @click="handleTheme('theme-light')"> + <img src="@/assets/images/light.svg" alt="light"> + <div v-if="sideTheme === 'theme-light'" class="setting-drawer-block-checbox-selectIcon" style="display: block;"> + <i aria-label="鍥炬爣: check" class="anticon anticon-check"> + <svg viewBox="64 64 896 896" data-icon="check" width="1em" height="1em" :fill="theme" aria-hidden="true" focusable="false" class=""> + <path d="M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 0 0-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"/> + </svg> + </i> + </div> + </div> + </div> + + <div class="drawer-item"> + <span>涓婚棰滆壊</span> + <theme-picker style="float: right;height: 26px;margin: -3px 8px 0 0;" @change="themeChange" /> + </div> </div> - <div class="setting-drawer-block-checbox"> - <div class="setting-drawer-block-checbox-item" @click="handleTheme('theme-dark')"> - <img src="@/assets/images/dark.svg" alt="dark"> - <div v-if="sideTheme === 'theme-dark'" class="setting-drawer-block-checbox-selectIcon" style="display: block;"> - <i aria-label="鍥炬爣: check" class="anticon anticon-check"> - <svg viewBox="64 64 896 896" data-icon="check" width="1em" height="1em" :fill="theme" aria-hidden="true" - focusable="false" class=""> - <path - d="M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 0 0-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"/> - </svg> - </i> - </div> - </div> - <div class="setting-drawer-block-checbox-item" @click="handleTheme('theme-light')"> - <img src="@/assets/images/light.svg" alt="light"> - <div v-if="sideTheme === 'theme-light'" class="setting-drawer-block-checbox-selectIcon" style="display: block;"> - <i aria-label="鍥炬爣: check" class="anticon anticon-check"> - <svg viewBox="64 64 896 896" data-icon="check" width="1em" height="1em" :fill="theme" aria-hidden="true" - focusable="false" class=""> - <path - d="M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 0 0-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"/> - </svg> - </i> - </div> - </div> + + <el-divider/> + + <h3 class="drawer-title">绯荤粺甯冨眬閰嶇疆</h3> + + <div class="drawer-item"> + <span>寮�鍚� TopNav</span> + <el-switch v-model="topNav" class="drawer-switch" /> </div> <div class="drawer-item"> - <span>涓婚棰滆壊</span> - <theme-picker style="float: right;height: 26px;margin: -3px 8px 0 0;" @change="themeChange" /> + <span>寮�鍚� Tags-Views</span> + <el-switch v-model="tagsView" class="drawer-switch" /> </div> + + <div class="drawer-item"> + <span>鍥哄畾 Header</span> + <el-switch v-model="fixedHeader" class="drawer-switch" /> + </div> + + <div class="drawer-item"> + <span>鏄剧ず Logo</span> + <el-switch v-model="sidebarLogo" class="drawer-switch" /> + </div> + + <div class="drawer-item"> + <span>鍔ㄦ�佹爣棰�</span> + <el-switch v-model="dynamicTitle" class="drawer-switch" /> + </div> + + <el-divider/> + + <el-button size="small" type="primary" plain icon="el-icon-document-add" @click="saveSetting">淇濆瓨閰嶇疆</el-button> + <el-button size="small" plain icon="el-icon-refresh" @click="resetSetting">閲嶇疆閰嶇疆</el-button> </div> - - <el-divider/> - - <h3 class="drawer-title">绯荤粺甯冨眬閰嶇疆</h3> - - <div class="drawer-item"> - <span>寮�鍚� TopNav</span> - <el-switch v-model="topNav" class="drawer-switch" /> - </div> - - <div class="drawer-item"> - <span>寮�鍚� Tags-Views</span> - <el-switch v-model="tagsView" class="drawer-switch" /> - </div> - - <div class="drawer-item"> - <span>鍥哄畾 Header</span> - <el-switch v-model="fixedHeader" class="drawer-switch" /> - </div> - - <div class="drawer-item"> - <span>鏄剧ず Logo</span> - <el-switch v-model="sidebarLogo" class="drawer-switch" /> - </div> - - <div class="drawer-item"> - <span>鍔ㄦ�佹爣棰�</span> - <el-switch v-model="dynamicTitle" class="drawer-switch" /> - </div> - - <el-divider/> - - <el-button size="small" type="primary" plain icon="el-icon-document-add" @click="saveSetting">淇濆瓨閰嶇疆</el-button> - <el-button size="small" plain icon="el-icon-refresh" @click="resetSetting">閲嶇疆閰嶇疆</el-button> </div> - </div> + </el-drawer> </template> <script> @@ -87,6 +85,11 @@ }; }, computed: { + visible: { + get() { + return this.$store.state.settings.showSettings + } + }, fixedHeader: { get() { return this.$store.state.settings.fixedHeader @@ -232,7 +235,7 @@ } .drawer-container { - padding: 24px; + padding: 20px; font-size: 14px; line-height: 1.5; word-wrap: break-word; diff --git a/ruoyi-ui/src/store/getters.js b/ruoyi-ui/src/store/getters.js index da6ab39..8adb1b6 100644 --- a/ruoyi-ui/src/store/getters.js +++ b/ruoyi-ui/src/store/getters.js @@ -2,6 +2,7 @@ sidebar: state => state.app.sidebar, size: state => state.app.size, device: state => state.app.device, + dict: state => state.dict.dict, visitedViews: state => state.tagsView.visitedViews, cachedViews: state => state.tagsView.cachedViews, token: state => state.user.token, diff --git a/ruoyi-ui/src/store/index.js b/ruoyi-ui/src/store/index.js index 53b8437..97aaef8 100644 --- a/ruoyi-ui/src/store/index.js +++ b/ruoyi-ui/src/store/index.js @@ -1,6 +1,7 @@ import Vue from 'vue' import Vuex from 'vuex' import app from './modules/app' +import dict from './modules/dict' import user from './modules/user' import tagsView from './modules/tagsView' import permission from './modules/permission' @@ -12,6 +13,7 @@ const store = new Vuex.Store({ modules: { app, + dict, user, tagsView, permission, diff --git a/ruoyi-ui/src/store/modules/dict.js b/ruoyi-ui/src/store/modules/dict.js new file mode 100644 index 0000000..f48df42 --- /dev/null +++ b/ruoyi-ui/src/store/modules/dict.js @@ -0,0 +1,50 @@ +const state = { + dict: new Array() +} +const mutations = { + SET_DICT: (state, { key, value }) => { + if (key !== null && key !== "") { + state.dict.push({ + key: key, + value: value + }) + } + }, + REMOVE_DICT: (state, key) => { + try { + for (let i = 0; i < state.dict.length; i++) { + if (state.dict[i].key == key) { + state.dict.splice(i, i) + return true + } + } + } catch (e) { + } + }, + CLEAN_DICT: (state) => { + state.dict = new Array() + } +} + +const actions = { + // 璁剧疆瀛楀吀 + setDict({ commit }, data) { + commit('SET_DICT', data) + }, + // 鍒犻櫎瀛楀吀 + removeDict({ commit }, key) { + commit('REMOVE_DICT', key) + }, + // 娓呯┖瀛楀吀 + cleanDict({ commit }) { + commit('CLEAN_DICT') + } +} + +export default { + namespaced: true, + state, + mutations, + actions +} + diff --git a/ruoyi-ui/src/views/login.vue b/ruoyi-ui/src/views/login.vue index 3665604..ed8d971 100644 --- a/ruoyi-ui/src/views/login.vue +++ b/ruoyi-ui/src/views/login.vue @@ -23,7 +23,7 @@ <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" @@ -89,7 +89,7 @@ }, loading: false, // 楠岃瘉鐮佸紑鍏� - captchaOnOff: true, + captchaEnabled: true, // 娉ㄥ唽寮�鍏� register: false, redirect: undefined @@ -110,8 +110,8 @@ methods: { getCode() { getCodeImg().then(res => { - this.captchaOnOff = res.data.captchaOnOff === undefined ? true : res.data.captchaOnOff; - if (this.captchaOnOff) { + this.captchaEnabled = res.data.captchaEnabled === undefined ? true : res.data.captchaEnabled; + if (this.captchaEnabled) { this.codeUrl = "data:image/gif;base64," + res.data.img; this.loginForm.uuid = res.data.uuid; } @@ -144,7 +144,7 @@ this.$router.push({ path: this.redirect || "/" }).catch(()=>{}); }).catch(() => { this.loading = false; - if (this.captchaOnOff) { + if (this.captchaEnabled) { this.getCode(); } }); diff --git a/ruoyi-ui/src/views/register.vue b/ruoyi-ui/src/views/register.vue index 9320b80..1797599 100644 --- a/ruoyi-ui/src/views/register.vue +++ b/ruoyi-ui/src/views/register.vue @@ -29,7 +29,7 @@ <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="registerForm.code" auto-complete="off" @@ -105,7 +105,7 @@ code: [{ required: true, trigger: "change", message: "璇疯緭鍏ラ獙璇佺爜" }] }, loading: false, - captchaOnOff: true + captchaEnabled: true }; }, created() { @@ -114,8 +114,8 @@ methods: { getCode() { getCodeImg().then(res => { - this.captchaOnOff = res.data.captchaOnOff === undefined ? true : res.data.captchaOnOff; - if (this.captchaOnOff) { + this.captchaEnabled = res.data.captchaEnabled === undefined ? true : res.data.captchaEnabled; + if (this.captchaEnabled) { this.codeUrl = "data:image/gif;base64," + res.data.img; this.registerForm.uuid = res.data.uuid; } @@ -137,7 +137,7 @@ }).catch(() => {}); }).catch(() => { this.loading = false; - if (this.captchaOnOff) { + if (this.captchaEnabled) { this.getCode(); } }) diff --git a/ruoyi-ui/src/views/system/dict/data.vue b/ruoyi-ui/src/views/system/dict/data.vue index 5367790..c36cffc 100644 --- a/ruoyi-ui/src/views/system/dict/data.vue +++ b/ruoyi-ui/src/views/system/dict/data.vue @@ -364,12 +364,14 @@ if (valid) { if (this.form.dictCode != undefined) { updateData(this.form).then(response => { + this.$store.dispatch('dict/removeDict', this.queryParams.dictType); this.$modal.msgSuccess("淇敼鎴愬姛"); this.open = false; this.getList(); }); } else { addData(this.form).then(response => { + this.$store.dispatch('dict/removeDict', this.queryParams.dictType); this.$modal.msgSuccess("鏂板鎴愬姛"); this.open = false; this.getList(); @@ -386,6 +388,7 @@ }).then(() => { this.getList(); this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); + this.$store.dispatch('dict/removeDict', this.queryParams.dictType); }).catch(() => {}); }, /** 瀵煎嚭鎸夐挳鎿嶄綔 */ diff --git a/ruoyi-ui/src/views/system/dict/index.vue b/ruoyi-ui/src/views/system/dict/index.vue index 49feccc..b6ed788 100644 --- a/ruoyi-ui/src/views/system/dict/index.vue +++ b/ruoyi-ui/src/views/system/dict/index.vue @@ -339,6 +339,7 @@ handleRefreshCache() { refreshCache().then(() => { this.$modal.msgSuccess("鍒锋柊鎴愬姛"); + this.$store.dispatch('dict/cleanDict'); }); } } diff --git a/ruoyi-ui/src/views/system/user/profile/resetPwd.vue b/ruoyi-ui/src/views/system/user/profile/resetPwd.vue index 0a8d216..64e8f8c 100644 --- a/ruoyi-ui/src/views/system/user/profile/resetPwd.vue +++ b/ruoyi-ui/src/views/system/user/profile/resetPwd.vue @@ -7,7 +7,7 @@ <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> diff --git a/script/sql/oracle/oracle_ry_vue_4.X.sql b/script/sql/oracle/oracle_ry_vue_4.X.sql index 2ca7d23..6348d06 100644 --- a/script/sql/oracle/oracle_ry_vue_4.X.sql +++ b/script/sql/oracle/oracle_ry_vue_4.X.sql @@ -682,12 +682,12 @@ comment on column sys_config.update_time is '鏇存柊鏃堕棿'; comment on column sys_config.remark is '澶囨敞'; -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(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锛屾祬鑹蹭富棰榯heme-light' ); -insert into sys_config values(4, '璐﹀彿鑷姪-楠岃瘉鐮佸紑鍏�', 'sys.account.captchaOnOff', 'true', 'Y', 'admin', sysdate, '', null, '鏄惁寮�鍚獙璇佺爜鍔熻兘锛坱rue寮�鍚紝false鍏抽棴锛�'); -insert into sys_config values(5, '璐﹀彿鑷姪-鏄惁寮�鍚敤鎴锋敞鍐屽姛鑳�', 'sys.account.registerUser', 'false', 'Y', 'admin', sysdate, '', null, '鏄惁寮�鍚敞鍐岀敤鎴峰姛鑳斤紙true寮�鍚紝false鍏抽棴锛�'); -insert into sys_config values(11, 'OSS棰勮鍒楄〃璧勬簮寮�鍏�', 'sys.oss.previewListResource', 'true', 'Y', 'admin', sysdate, '', null, 'true:寮�鍚�, false:鍏抽棴'); +insert into sys_config values(4, '璐﹀彿鑷姪-楠岃瘉鐮佸紑鍏�', 'sys.account.captchaEnabled', 'true', 'Y', 'admin', sysdate, '', null, '鏄惁寮�鍚獙璇佺爜鍔熻兘锛坱rue寮�鍚紝false鍏抽棴锛�'); +insert into sys_config values(5, '璐﹀彿鑷姪-鏄惁寮�鍚敤鎴锋敞鍐屽姛鑳�', 'sys.account.registerUser', 'false', 'Y', 'admin', sysdate, '', null, '鏄惁寮�鍚敞鍐岀敤鎴峰姛鑳斤紙true寮�鍚紝false鍏抽棴锛�'); +insert into sys_config values(11, 'OSS棰勮鍒楄〃璧勬簮寮�鍏�', 'sys.oss.previewListResource', 'true', 'Y', 'admin', sysdate, '', null, 'true:寮�鍚�, false:鍏抽棴'); -- ---------------------------- diff --git a/script/sql/postgres/postgres_ry_vue_4.X.sql b/script/sql/postgres/postgres_ry_vue_4.X.sql index 75a38e1..8b3889b 100644 --- a/script/sql/postgres/postgres_ry_vue_4.X.sql +++ b/script/sql/postgres/postgres_ry_vue_4.X.sql @@ -695,7 +695,7 @@ insert into sys_config values(1, '涓绘鏋堕〉-榛樿鐨偆鏍峰紡鍚嶇О', 'sys.index.skinName', 'skin-blue', 'Y', 'admin', now(), '', null, '钃濊壊 skin-blue銆佺豢鑹� skin-green銆佺传鑹� skin-purple銆佺孩鑹� skin-red銆侀粍鑹� skin-yellow' ); insert into sys_config values(2, '鐢ㄦ埛绠$悊-璐﹀彿鍒濆瀵嗙爜', 'sys.user.initPassword', '123456', 'Y', 'admin', now(), '', null, '鍒濆鍖栧瘑鐮� 123456' ); insert into sys_config values(3, '涓绘鏋堕〉-渚ц竟鏍忎富棰�', 'sys.index.sideTheme', 'theme-dark', 'Y', 'admin', now(), '', null, '娣辫壊涓婚theme-dark锛屾祬鑹蹭富棰榯heme-light' ); -insert into sys_config values(4, '璐﹀彿鑷姪-楠岃瘉鐮佸紑鍏�', 'sys.account.captchaOnOff', 'true', 'Y', 'admin', now(), '', null, '鏄惁寮�鍚獙璇佺爜鍔熻兘锛坱rue寮�鍚紝false鍏抽棴锛�'); +insert into sys_config values(4, '璐﹀彿鑷姪-楠岃瘉鐮佸紑鍏�', 'sys.account.captchaEnabled', 'true', 'Y', 'admin', now(), '', null, '鏄惁寮�鍚獙璇佺爜鍔熻兘锛坱rue寮�鍚紝false鍏抽棴锛�'); insert into sys_config values(5, '璐﹀彿鑷姪-鏄惁寮�鍚敤鎴锋敞鍐屽姛鑳�', 'sys.account.registerUser', 'false', 'Y', 'admin', now(), '', null, '鏄惁寮�鍚敞鍐岀敤鎴峰姛鑳斤紙true寮�鍚紝false鍏抽棴锛�'); insert into sys_config values(11, 'OSS棰勮鍒楄〃璧勬簮寮�鍏�', 'sys.oss.previewListResource', 'true', 'Y', 'admin', now(), '', null, 'true:寮�鍚�, false:鍏抽棴'); diff --git a/script/sql/ry_vue_4.X.sql b/script/sql/ry_vue_4.X.sql index 52aedce..187e1fa 100644 --- a/script/sql/ry_vue_4.X.sql +++ b/script/sql/ry_vue_4.X.sql @@ -3,7 +3,7 @@ -- ---------------------------- drop table if exists sys_dept; create table sys_dept ( - dept_id bigint(20) not null comment '閮ㄩ棬id', + dept_id bigint(20) not null comment '閮ㄩ棬id', parent_id bigint(20) default 0 comment '鐖堕儴闂╥d', ancestors varchar(500) default '' comment '绁栫骇鍒楄〃', dept_name varchar(30) default '' comment '閮ㄩ棬鍚嶇О', @@ -529,11 +529,11 @@ ) engine=innodb comment = '鍙傛暟閰嶇疆琛�'; 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锛屾祬鑹蹭富棰榯heme-light' ); -insert into sys_config values(4, '璐﹀彿鑷姪-楠岃瘉鐮佸紑鍏�', 'sys.account.captchaOnOff', 'true', 'Y', 'admin', sysdate(), '', null, '鏄惁寮�鍚獙璇佺爜鍔熻兘锛坱rue寮�鍚紝false鍏抽棴锛�'); -insert into sys_config values(5, '璐﹀彿鑷姪-鏄惁寮�鍚敤鎴锋敞鍐屽姛鑳�', 'sys.account.registerUser', 'false', 'Y', 'admin', sysdate(), '', null, '鏄惁寮�鍚敞鍐岀敤鎴峰姛鑳斤紙true寮�鍚紝false鍏抽棴锛�'); -insert into sys_config values(11, 'OSS棰勮鍒楄〃璧勬簮寮�鍏�', 'sys.oss.previewListResource', 'true', 'Y', 'admin', sysdate(), '', null, 'true:寮�鍚�, false:鍏抽棴'); +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锛屾祬鑹蹭富棰榯heme-light' ); +insert into sys_config values(4, '璐﹀彿鑷姪-楠岃瘉鐮佸紑鍏�', 'sys.account.captchaEnabled', 'true', 'Y', 'admin', sysdate(), '', null, '鏄惁寮�鍚獙璇佺爜鍔熻兘锛坱rue寮�鍚紝false鍏抽棴锛�'); +insert into sys_config values(5, '璐﹀彿鑷姪-鏄惁寮�鍚敤鎴锋敞鍐屽姛鑳�', 'sys.account.registerUser', 'false', 'Y', 'admin', sysdate(), '', null, '鏄惁寮�鍚敞鍐岀敤鎴峰姛鑳斤紙true寮�鍚紝false鍏抽棴锛�'); +insert into sys_config values(11, 'OSS棰勮鍒楄〃璧勬簮寮�鍏�', 'sys.oss.previewListResource', 'true', 'Y', 'admin', sysdate(), '', null, 'true:寮�鍚�, false:鍏抽棴'); -- ---------------------------- diff --git a/script/sql/sqlserver/sqlserver_ry_vue_4.X.sql b/script/sql/sqlserver/sqlserver_ry_vue_4.X.sql index 3286654..91691e4 100644 --- a/script/sql/sqlserver/sqlserver_ry_vue_4.X.sql +++ b/script/sql/sqlserver/sqlserver_ry_vue_4.X.sql @@ -414,7 +414,7 @@ GO INSERT [sys_config] ([config_id], [config_name], [config_key], [config_value], [config_type], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (3, N'涓绘鏋堕〉-渚ц竟鏍忎富棰�', N'sys.index.sideTheme', N'theme-dark', N'Y', N'admin', getdate(), N'', NULL, N'娣辫壊涓婚theme-dark锛屾祬鑹蹭富棰榯heme-light') GO -INSERT [sys_config] ([config_id], [config_name], [config_key], [config_value], [config_type], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (4, N'璐﹀彿鑷姪-楠岃瘉鐮佸紑鍏�', N'sys.account.captchaOnOff', N'true', N'Y', N'admin', getdate(), N'', NULL, N'鏄惁寮�鍚獙璇佺爜鍔熻兘锛坱rue寮�鍚紝false鍏抽棴锛�') +INSERT [sys_config] ([config_id], [config_name], [config_key], [config_value], [config_type], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (4, N'璐﹀彿鑷姪-楠岃瘉鐮佸紑鍏�', N'sys.account.captchaEnabled', N'true', N'Y', N'admin', getdate(), N'', NULL, N'鏄惁寮�鍚獙璇佺爜鍔熻兘锛坱rue寮�鍚紝false鍏抽棴锛�') GO INSERT [sys_config] ([config_id], [config_name], [config_key], [config_value], [config_type], [create_by], [create_time], [update_by], [update_time], [remark]) VALUES (5, N'璐﹀彿鑷姪-鏄惁寮�鍚敤鎴锋敞鍐屽姛鑳�', N'sys.account.registerUser', N'false', N'Y', N'admin', getdate(), N'', NULL, N'鏄惁寮�鍚敞鍐岀敤鎴峰姛鑳斤紙true寮�鍚紝false鍏抽棴锛�') GO -- Gitblit v1.9.3