From 116c3c891eb48744d51f895a41b45e65163328b4 Mon Sep 17 00:00:00 2001 From: ch Date: Wed, 20 Apr 2022 19:44:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/plugins/msbUniRequest.js | 3 +-- common/utils/requset.js | 25 +++++++++++++----- pages.json | 1 + pages/account/address/create.vue | 4 +-- pages/account/address/edit.vue | 4 +-- pages/cart/components/PageCtx.vue | 2 +- pages/index/components/Banner.vue | 39 +++++++++------------------ pages/index/components/Pick.vue | 4 ++- pages/index/components/Seckill.vue | 10 ++++--- pages/index/index.vue | 41 +++++++++++++++++++---------- pages/login.vue | 16 +++++++---- static/index/arrow.png | Bin 0 -> 335 bytes static/index/banner.jpg | Bin 171718 -> 0 bytes static/index/banner.png | Bin 0 -> 53827 bytes static/index/bz.png | Bin 1092 -> 6029 bytes static/index/logo.png | Bin 3511 -> 4492 bytes static/index/logo1.png | Bin 0 -> 6239 bytes static/index/msg.png | Bin 946 -> 539 bytes static/index/search.png | Bin 696 -> 826 bytes 19 files changed, 85 insertions(+), 64 deletions(-) create mode 100644 static/index/arrow.png delete mode 100644 static/index/banner.jpg create mode 100644 static/index/banner.png create mode 100644 static/index/logo1.png diff --git a/common/plugins/msbUniRequest.js b/common/plugins/msbUniRequest.js index deb1eb9..272a883 100644 --- a/common/plugins/msbUniRequest.js +++ b/common/plugins/msbUniRequest.js @@ -2,7 +2,7 @@ * @Author: ch * @Date: 2022-03-17 16:36:59 * @LastEditors: ch - * @LastEditTime: 2022-04-20 11:57:58 + * @LastEditTime: 2022-04-20 16:07:24 * @Description: 针对uniapp request请求做了一次封装,使用思维参考axios * * @@ -70,7 +70,6 @@ class MsbUniRequest { return option } return new Promise((resolve, reject)=>{ - console.log(option); uni.request({ ...option, success: res => { diff --git a/common/utils/requset.js b/common/utils/requset.js index 45158e8..af0932f 100644 --- a/common/utils/requset.js +++ b/common/utils/requset.js @@ -2,7 +2,7 @@ * @Author: ch * @Date: 2022-03-17 17:42:32 * @LastEditors: ch - * @LastEditTime: 2022-04-20 15:34:09 + * @LastEditTime: 2022-04-20 19:15:36 * @Description: 项目接口请求统一处理器,返回一个需要token和不需要token的请求封装方法 */ @@ -11,8 +11,8 @@ import $store from '@/common/store'; const ENV = 'test'; const BASE_URL = { - 'test' : 'http://k8s-horse-gateway.mashibing.cn', - // 'test' : '', + // 'test' : 'http://k8s-horse-gateway.mashibing.cn', + 'test' : '', 'release' : '', 'prod' : '' }; @@ -53,10 +53,15 @@ let repeatFlag = []; * @param {*} option */ const repeatVerify = (option)=>{ - if(repeatFlag.includes(JSON.stringify(option))){ + let flag = { + url : option.url, + method : option.method, + data : option.data + } + if(repeatFlag.includes(JSON.stringify(flag))){ return Promise.reject({message:'请勿频繁操作'}); } - repeatFlag.push(JSON.stringify(option)); + repeatFlag.push(JSON.stringify(flag)); return false; }; /** @@ -64,9 +69,16 @@ const repeatVerify = (option)=>{ * @param {*} option */ const clearRepeat = (option) =>{ + + console.log(repeatFlag) repeatFlag = repeatFlag.filter( i => { - return i !== JSON.stringify(option) + return i !== JSON.stringify({ + url : option.url, + method : option.method, + data : option.data + }) }); + console.log(repeatFlag) } // 不需要token的接口封装 @@ -74,7 +86,6 @@ const MsbRequest = new MsbUniRequest(); MsbRequest.baseUrl = BASE_URL[ENV]; MsbRequest.use('request', (option) => { - console.log('option',option); if(option.header.repeat){ // 如果当前请求不允许重复调用,则检查重复请求,当前接口有正在请求则不发起请求 const isRepeatVerify = repeatVerify(option); diff --git a/pages.json b/pages.json index 889a339..8876996 100644 --- a/pages.json +++ b/pages.json @@ -6,6 +6,7 @@ "aliasPath" : "/", "style": { "navigationStyle" : "custom", + "navigationBarTitleText": "马士兵严选", "backgroundColor" : "#69ADE5" } }, diff --git a/pages/account/address/create.vue b/pages/account/address/create.vue index 1a7421d..585ff19 100644 --- a/pages/account/address/create.vue +++ b/pages/account/address/create.vue @@ -2,7 +2,7 @@ * @Author: ch * @Date: 2022-03-22 14:12:18 * @LastEditors: ch - * @LastEditTime: 2022-04-20 14:45:43 + * @LastEditTime: 2022-04-20 19:23:18 * @Description: file content -->