Просмотр исходного кода

删除部分无用的console.log

xinfeng 5 лет назад
Родитель
Сommit
887422a124
4 измененных файлов с 0 добавлено и 26 удалено
  1. 0 3
      plugins/common.js
  2. 0 1
      plugins/deviceType.js
  3. 0 18
      plugins/http.js
  4. 0 4
      plugins/nuxtAxios.js

+ 0 - 3
plugins/common.js

@@ -36,8 +36,6 @@ Vue.mixin({
   methods: {
     async needLogin() {
       const userInfo = await this.getUserInfo();
-      console.log('needLogin++++++++++++++++++');
-      console.log(userInfo);
       if (!userInfo || !userInfo.nickname) {
         this.goLogin();
       }
@@ -126,7 +124,6 @@ Vue.mixin({
     },
     async updateUserInfo() {
       let res = await this.$axios.$get('/api/user/getInfo');
-      console.log('res', res.data)
       if (res && res.data) {
         this.$store.commit('updateUserinfo', {
           userinfo: res.data || {}

+ 0 - 1
plugins/deviceType.js

@@ -1,5 +1,4 @@
 export default function({ req }, inject) {
-  console.log("devicetype...............");
   let deviceType = {};
   deviceType.ios = false;
   deviceType.android = false;

+ 0 - 18
plugins/http.js

@@ -30,16 +30,12 @@ const post = async (path, data = {}, payload = {}) => {
   let urlParams = [];
   console.log(data)
   for(const key in data) {
-    console.log(key)
     if(data.hasOwnProperty(key)) {
       const element = encodeURIComponent(data[key])
-      console.log(element)
       urlParams.push(`${key}=${element}`)
     }
   }
-  console.log(urlParams)
   let formData = urlParams.join('&')
-  console.log(formData)
   let config = { headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' } }
   if(payload.config && payload.config.headers) config.headers = {
     ...config.headers,
@@ -95,20 +91,6 @@ const request = async (method, path, data, payload = {}) => {
     return
   }
 }
-
-/**
- * 设备判断
- */
-// const getDeviceType = function() {
-//   if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) { //判断iPhone|iPad|iPod|iOS
-//     return 'ios';
-//   } else if (/(Android)/i.test(navigator.userAgent)) { //判断Android
-//     return 'android';
-//   } else { //pc
-//     return 'pc';
-//   }
-// }
-
 const consoleFormat = obj => {
   const key = Object.keys(obj)[0]
 }

+ 0 - 4
plugins/nuxtAxios.js

@@ -18,7 +18,6 @@ export default function ({
       config.headers["Content-Type"] = "application/x-www-form-urlencoded";
     }
 
-    console.log("Before, making request to ", config.url, config.baseURL);
     console.log("nuxtAxios...........req.............req");
     config.baseURL = store.state.domainConfig.api;
     console.log("Before, making request to ", config.url, config.baseURL);
@@ -46,11 +45,8 @@ export default function ({
   $axios.onResponse(res => {
     const data = res.data;
     console.log("res:::::::::");
-    console.log(app.$deviceType);
-    // console.log(res);
     console.log(res.config.url);
     console.log(JSON.stringify(data));
-    // req && req.url && needLogin(req.url)
     let needLogin = false;
     if (res.config && res.config.data && typeof res.config.data === "string") {
       const queryData = res.config.data;