Commit 712a656f by 姜雷

去掉log打印

parent 5d8fc2ce
const removeConsolePlugin = [];
if (process.env.NODE_ENV === 'production') {
removeConsolePlugin.push('transform-remove-console');
}
module.exports = { module.exports = {
presets: ['@vue/app'], presets: ['@vue/app'],
plugins: removeConsolePlugin,
}; };
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
"@vue/eslint-config-prettier": "^4.0.1", "@vue/eslint-config-prettier": "^4.0.1",
"babel-eslint": "^10.0.1", "babel-eslint": "^10.0.1",
"babel-plugin-component": "^1.1.1", "babel-plugin-component": "^1.1.1",
"babel-plugin-transform-remove-console": "^6.9.4",
"cross-env": "^5.2.0", "cross-env": "^5.2.0",
"eslint": "^5.8.0", "eslint": "^5.8.0",
"eslint-plugin-vue": "^5.0.0", "eslint-plugin-vue": "^5.0.0",
......
...@@ -23,7 +23,7 @@ const createBaseFetch = config => { ...@@ -23,7 +23,7 @@ const createBaseFetch = config => {
}, },
error => { error => {
// Do something with request error // Do something with request error
console.log(error); // for debug console.error(error); // for debug
Promise.reject(error); Promise.reject(error);
} }
); );
...@@ -70,7 +70,7 @@ const createBaseFetch = config => { ...@@ -70,7 +70,7 @@ const createBaseFetch = config => {
}); });
}) })
.catch(err => { .catch(err => {
console.log(err); console.error(err);
logout = false; logout = false;
}); });
} }
......
...@@ -39,7 +39,7 @@ service.interceptors.request.use( ...@@ -39,7 +39,7 @@ service.interceptors.request.use(
}, },
error => { error => {
// Do something with request error // Do something with request error
console.log(error); // for debug console.error(error); // for debug
Promise.reject(error); Promise.reject(error);
} }
); );
...@@ -85,7 +85,7 @@ service.interceptors.response.use(response => { ...@@ -85,7 +85,7 @@ service.interceptors.response.use(response => {
}); });
}) })
.catch(err => { .catch(err => {
console.log(err); console.error(err);
logout = false; logout = false;
}); });
} }
......
...@@ -27,7 +27,7 @@ export const validateCode = res => { ...@@ -27,7 +27,7 @@ export const validateCode = res => {
}; };
export const errorHandle = error => { export const errorHandle = error => {
console.log('err' + error); // for debug console.error('err' + error); // for debug
store.dispatch('fetchDone'); store.dispatch('fetchDone');
if (error.message && /timeout/.test(error.message)) { if (error.message && /timeout/.test(error.message)) {
Message({ Message({
......
...@@ -64,11 +64,11 @@ export default { ...@@ -64,11 +64,11 @@ export default {
insert(this.IMG_URL + response.key); insert(this.IMG_URL + response.key);
}; };
let _error = err => { let _error = err => {
console.log(err); console.error(err);
if (err.isRequestError && err.code == 401) { if (err.isRequestError && err.code == 401) {
this.getImgToken(true); this.getImgToken(true);
} else { } else {
console.log(err); console.error(err);
this.$refs.input.value = ''; this.$refs.input.value = '';
} }
}; };
......
...@@ -172,14 +172,14 @@ export default { ...@@ -172,14 +172,14 @@ export default {
}); });
}) })
.catch(err => { .catch(err => {
console.log('删除错误:' + err.msg); console.error('删除错误:' + err.msg);
}); });
}, },
_error(err) { _error(err) {
if (err.isRequestError && err.code == '401') { if (err.isRequestError && err.code == '401') {
this.getImgToken(true); this.getImgToken(true);
} else { } else {
console.log(err); console.error(err);
this.$refs.input.value = ''; this.$refs.input.value = '';
} }
}, },
......
...@@ -448,7 +448,7 @@ export default { ...@@ -448,7 +448,7 @@ export default {
this.cancelUserinfoUpdate(); this.cancelUserinfoUpdate();
}) })
.catch(err => { .catch(err => {
console.log(err); console.error(err);
}); });
} }
}, },
...@@ -489,7 +489,7 @@ export default { ...@@ -489,7 +489,7 @@ export default {
this.cancelCellphoneUpdate(); this.cancelCellphoneUpdate();
}) })
.catch(err => { .catch(err => {
console.log(err); console.error(err);
}); });
} }
}, },
......
...@@ -149,7 +149,7 @@ export default { ...@@ -149,7 +149,7 @@ export default {
this.$router.push({ path: '/' }); this.$router.push({ path: '/' });
}) })
.catch(err => { .catch(err => {
console.log(err); console.error(err);
this.loading = false; this.loading = false;
}); });
} }
...@@ -168,7 +168,7 @@ export default { ...@@ -168,7 +168,7 @@ export default {
}) })
.catch(err => { .catch(err => {
this.$message.error('获取验证码失败!'); this.$message.error('获取验证码失败!');
console.log(err); console.error(err);
}); });
}, },
}, },
......
...@@ -40,7 +40,7 @@ const createBaseFetch = config => { ...@@ -40,7 +40,7 @@ const createBaseFetch = config => {
}, },
error => { error => {
// Do something with request error // Do something with request error
console.log(error); // for debug console.error(error); // for debug
Promise.reject(error); Promise.reject(error);
} }
); );
...@@ -86,7 +86,7 @@ const createBaseFetch = config => { ...@@ -86,7 +86,7 @@ const createBaseFetch = config => {
}); });
}) })
.catch(err => { .catch(err => {
console.log(err); console.error(err);
logout = false; logout = false;
}); });
} }
......
...@@ -42,7 +42,7 @@ const configRoutePermission = (router, store, allAasyncRouterMap) => { ...@@ -42,7 +42,7 @@ const configRoutePermission = (router, store, allAasyncRouterMap) => {
next({ ...to, replace: true }); next({ ...to, replace: true });
}) })
.catch(err => { .catch(err => {
console.log(err); console.error(err);
store.dispatch('FedLogOut').then(() => { store.dispatch('FedLogOut').then(() => {
next({ path: '/login' }); next({ path: '/login' });
}); });
......
...@@ -26,7 +26,7 @@ const actions = { ...@@ -26,7 +26,7 @@ const actions = {
return res; return res;
}) })
.catch(err => { .catch(err => {
console.log(err); console.error(err);
fetch--; fetch--;
}); });
......
...@@ -33,7 +33,7 @@ const actions = { ...@@ -33,7 +33,7 @@ const actions = {
} }
}) })
.catch(err => { .catch(err => {
console.log(err); console.error(err);
commit(GET_CUSTOMER_BASEINFO, state()); commit(GET_CUSTOMER_BASEINFO, state());
}); });
}, },
...@@ -48,7 +48,7 @@ const actions = { ...@@ -48,7 +48,7 @@ const actions = {
} }
}) })
.catch(err => { .catch(err => {
console.log(err); console.error(err);
commit(GET_CUSTOMER_BASEINFO, state()); commit(GET_CUSTOMER_BASEINFO, state());
}); });
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment