Browse Source

add placeholder for old_password

Tao Chen 1 year ago
parent
commit
9c8d0ca508
2 changed files with 23 additions and 10 deletions
  1. 10 10
      src/components/changePwdDialog.vue
  2. 13 0
      src/utils/i18n/zh_CN.json

+ 10 - 10
src/components/changePwdDialog.vue

@@ -1,18 +1,18 @@
1
 <template>
1
 <template>
2
-  <el-dialog v-model="visible" width="50%">
3
-    <el-form ref="cpwd" :model="changePwdForm" :rules="chagePwdRules" label-width="120px" style="margin-top: 20px">
4
-      <el-form-item label="旧密码" prop="old_password">
5
-        <el-input v-model="changePwdForm.old_password" show-password></el-input>
2
+  <el-dialog v-model="visible" width="45%">
3
+    <el-form ref="cpwd" :model="changePwdForm" :rules="chagePwdRules" label-width="130px" label-position="left" style="margin-top: 20px">
4
+      <el-form-item :label="T('Old PassWD')" prop="old_password">
5
+        <el-input v-model="changePwdForm.old_password" :placeholder="T('For OIDC login without a password, enter any 4-20 letters')" show-password></el-input>
6
       </el-form-item>
6
       </el-form-item>
7
-      <el-form-item label="新密码" prop="new_password">
7
+      <el-form-item :label="T('New PassWD')" prop="new_password">
8
         <el-input v-model="changePwdForm.new_password" show-password></el-input>
8
         <el-input v-model="changePwdForm.new_password" show-password></el-input>
9
       </el-form-item>
9
       </el-form-item>
10
-      <el-form-item label="确认密码" prop="confirmPwd">
10
+      <el-form-item :label="T('ConformPassWD')" prop="confirmPwd">
11
         <el-input v-model="changePwdForm.confirmPwd" show-password></el-input>
11
         <el-input v-model="changePwdForm.confirmPwd" show-password></el-input>
12
       </el-form-item>
12
       </el-form-item>
13
       <el-form-item>
13
       <el-form-item>
14
-        <el-button @click="cancelChangePwd">取消</el-button>
15
-        <el-button type="primary" @click="changePassword">确定</el-button>
14
+        <el-button @click="cancelChangePwd">{{ T('Cancel') }}</el-button>
15
+        <el-button type="primary" @click="changePassword">{{ T('Confirm') }}</el-button>
16
       </el-form-item>
16
       </el-form-item>
17
     </el-form>
17
     </el-form>
18
   </el-dialog>
18
   </el-dialog>
@@ -24,7 +24,7 @@
24
   import { ElMessageBox } from 'element-plus'
24
   import { ElMessageBox } from 'element-plus'
25
   import { changeCurPwd } from '@/api/user'
25
   import { changeCurPwd } from '@/api/user'
26
   import { useUserStore } from '@/store/user'
26
   import { useUserStore } from '@/store/user'
27
-
27
+  import { T } from '@/utils/i18n'
28
   const props = defineProps({
28
   const props = defineProps({
29
     visible: Boolean,
29
     visible: Boolean,
30
   })
30
   })
@@ -112,4 +112,4 @@
112
 
112
 
113
 <style scoped lang="scss">
113
 <style scoped lang="scss">
114
 
114
 
115
-</style>
115
+</style>

+ 13 - 0
src/utils/i18n/zh_CN.json

@@ -439,5 +439,18 @@
439
   "Check your IdP docs, without":
439
   "Check your IdP docs, without":
440
   {
440
   {
441
     "One": "检查IdP的文档, 不包含"
441
     "One": "检查IdP的文档, 不包含"
442
+  },
443
+  "For OIDC login without a password, enter any 4-20 letters":
444
+  {
445
+    "One": "如果通过 OIDC 登录且未设置密码,请输入任意 4-20 个字符"
446
+  },
447
+  "Old PassWD": {
448
+    "One": "旧密码"
449
+  },
450
+  "New PassWD": {
451
+    "One": "新密码"
452
+  },
453
+  "ConformPassWD": {
454
+    "One": "确认密码"
442
   }
455
   }
443
 }
456
 }