perf: 修改 console.log() 语句为 debug() 标识 (#1749)

Co-authored-by: Jiangjie.Bai <bugatti_it@163.com>
Co-authored-by: Jiangjie.Bai <32935519+BaiJiangJie@users.noreply.github.com>
This commit is contained in:
fit2bot 2022-05-17 15:16:33 +08:00 committed by GitHub
parent c604957e66
commit aa00f1e4a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 25 additions and 24 deletions

View File

@ -24,9 +24,9 @@ if (process.env.npm_config_preview || rawArgv.includes('--preview')) {
) )
app.listen(port, function () { app.listen(port, function () {
console.log(chalk.green(`> Preview at http://localhost:${port}${publicPath}`)) // debug(chalk.green(`> Preview at http://localhost:${port}${publicPath}`))
if (report) { if (report) {
console.log(chalk.green(`> Report at http://localhost:${port}${publicPath}report.html`)) // debug(chalk.green(`> Report at http://localhost:${port}${publicPath}report.html`))
} }
}) })

View File

@ -56,7 +56,7 @@ const responseFake = (url, type, respond) => {
url: new RegExp(`${process.env.VUE_APP_BASE_API}${url}`), url: new RegExp(`${process.env.VUE_APP_BASE_API}${url}`),
type: type || 'get', type: type || 'get',
response(req, res) { response(req, res) {
console.log('request invoke:' + req.path) // debug('request invoke:' + req.path)
res.json(Mock.mock(respond instanceof Function ? respond(req, res) : respond)) res.json(Mock.mock(respond instanceof Function ? respond(req, res) : respond))
} }
} }

View File

@ -59,9 +59,9 @@ module.exports = app => {
mockRoutesLength = mockRoutes.mockRoutesLength mockRoutesLength = mockRoutes.mockRoutesLength
mockStartIndex = mockRoutes.mockStartIndex mockStartIndex = mockRoutes.mockStartIndex
console.log(chalk.magentaBright(`\n > Mock Server hot reload success! changed ${path}`)) // debug(chalk.magentaBright(`\n > Mock Server hot reload success! changed ${path}`))
} catch (error) { } catch (error) {
console.log(chalk.redBright(error)) // debug(chalk.redBright(error))
} }
} }
}) })

View File

@ -238,7 +238,7 @@ export default {
updateContabValue(name, value, from) { updateContabValue(name, value, from) {
this.contabValueObj[name] = value this.contabValueObj[name] = value
if (from && from !== name) { if (from && from !== name) {
console.log(`来自组件 ${from} 改变了 ${name} ${value}`) // debug(` ${from} ${name} ${value}`)
this.changeRadio(name, value) this.changeRadio(name, value)
} }
}, },

View File

@ -53,7 +53,7 @@ export default {
} }
} catch (error) { } catch (error) {
this.isShow = false this.isShow = false
console.log(error, 'error') // debug(error, 'error')
} }
} }
} }

View File

@ -146,7 +146,7 @@ export default {
* - el-form resetFields 不会触发 input & change 事件无法监听 * - el-form resetFields 不会触发 input & change 事件无法监听
* - bug1: https://github.com/FEMessage/el-data-table/issues/176#issuecomment-587280825 * - bug1: https://github.com/FEMessage/el-data-table/issues/176#issuecomment-587280825
* - bug2: * - bug2:
* 0. 建议先在监听器 watch.value console.log(v.name, oldV.name) * 0. 建议先在监听器 watch.value // debug(v.name, oldV.name)
* 1. 打开 basic 示例 * 1. 打开 basic 示例
* 2. label name 的输入框里输入 1此时 log'1' '' * 2. label name 的输入框里输入 1此时 log'1' ''
* 3. 点击 reset 按钮此时 log 两条数据 '1' '1', '' '' * 3. 点击 reset 按钮此时 log 两条数据 '1' '1', '' ''

View File

@ -97,7 +97,7 @@ export default {
}, },
handleClick(button) { handleClick(button) {
const callback = button.callback || function(values, form) { const callback = button.callback || function(values, form) {
// console.log('Click ', button.title, ': ', values) // debug('Click ', button.title, ': ', values)
} }
const form = this.$refs['form'] const form = this.$refs['form']
const values = form.getFormValue() const values = form.getFormValue()

View File

@ -72,7 +72,7 @@ export default {
}, },
methods: { methods: {
defaultCallback: function(action) { defaultCallback: function(action) {
// console.log(action) // debug(action)
} }
} }
} }

View File

@ -205,8 +205,9 @@ export default {
} }
return this.url.indexOf('?') === -1 ? `${this.url}?${query}` : `${this.url}&${query}` return this.url.indexOf('?') === -1 ? `${this.url}?${query}` : `${this.url}&${query}`
}, },
// eslint-disable-next-line handle-callback-err
catchError(error) { catchError(error) {
console.log(error) // debug(error)
}, },
onSuccess(msg) { onSuccess(msg) {
this.errorMsg = '' this.errorMsg = ''

View File

@ -1,5 +1,5 @@
export function cleanActions(actions, canDefaults, { selectedRows, reloadTable }) { export function cleanActions(actions, canDefaults, { selectedRows, reloadTable }) {
// console.log('Start clean actions: ', selectedRows.length, reloadTable) // debug('Start clean actions: ', selectedRows.length, reloadTable)
const cleanedActions = [] const cleanedActions = []
const cloneActions = _.cloneDeep(actions) const cloneActions = _.cloneDeep(actions)
cloneActions.forEach((action) => { cloneActions.forEach((action) => {

View File

@ -17,7 +17,7 @@ export default {
} }
// const locale = this.$i18n.locale // const locale = this.$i18n.locale
// const value = dt.toLocaleString(locale, { hourCycle: 'h23' }) // const value = dt.toLocaleString(locale, { hourCycle: 'h23' })
// console.log(this.$i18n.locale) // debug(this.$i18n.locale)
return { return {
value: value value: value
} }

View File

@ -77,7 +77,7 @@ export default {
} }
}, },
mounted() { mounted() {
// console.log(this.treeSetting) // debug(this.treeSetting)
}, },
methods: { methods: {
handleUrlChange(url) { handleUrlChange(url) {

View File

@ -18,7 +18,7 @@ router.beforeEach(async(to, from, next) => {
next() next()
} catch (e) { } catch (e) {
const msg = 'Start service error: ' + e const msg = 'Start service error: ' + e
console.log(e) // debug(e)
} }
}) })

View File

@ -126,7 +126,7 @@ function cleanRoute(tmp, parent) {
} else { } else {
tmp.meta.fullPath = parentFullPath ? parentFullPath + '/' + tmp.path : parentFullPath tmp.meta.fullPath = parentFullPath ? parentFullPath + '/' + tmp.path : parentFullPath
} }
// console.log('Full path: ', tmp.meta.fullPath) // debug('Full path: ', tmp.meta.fullPath)
} }
// 设置默认active menu // 设置默认active menu
if (tmp.meta.type === 'crud' && !tmp.meta.activeMenu) { if (tmp.meta.type === 'crud' && !tmp.meta.activeMenu) {

View File

@ -82,7 +82,7 @@ const actions = {
commit('SET_PROFILE', response) commit('SET_PROFILE', response)
resolve(response) resolve(response)
}).catch(error => { }).catch(error => {
// console.log(error) // debug(error)
reject(error) reject(error)
}) })
}) })

View File

@ -36,7 +36,7 @@ function beforeRequestAddTimezone(config) {
try { try {
config.headers['X-TZ'] = Intl.DateTimeFormat().resolvedOptions().timeZone config.headers['X-TZ'] = Intl.DateTimeFormat().resolvedOptions().timeZone
} catch (e) { } catch (e) {
console.log('Current browser not support Intl tools') // debug('Current browser not support Intl tools')
} }
} }
@ -51,7 +51,7 @@ service.interceptors.request.use(
}, },
error => { error => {
// do something with request error // do something with request error
console.log(error) // for debug // debug(error) // for debug
return Promise.reject(error) return Promise.reject(error)
} }
) )

View File

@ -172,7 +172,7 @@ export default {
}) })
}, },
hideMenu() { hideMenu() {
console.log('Tree: ', this.tree) // debug('Tree: ', this.tree)
this.tree.hideRMenu() this.tree.hideRMenu()
}, },
getSelectedNodes() { getSelectedNodes() {

View File

@ -116,7 +116,7 @@ export default {
this.loading = false this.loading = false
}) })
} else { } else {
console.log('error submit!!') // debug('error submit!!')
return false return false
} }
}) })

View File

@ -101,8 +101,8 @@ export default {
).then(newSub => { ).then(newSub => {
const msgType = this.idMessageTypeMapper[newSub.message_type] const msgType = this.idMessageTypeMapper[newSub.message_type]
msgType.receivers = newSub.receivers msgType.receivers = newSub.receivers
}).catch(err => { }).catch(() => {
console.log(err) // debug(err)
}) })
}, },
getNameDisplay(header) { getNameDisplay(header) {

View File

@ -79,7 +79,7 @@ describe('Breadcrumb.vue', () => {
// router.push('/menu/menu1/menu1-2/menu1-2-2') // router.push('/menu/menu1/menu1-2/menu1-2-2')
// const breadcrumbArray = wrapper.findAll('.el-breadcrumb__inner') // const breadcrumbArray = wrapper.findAll('.el-breadcrumb__inner')
// const second = breadcrumbArray.at(1) // const second = breadcrumbArray.at(1)
// console.log(breadcrumbArray) // // debug(breadcrumbArray)
// const href = second.find('a').attributes().href // const href = second.find('a').attributes().href
// expect(href).toBe('#/menu/menu1') // expect(href).toBe('#/menu/menu1')
// }) // })