Przeglądaj źródła

feature:删除打印代码,删除qs模块

liuzl 2 lat temu
rodzic
commit
1e44e8a016

+ 0 - 2
App.vue

@@ -53,10 +53,8 @@
         })
       })
       store.dispatch('getUserInfo')
-      // console.log('App Show')
     },
     onHide: function () {
-      // console.log('App Hide')
     },
   }
 </script>

+ 0 - 1
package.json

@@ -7,7 +7,6 @@
         "await-to-js": "^3.0.0",
         "axios": "^0.27.2",
         "echarts": "^5.4.1",
-        "qs": "^6.11.0",
         "uview-ui": "^2.0.31",
         "vue-inset-loader": "^1.2.6",
         "vuex": "^4.1.0"

+ 0 - 5
pages/customer/components/contacts.vue

@@ -75,13 +75,8 @@
         contactList: [],
       }
     },
-    onHide(options) {
-      console.log(323232)
-    },
     onShow() {
-      console.log(111111)
       this.getContacts()
-      // console.log('customerId', this.customerId)
     },
     mounted() {
       this.getContacts()

+ 0 - 4
pages/customer/components/customerDetail.vue

@@ -154,10 +154,6 @@
       }
     },
 
-    mounted() {
-      // console.log(this.abstract)
-    },
-
     methods: {},
   }
 </script>

+ 0 - 1
pages/customer/components/followRecords.vue

@@ -54,7 +54,6 @@
 
     mounted() {
       this.getRecords()
-      // console.log('customerId', this.customerId)
     },
 
     methods: {

+ 0 - 1
pages/customer/components/moveInOpenSea.vue

@@ -49,7 +49,6 @@
         let params = this.openSeaObj
         const [err, res] = await to(customerApi.moveInOpenSea(params))
         if (err) return this.closeMoveInModel()
-        // console.log(res.code)
         if (res.code == 200) {
           this.$refs.uToast.show({
             type: 'loading',

+ 0 - 5
pages/customer/index.vue

@@ -192,9 +192,6 @@
       },
       // 上拉滚动
       lower() {
-        // console.log(this.customerData.length)
-        // console.log(this.customerDataTotal)
-        // console.log(this.loadStatus)
         if (this.customerData.length < this.customerDataTotal && this.loadStatus != 'loading') {
           this.$u.throttle(this.getCustomerData(), 2000, false)
         }
@@ -228,7 +225,6 @@
           }
           this.customerDataTotal = res.data.total
           this.loadStatus = this.customerData.length == this.customerDataTotal ? 'nomore' : 'loadmore'
-          // console.log(this.loadStatus)
         } else {
           this.loadStatus = 'nomore'
         }
@@ -243,7 +239,6 @@
       },
       // 移入公海
       moveInOpenSea(item) {
-        // console.log(item)
         this.openSeaObj.ids = [item.id]
         this.showMoveInModel = true
       },

+ 0 - 5
pages/customer/transfer.vue

@@ -103,7 +103,6 @@
       this.paddingTop = navData.top + 'px'
     },
     onLoad(option) {
-      // console.log(option.id) //打印出上个页面传递的参数。
       this.transferObj.ids = [parseInt(option.id)]
     },
     onShow() {},
@@ -112,9 +111,7 @@
         this.$refs.addForm
           .validate()
           .then(async () => {
-            // console.log(1111)
             let params = this.transferObj
-            // console.log(params)
             const [err, res] = await to(customerApi.transfer(params))
             if (err) return
             if (res && res.code == 200) {
@@ -128,7 +125,6 @@
             }
           })
           .catch((err) => {
-            // console.log(err)
             this.$refs.uNotify.show({
               top: this.height + this.paddingTop + 10,
               type: 'warning',
@@ -139,7 +135,6 @@
       },
       closeUser(user) {
         if (user) {
-          // console.log(user)
           this.transferObj.salesId = user.id
           this.transferObj.salesName = user.label
         }

+ 0 - 1
pages/distributor/components/followRecords.vue

@@ -54,7 +54,6 @@
 
     mounted() {
       this.getRecords()
-      // console.log('customerId', this.customerId)
     },
 
     methods: {

+ 0 - 2
pages/distributor/details.vue

@@ -133,13 +133,11 @@
         const [err, res] = await to(distrApi.getEntity({ id: this.distrId }))
         if (err) return
         if (res && res.code == 200) {
-          // console.log(res)
           this.distrInfo = res.data.list
         }
       },
       // 改变tab
       changeTabs(data) {
-        // console.log(data)
         this.curTabIndex = data.index
       },
       goBack() {

+ 0 - 1
pages/distributor/index.vue

@@ -150,7 +150,6 @@
           }
           this.customerDataTotal = res.data.total
           this.loadStatus = this.customerData.length == this.customerDataTotal ? 'nomore' : 'loadmore'
-          // console.log(this.loadStatus)
         } else {
           this.loadStatus = 'nomore'
         }

+ 0 - 4
pages/home/checkIn.vue

@@ -246,19 +246,15 @@
             message: '定位失败,请重试',
           })
         }
-        // console.log(this.$refs.upload);
-        // this.$refs.upload.choose()
         const [err, res] = await uni.chooseImage({
           count: 1, //默认9
           sizeType: ['original'], //可以指定是原图还是压缩图,默认二者都有
           sourceType: ['camera'],
         })
-        // console.log(res, 'rs');
         if (err) return
         this.select(res)
         res.tempFiles[0].name = new Date().getTime() + ''
         res.tempFiles[0].type = ''
-        // console.log(res.tempFiles[0], typeof res.tempFiles[0])
       },
       // // 选择上传触发函数
       select(e) {

+ 0 - 4
pages/home/index.vue

@@ -405,10 +405,8 @@
           })
         })
         this.privateBoard = privateBoardData.splice(0, 6)
-        // console.log(this.privateBoard)
       },
       async init(id) {
-        // console.log(id, 'id')
         let params = {}
         if (id == 20006) {
           params = {
@@ -427,7 +425,6 @@
           }
         }
         const [err, res] = await to(indexApi.getHomeDataReportData(params))
-        console.log(res)
         if (err) return
         let yAxis =
           id == 20006 || id == 20007
@@ -490,7 +487,6 @@
             },
           ],
         }
-        // console.log('option', option)
         this.$refs[id][0].init(echarts, (chart) => {
           chart.setOption(option)
         })

+ 0 - 1
pages/login/index.vue

@@ -98,7 +98,6 @@
     methods: {
       ...mapActions(['login']),
       async handleLogin() {
-        console.log(this.loginForm.rememberPassword)
         const [valid] = await to(this.$refs.loginForm.validate())
         if (valid !== null) return
         await this.login(this.loginForm)

+ 0 - 2
pages/my/index.vue

@@ -85,12 +85,10 @@
     },
     created() {
       const navData = uni.getMenuButtonBoundingClientRect()
-      // console.log(navData)
       this.height = navData.height + 'px'
       this.paddingTop = navData.top + 'px'
     },
     mounted() {
-      // console.log(this.nickName, this.avatar)
     },
     methods: {
       async logOut() {

+ 0 - 1
pages/openSeaCustomer/components/collectionCustomer.vue

@@ -66,7 +66,6 @@
         }
         const [err, res] = await to(customerApi.collection(params))
         if (err) return this.closeMoveInModel()
-        // console.log(res.code)
         if (res.code == 200) {
           this.$refs.uToast.show({
             type: 'loading',

+ 0 - 7
pages/openSeaCustomer/index.vue

@@ -174,12 +174,10 @@
       },
       // 筛选下的单选
       radioClick(item, target) {
-        // console.log(item.key, target)
         this[target] = item.key
       },
       // 选择日期
       async pickDate(e) {
-        // console.log(e)
         this.followUpDate = e.fulldate
       },
       // 重置
@@ -195,9 +193,6 @@
       },
       // 上拉滚动
       lower: function(e) {
-        // console.log(this.customerData.length)
-        // console.log(this.customerDataTotal)
-        // console.log(this.loadStatus)
         if (this.customerData.length < this.customerDataTotal && this.loadStatus != 'loading') {
           this.$u.throttle(this.getCustomerData(), 2000, false)
         }
@@ -231,7 +226,6 @@
           }
           this.customerDataTotal = res.data.total
           this.loadStatus = this.customerData.length == this.customerDataTotal ? 'nomore' : 'loadmore'
-          // console.log(this.loadStatus)
         } else {
           this.loadStatus = 'nomore'
         }
@@ -246,7 +240,6 @@
       },
       // 移入公海
       moveInOpenSea(item) {
-        // console.log(item)
         this.openSeaObj.ids = [item.id]
         this.showMoveInModel = true
       },

+ 0 - 2
uni_modules/HM-filterDropdown/components/HM-filterDropdown/HM-filterDropdown.vue

@@ -181,7 +181,6 @@
 		watch: {
 			filterData: {
 				handler(newVal) {
-					console.log('watch filterData');
 					this.menuData = JSON.parse(JSON.stringify(newVal));
 					this.initMenu(); //filterData重新赋值初始化菜单
 				},
@@ -263,7 +262,6 @@
 			},
 			//选中
 			selectHierarchyMenu(page_index, level1_index, level2_index, level3_index) {
-				console.log('selectHierarchyMenu');
 				//读取记录
 				if (level2_index == null && level3_index == null && this.shadowActiveMenuArr[page_index].length>0 && this.shadowActiveMenuArr[page_index][0] == level1_index) {
 					this.activeMenuArr.splice(page_index, 1, JSON.parse(JSON.stringify(this.shadowActiveMenuArr[page_index])));

+ 0 - 2
uni_modules/uni-calendar/components/uni-calendar/uni-calendar.vue

@@ -217,7 +217,6 @@
 			clean() {},
 			bindDateChange(e) {
 				const value = e.detail.value + '-1'
-				console.log(this.cale.getDate(value));
 				this.setDate(value)
 			},
 			/**
@@ -324,7 +323,6 @@
 			 * 回到今天
 			 */
 			backtoday() {
-				console.log(this.cale.getDate(new Date()).fullDate);
 				let date = this.cale.getDate(new Date()).fullDate
 				// this.cale.setDate(date)
 				this.init(date)

+ 118 - 118
utils/request.js

@@ -1,129 +1,129 @@
-import Vue from 'vue'
-import axios from 'axios'
-import {
-  // baseURL,
-  contentType,
-  debounce,
-  messageName,
-  requestTimeout,
-  statusName,
-  successCode,
-  /* tokenName, */
-} from '@/config'
-import store from '@/store'
-import qs from 'qs'
-import router from '@/router'
-import { isArray } from '@/utils/validate'
-import { needErrorLog, addErrorLog } from '@/vab/plugins/errorLog'
+// import Vue from 'vue'
+// import axios from 'axios'
+// import {
+//   // baseURL,
+//   contentType,
+//   debounce,
+//   messageName,
+//   requestTimeout,
+//   statusName,
+//   successCode,
+//   /* tokenName, */
+// } from '@/config'
+// import store from '@/store'
+// import qs from 'qs'
+// import router from '@/router'
+// import { isArray } from '@/utils/validate'
+// import { needErrorLog, addErrorLog } from '@/vab/plugins/errorLog'
 
-let loadingInstance
+// let loadingInstance
 
-// 操作正常Code数组
-const codeVerificationArray = isArray(successCode) ? [...successCode] : [...[successCode]]
+// // 操作正常Code数组
+// const codeVerificationArray = isArray(successCode) ? [...successCode] : [...[successCode]]
 
-const CODE_MESSAGE = {
-  0: '未可知错误,可能是因为后端不支持跨域CORS、接口地址不存在等问题引起',
-  200: '服务器成功返回请求数据',
-  201: '新建或修改数据成功',
-  202: '一个请求已经进入后台排队(异步任务)',
-  204: '删除数据成功',
-  400: '发出信息有误',
-  401: '用户没有权限(令牌失效、用户名、密码错误、登录过期)',
-  402: '令牌过期',
-  403: '用户得到授权,但是访问是被禁止的',
-  404: '访问资源不存在',
-  406: '请求格式不可得',
-  410: '请求资源被永久删除,且不会被看到',
-  500: '服务器发生错误',
-  502: '网关错误',
-  503: '服务不可用,服务器暂时过载或维护',
-  504: '网关超时',
-}
+// const CODE_MESSAGE = {
+//   0: '未可知错误,可能是因为后端不支持跨域CORS、接口地址不存在等问题引起',
+//   200: '服务器成功返回请求数据',
+//   201: '新建或修改数据成功',
+//   202: '一个请求已经进入后台排队(异步任务)',
+//   204: '删除数据成功',
+//   400: '发出信息有误',
+//   401: '用户没有权限(令牌失效、用户名、密码错误、登录过期)',
+//   402: '令牌过期',
+//   403: '用户得到授权,但是访问是被禁止的',
+//   404: '访问资源不存在',
+//   406: '请求格式不可得',
+//   410: '请求资源被永久删除,且不会被看到',
+//   500: '服务器发生错误',
+//   502: '网关错误',
+//   503: '服务不可用,服务器暂时过载或维护',
+//   504: '网关超时',
+// }
 
-/**
- * axios响应拦截器
- * @param data response数据
- * @param status HTTP status
- * @param statusText HTTP status text
- * @returns {Promise<*|*>}
- */
-const handleData = async ({ data, status = 0, statusText }) => {
-  if (loadingInstance) loadingInstance.close()
-  // 若data.code存在,覆盖默认code
-  let code = data && data[statusName] ? data[statusName] : status
-  // 若code属于操作正常code,则code修正为200
-  if (codeVerificationArray.indexOf(code) + 1) code = 200
-  switch (code) {
-    case 200:
-      // 业务层级错误处理,以下是假定restful有一套统一输出格式(指不管成功与否都有相应的数据格式)情况下进行处理
-      // 例如响应内容:
-      // 错误内容:{ code: 1, msg: '非法参数' }
-      // 正确内容:{ code: 200, data: {  }, msg: '操作正常' }
-      // return data
-      return data
-    case 401:
-      store.dispatch('user/resetAll').then(() => router.push({ path: '/login', replace: true }).then(() => {}))
-      break
-    case 403:
-      router.push({ path: '/403' }).then(() => {})
-      break
-  }
-  // 异常处理
-  // 若data.msg存在,覆盖默认提醒消息
-  const errMsg = `${
-    data && data[messageName] ? data[messageName] : CODE_MESSAGE[code] ? CODE_MESSAGE[code] : statusText
-  }`
-  Vue.prototype.$baseMessage(errMsg, 'error', 'vab-hey-message-error')
-  // 是否添加错误日志(与errorHandler钩子触发逻辑一致)
-  if (needErrorLog()) addErrorLog({ message: errMsg, stack: data, isRequest: true })
-  return Promise.reject(data)
-}
+// /**
+//  * axios响应拦截器
+//  * @param data response数据
+//  * @param status HTTP status
+//  * @param statusText HTTP status text
+//  * @returns {Promise<*|*>}
+//  */
+// const handleData = async ({ data, status = 0, statusText }) => {
+//   if (loadingInstance) loadingInstance.close()
+//   // 若data.code存在,覆盖默认code
+//   let code = data && data[statusName] ? data[statusName] : status
+//   // 若code属于操作正常code,则code修正为200
+//   if (codeVerificationArray.indexOf(code) + 1) code = 200
+//   switch (code) {
+//     case 200:
+//       // 业务层级错误处理,以下是假定restful有一套统一输出格式(指不管成功与否都有相应的数据格式)情况下进行处理
+//       // 例如响应内容:
+//       // 错误内容:{ code: 1, msg: '非法参数' }
+//       // 正确内容:{ code: 200, data: {  }, msg: '操作正常' }
+//       // return data
+//       return data
+//     case 401:
+//       store.dispatch('user/resetAll').then(() => router.push({ path: '/login', replace: true }).then(() => {}))
+//       break
+//     case 403:
+//       router.push({ path: '/403' }).then(() => {})
+//       break
+//   }
+//   // 异常处理
+//   // 若data.msg存在,覆盖默认提醒消息
+//   const errMsg = `${
+//     data && data[messageName] ? data[messageName] : CODE_MESSAGE[code] ? CODE_MESSAGE[code] : statusText
+//   }`
+//   Vue.prototype.$baseMessage(errMsg, 'error', 'vab-hey-message-error')
+//   // 是否添加错误日志(与errorHandler钩子触发逻辑一致)
+//   if (needErrorLog()) addErrorLog({ message: errMsg, stack: data, isRequest: true })
+//   return Promise.reject(data)
+// }
 
-/**
- * @description axios初始化
- */
-const instance = axios.create({
-  // baseURL,
-  // eslint-disable-next-line no-undef
-  baseURL: $GlobalConfig.baseUrl,
-  timeout: requestTimeout,
-  headers: {
-    'Content-Type': contentType,
-  },
-})
+// /**
+//  * @description axios初始化
+//  */
+// const instance = axios.create({
+//   // baseURL,
+//   // eslint-disable-next-line no-undef
+//   baseURL: $GlobalConfig.baseUrl,
+//   timeout: requestTimeout,
+//   headers: {
+//     'Content-Type': contentType,
+//   },
+// })
 
-/**
- * @description axios请求拦截器
- */
-instance.interceptors.request.use(
-  (config) => {
-    const token = store.getters['user/token']
+// /**
+//  * @description axios请求拦截器
+//  */
+// instance.interceptors.request.use(
+//   (config) => {
+//     const token = store.getters['user/token']
 
-    // 不规范写法 可根据setting.config.js tokenName配置随意自定义headers
-    // if (token) config.headers[tokenName] = token
+//     // 不规范写法 可根据setting.config.js tokenName配置随意自定义headers
+//     // if (token) config.headers[tokenName] = token
 
-    // 规范写法 不可随意自定义
-    if (token) config.headers['Authorization'] = `Bearer ${token}`
+//     // 规范写法 不可随意自定义
+//     if (token) config.headers['Authorization'] = `Bearer ${token}`
 
-    if (config.data && config.headers['Content-Type'] === 'application/x-www-form-urlencoded;charset=UTF-8')
-      config.data = qs.stringify(config.data)
-    if (debounce.some((item) => config.url.includes(item))) loadingInstance = Vue.prototype.$baseLoading()
-    return config
-  },
-  (error) => {
-    return Promise.reject(error)
-  }
-)
+//     if (config.data && config.headers['Content-Type'] === 'application/x-www-form-urlencoded;charset=UTF-8')
+//       config.data = qs.stringify(config.data)
+//     if (debounce.some((item) => config.url.includes(item))) loadingInstance = Vue.prototype.$baseLoading()
+//     return config
+//   },
+//   (error) => {
+//     return Promise.reject(error)
+//   }
+// )
 
-/**
- * @description axios响应拦截器
- */
-instance.interceptors.response.use(
-  (response) => handleData(response),
-  (error) => {
-    const { response = {} } = error
-    return handleData(response)
-  }
-)
+// /**
+//  * @description axios响应拦截器
+//  */
+// instance.interceptors.response.use(
+//   (response) => handleData(response),
+//   (error) => {
+//     const { response = {} } = error
+//     return handleData(response)
+//   }
+// )
 
-export default instance
+// export default instance