Explorar el Código

油卡充值手机卡充值正则去掉中文

dujingxian hace 4 años
padre
commit
fb8f00878b

+ 3 - 13
src/api/index.js

@@ -31,7 +31,7 @@ axios.interceptors.response.use(
     res => {
         // console.log('响应res', res);
         // loading.close();
-        if (res.data.code == 200) {
+        if (res && res.data.code == 200) {
             return res.data;
         }
         else {
@@ -39,7 +39,7 @@ axios.interceptors.response.use(
                 message: res.data.message,
                 type: 'warning'
             });
-            if (res.data.code == 10014) {
+            if (res && res.data.code == 10014) {
                 setTimeout(() => {
                     context.$router.replace('/login')
                 }, 2000)
@@ -262,7 +262,7 @@ export const updateKey = (params) => {
     // return requestLoading(`${Prefix}act=merchant_info&op=setkey&client_type=ajax&secure_key=${secure_key}`, 'post')
     return axios({
         method: 'post',
-        url: `${Prefix}act=merchant_info&op=pdlog&client_type=ajax`,
+        url: `${Prefix}act=merchant_info&op=setkey&client_type=ajax`,
         withCredentials: true,
         headers: {
             "Content-Type": "application/x-www-form-urlencoded"
@@ -283,16 +283,6 @@ export const updateVoucher = (name) => {
         timeout: 120000,
     })
 }
-// export const updateVoucherList = (params) => {
-//     // return requestLoading(`${Prefix}act=merchant_recharge&op=voucherupload&client_type=ajax`, 'post', {voucher})
-//     return axios({
-//         method: "post",
-//         url: `${Prefix}act=refill_evidence&op=add&client_type=ajax`,
-//         withCredentials: true,
-//         data: params,
-//         timeout: 120000,
-//     })
-// }
 
 // 上传凭证
 export const updateVoucherList = (params) => {

+ 1 - 1
src/pages/subPages/balance.vue

@@ -259,7 +259,7 @@ export default {
             this.startTime = this.dataRange[0]/1000 || ''
             this.endTime = this.dataRange[1]/1000 || ''
             let param = new URLSearchParams()
-            param.append('curpage', this.pageNumber)
+            param.append('curpage', 1)
             param.append('start_time', this.startTime)
             param.append('end_time', this.endTime)
             // const res = await queryVoucherList(this.pageNumber,this.startTime, this.endTime)

+ 3 - 3
src/pages/subPages/mobileCard.vue

@@ -209,7 +209,7 @@ export default {
       this.dialogVisible = true
       this.input = []
       this.splitStr = ''
-      this.codeStr = this.formData.code.replace(/\s/g,"")
+      this.codeStr = this.formData.code.replace(/\s/g,"").replace(/[\u4e00-\u9fa5]/g, "")
       console.log('1', this.codeStr.substr(0,1));
 
     },
@@ -221,8 +221,8 @@ export default {
       this.dialogVisibleCard = true
       this.input = []
       this.splitStr = ''
-      this.codeStr = this.formData.code.replace(/\s/g,"")
-      console.log('1', this.codeStr.substr(0,1));
+      this.codeStr = this.formData.code.replace(/\s/g,"").replace(/[\u4e00-\u9fa5]/g, "")
+      console.log('1', this.codeStr);
     },
     // 关闭弹层
     handleClose() {

+ 4 - 3
src/pages/subPages/oilCard.vue

@@ -222,8 +222,9 @@ export default {
       }
       this.dialogVisible = true
       this.input = []
-      this.codeStr = this.formData.code.replace(/\s/g,"")
-      console.log('1', this.codeStr.substr(0,1));
+      // 去掉中间空格和中文
+      this.codeStr = this.formData.code.replace(/\s/g,"").replace(/[\u4e00-\u9fa5]/g, "")
+      console.log('1', this.codeStr);
       // this.inputBlur()
 
     },
@@ -241,7 +242,7 @@ export default {
         this.$message.error('请填写油卡号')
         return
       }
-      this.codeStr = this.formData.code.replace(/\s/g,"")
+      this.codeStr = this.formData.code.replace(/\s/g,"").replace(/[\u4e00-\u9fa5]/g, "")
       console.log('1', this.codeStr.substr(0,1));
       this.input = []
       this.splitStr = ''