From 61901be4f75136e4869e58ef31f3b93d4d140c74 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 14 Apr 2022 13:02:42 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=88=9B=E5=BB=BA=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=8F=90=E7=A4=BA=E9=BB=98=E8=AE=A4=E5=AF=86?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/dataease/auth/api/AuthApi.java | 4 +++ .../io/dataease/auth/server/AuthServer.java | 5 +++ frontend/src/api/user.js | 7 ++++ frontend/src/lang/en.js | 1 + frontend/src/lang/tw.js | 1 + frontend/src/lang/zh.js | 1 + frontend/src/styles/index.scss | 6 ++++ frontend/src/views/system/user/form.vue | 33 +++++++++++++++++-- 8 files changed, 55 insertions(+), 3 deletions(-) diff --git a/backend/src/main/java/io/dataease/auth/api/AuthApi.java b/backend/src/main/java/io/dataease/auth/api/AuthApi.java index 12de6b0738..c7219799a7 100644 --- a/backend/src/main/java/io/dataease/auth/api/AuthApi.java +++ b/backend/src/main/java/io/dataease/auth/api/AuthApi.java @@ -30,6 +30,10 @@ public interface AuthApi { @PostMapping("/useInitPwd") Boolean useInitPwd(); + @ApiOperation("用户初始密码") + @PostMapping("/defaultPwd") + String defaultPwd(); + @ApiOperation("登出") @PostMapping("/logout") String logout(); diff --git a/backend/src/main/java/io/dataease/auth/server/AuthServer.java b/backend/src/main/java/io/dataease/auth/server/AuthServer.java index af552661cc..42a685d42a 100644 --- a/backend/src/main/java/io/dataease/auth/server/AuthServer.java +++ b/backend/src/main/java/io/dataease/auth/server/AuthServer.java @@ -154,6 +154,11 @@ public class AuthServer implements AuthApi { return StringUtils.equals(AuthUtils.getUser().getPassword(), md5); } + @Override + public String defaultPwd() { + return DEFAULT_PWD; + } + @Override public String logout() { String token = ServletUtils.getToken(); diff --git a/frontend/src/api/user.js b/frontend/src/api/user.js index c343c82030..7031aaed4c 100644 --- a/frontend/src/api/user.js +++ b/frontend/src/api/user.js @@ -29,6 +29,13 @@ export function needModifyPwd() { }) } +export function defaultPwd() { + return request({ + url: '/api/auth/defaultPwd', + method: 'post' + }) +} + export function validateUserName(data) { return request({ url: '/api/auth/validateName', diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index 6dd18e58bd..07ac245eec 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -131,6 +131,7 @@ export default { default_login: 'Normal' }, commons: { + default_pwd: 'Default Pwd', stop: 'Stop', first_login_tips: 'Please change the initial password', roger_that: 'Roger That', diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index 097c55adf5..c0e258e291 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -131,6 +131,7 @@ export default { default_login: '普通登錄' }, commons: { + default_pwd: '初始密碼', stop: '停止', first_login_tips: '您使用的是初始密碼,記得修改密碼哦', roger_that: '知道了', diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index 3bc7f74e61..4ccfeaf5af 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -131,6 +131,7 @@ export default { default_login: '普通登录' }, commons: { + default_pwd: '初始密码', stop: '停止', first_login_tips: '您使用的是初始密码,记得修改密码哦', roger_that: '知道了', diff --git a/frontend/src/styles/index.scss b/frontend/src/styles/index.scss index 02517aa31e..3d7703f73c 100644 --- a/frontend/src/styles/index.scss +++ b/frontend/src/styles/index.scss @@ -811,3 +811,9 @@ div:focus { padding-top: 0px; } } + +.pwd-tips > span { + + font-weight: 800; + color: #F56C6C; +} diff --git a/frontend/src/views/system/user/form.vue b/frontend/src/views/system/user/form.vue index fbd22af234..1189246324 100644 --- a/frontend/src/views/system/user/form.vue +++ b/frontend/src/views/system/user/form.vue @@ -69,6 +69,19 @@ {{ $t('commons.confirm') }} {{ $t('commons.reset') }} + + + + {{ $t('commons.default_pwd') + ':' + defaultPWD }} + + {{ $t('commons.copy') }} + + @@ -79,7 +92,7 @@ import LayoutContent from '@/components/business/LayoutContent' import { PHONE_REGEX } from '@/utils/validate' import { getDeptTree, treeByDeptId } from '@/api/system/dept' import { addUser, editUser, allRoles } from '@/api/system/user' -import { pluginLoaded } from '@/api/user' +import { pluginLoaded, defaultPwd } from '@/api/user' export default { components: { LayoutContent }, @@ -160,7 +173,8 @@ export default { roleDatas: [], userRoles: [], formType: 'add', - isPluginLoaded: false + isPluginLoaded: false, + defaultPWD: 'DataEase123..' } }, @@ -183,6 +197,11 @@ export default { pluginLoaded().then(res => { this.isPluginLoaded = res.success && res.data }) + defaultPwd().then(res => { + if (res && res.data) { + this.defaultPWD = res.data + } + }) }, methods: { entryKey(event) { @@ -320,7 +339,15 @@ export default { return node }) this.depts = results - } + }, + onCopy(e) { + this.$success(this.$t('commons.copy_success')) + }, + onError(e) {} } } + +