Prechádzať zdrojové kódy

fix:"修复子账号密码修改不了的问题"

soobin 6 mesiacov pred
rodič
commit
1399c56c9f

+ 1 - 1
src/assets/language/en.json

@@ -1366,7 +1366,7 @@
     "namePlaceholder": "Please enter the Personal Name",
     "nameRequired": "Please enter the Personal Name",
     "passwordLabel": "Login password",
-    "passwordPlaceholder": "Please enter a password with more than 10 digits",
+    "passwordPlaceholder": "Please enter a password of more than 10 characters, including letters and numbers",
     "passwordRequired": "Please enter a password with more than 10 digits",
     "passwordPattern": "Password must contain letters and numbers",
     "passwordCheckLabel": "Confirm Password",

+ 1 - 1
src/assets/language/ja.json

@@ -1380,7 +1380,7 @@
         "namePlaceholder": "ユーザー名を入力してください",
         "nameRequired": "ユーザー名を入力してください",
         "passwordLabel": "ログインパスワード",
-        "passwordPlaceholder": "10桁以上のパスワードを入力してください",
+        "passwordPlaceholder": "英数字を含む10文字以上のパスワードを入力してください",
         "passwordRequired": "10桁以上のパスワードを入力してください",
         "passwordPattern": "パスワードには英字と数字を含める必要があります",
         "passwordCheckLabel": "パスワード確認",

+ 1 - 1
src/assets/language/zh.json

@@ -1434,7 +1434,7 @@
     "namePlaceholder": "请输入用户名称",
     "nameRequired": "请输入用户名称",
     "passwordLabel": "登录密码",
-    "passwordPlaceholder": "请输入10位以上密码",
+    "passwordPlaceholder": "请输入10位以上密码,包含字母和数字",
     "passwordRequired": "请输入密码",
     "passwordPattern": "密码必须包含字母与数字",
     "passwordCheckLabel": "确认密码",

+ 30 - 24
src/views/accountPer/add.vue

@@ -5,21 +5,21 @@
     <div class="accountPerBox flex-col">
       <van-form @submit="onSubmit">
         <van-field v-model="username" name="username" :label="$t('accountPer.usernameLabel')" :readonly="isUserName"
-          :placeholder="$t('accountPer.usernamePlaceholder')" 
+          :placeholder="$t('accountPer.usernamePlaceholder')"
           :rules="[{ pattern: /^[a-zA-Z][a-zA-Z0-9]*$/, message: $t('register.usernameRequired') }]" />
         <van-field v-model="password" name="password" type="password" :label="$t('accountPer.passwordLabel')"
           :placeholder="passwordPlaceholder" :rules="[
-            { required: havePassword, message: $t('accountPer.passwordPlaceholder') },
-            { pattern: passwordPattern, message: $t('register.passwordPattern') }
-          ]" />
+      { required: havePassword, message: $t('accountPer.passwordPlaceholder') },
+      // { pattern: passwordPattern, message: $t('register.passwordPattern') }
+    ]" />
         <van-field v-model="name" name="name" :label="$t('accountPer.nameLabel')"
           :placeholder="$t('accountPer.namePlaceholder')" :rules="[
-            { required: true, message: $t('accountPer.namePlaceholder') },
-          ]" />
+      { required: true, message: $t('accountPer.namePlaceholder') },
+    ]" />
         <van-field v-model="phone" name="phone" :label="$t('accountPer.phoneLabel')"
           :placeholder="$t('accountPer.phonePlaceholder')" :rules="[
-            { required: true, message: $t('accountPer.phonePlaceholder') },
-          ]" />
+      { required: true, message: $t('accountPer.phonePlaceholder') },
+    ]" />
         <van-field name="radio" label="类型" v-if="user.type === 0">
           <template #input>
             <van-radio-group v-model="type" direction="horizontal">
@@ -29,7 +29,8 @@
           </template>
         </van-field>
         <van-field v-model="roleText" is-link readonly :label="$t('accountPer.roleLabel')"
-          :placeholder="$t('accountPer.rolePlaceholder')" @click="roleShow = true" :rules="[{ required: true, message: $t('accountPer.rolePlaceholder') }]"/>
+          :placeholder="$t('accountPer.rolePlaceholder')" @click="roleShow = true"
+          :rules="[{ required: true, message: $t('accountPer.rolePlaceholder') }]" />
         <div class="van-cell van-field">
           <div class="van-cell__title van-field__label">
             <label id="van-field-4-label" for="van-field-4-input">{{ $t("accountPer.setUp") }}</label>
@@ -37,19 +38,19 @@
           <div class="van-cell__value">
             <div class="van-field__body">
               <van-switch v-model="isEnabled" size="20px" class="o-mr-10" /><span>{{
-                $t("accountPer.startOrNot")
-              }}</span>
+      $t("accountPer.startOrNot")
+    }}</span>
             </div>
           </div>
         </div>
         <van-field :border="false" @click-input="busiEquipInpClk" readonly clearable
           v-model="cofficentForm.equipmentNames" :label="$t('accountPer.manageMachinesLabel')"
-          :placeholder="$t('accountPer.manageMachinesPlaceholder')" >
+          :placeholder="$t('accountPer.manageMachinesPlaceholder')">
           <!-- :rules="[{ required: true, message: $t('accountPer.manageMachinesPlaceholder') }]" -->
           <template #right-icon>
             <div class="l-flex-RC">
-              <van-icon v-if="cofficentForm.equipmentNames" @click="cofficentForm.equipmentNames = ''; equipmentIds = ''"
-                class="o-mr-6" name="clear" />
+              <van-icon v-if="cofficentForm.equipmentNames"
+                @click="cofficentForm.equipmentNames = ''; equipmentIds = ''" class="o-mr-6" name="clear" />
               <van-icon @click="busiEquipInpClk" name="arrow" />
             </div>
           </template>
@@ -57,11 +58,11 @@
         <!-- 操作 -->
         <van-row justify="space-around" style="padding: 1em">
           <van-button span="5" round type="primary" style="height: 2em; padding: 0 2em" native-type="submit">{{
-            $t("accountPer.submit") }}</van-button>
+      $t("accountPer.submit") }}</van-button>
         </van-row>
         <van-row justify="space-around" style="padding: 1em" v-if="pageTitle === $t('accountPer.modifyAccount')">
           <van-button span="5" round type="danger" style="height: 2em; padding: 0 2em" @click="deleteLoginUserFun()">{{
-            $t("accountPer.delete") }}</van-button>
+      $t("accountPer.delete") }}</van-button>
         </van-row>
       </van-form>
     </div>
@@ -70,8 +71,8 @@
         @close="roleShow = false" @finish="onRoleFinish" />
     </van-popup>
     <!-- 机器弹窗 -->
-    <kSelectPop @selconfirm="selEquipConfirm" ref="kSelectPopEquipRef" :selOptions="selEquipOptions" @searchData="searchEquData"
-      :selTitleAndName="['name', 'id']"></kSelectPop>
+    <kSelectPop @selconfirm="selEquipConfirm" ref="kSelectPopEquipRef" :selOptions="selEquipOptions"
+      @searchData="searchEquData" :selTitleAndName="['name', 'id']"></kSelectPop>
   </div>
 </template>
 
@@ -80,7 +81,7 @@
 import kSelectPop from "../../components/commom/kSelectPop/index.vue";
 import { onMounted, reactive, toRefs, ref } from "vue";
 import sHeader from "../../components/SimpleHeader";
-import { showFailToast, showSuccessToast, showToast } from 'vant';
+import { showFailToast, showSuccessToast, showToast, showNotify } from 'vant';
 import {
   getSysRoleList,
   getEquipmentList,
@@ -114,7 +115,7 @@ export default {
       equipmentIdText.value = selectedOptions[0].text;
     };
     const passwordPlaceholder = ref("");
-    const passwordPattern = ref(/^$/);
+    const passwordPattern = ref(/^(?=.*[a-zA-Z])(?=.*\d).{10,}$/);
     const havePassword = ref(true);
     const isUserName = ref(false);
     let addParams = reactive({
@@ -149,13 +150,12 @@ export default {
         addParams.equipmentIds = accoutPerSet.equipmentIds;
         havePassword.value = false;
         passwordPlaceholder.value = t('accountPer.editPasswordPlaceholder')
-        passwordPattern.value = /^$/;
       } else {
         pageTitle.value = t("accountPer.addAccount");
         passwordPlaceholder.value = t('register.passwordPlaceholder');
-        passwordPattern.value = /^(?=.*[a-zA-Z])(?=.*\d).{10,}$/;
         havePassword.value = true;
       }
+      console.log(passwordPattern.value)
       getSysRoleListFun();
       getEquipmentListFun();
     });
@@ -210,10 +210,16 @@ export default {
 
     const onSubmit = async () => {
       let params = { adminId: user.id };
-      if (addParams.username ==='admin') {
-        showFailToast(t('register.A0201'));
+      if (addParams.username === 'admin') {
+        showNotify({ type: 'danger', message: t('register.A0201') });
         return false;
       }
+      if (addParams.password != "") {
+        if (!passwordPattern.value.test(addParams.password)) {
+          showNotify(t('register.passwordPlaceholder'));
+          return false;
+        }
+      }
       params = Object.assign({ adminId: user.id }, addParams);
       if (params.password !== "") {
         params.password = md5(params.password);

+ 3 - 3
src/views/orderCenter/index.vue

@@ -725,8 +725,8 @@ export default {
             getAccountDetail(user.id);
           } else if (user.payPlatform === '1') {
             getHuifuBalance(user.id);
-          }          
-        }       
+          }
+        }
       }
     });
 
@@ -793,7 +793,7 @@ export default {
     // 查询汇付账户余额
     const getHuifuBalance = (id) => {
       checkBalance({ adminId: id }).then(res => {
-          balance.value = res.data.data;
+        balance.value = res.data.data;
       })
     }
     // 订单时间格式转换

+ 0 - 1
src/views/settlement/index.vue

@@ -701,7 +701,6 @@ export default {
         addParams.idCardNo = data.data.idCardNo;
         if (data.data.idCardExpiry) {
           addParams.idCardExpiry = dateUtil.formateDate(new Date(data.data.idCardExpiry), "yyyy-MM-dd");
-          addParams.beginDate = dateUtil.formateDate(new Date(data.data.idCardExpiry), "yyyy-MM-dd");
         }
 
         addParams.bankAccountType = data.data.bankAccountType ? data.data.bankAccountType.toString() : '';