mirror of
https://github.com/jumpserver/lina.git
synced 2025-04-27 03:00:47 +00:00
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:
parent
c604957e66
commit
aa00f1e4a6
@ -24,9 +24,9 @@ if (process.env.npm_config_preview || rawArgv.includes('--preview')) {
|
||||
)
|
||||
|
||||
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) {
|
||||
console.log(chalk.green(`> Report at http://localhost:${port}${publicPath}report.html`))
|
||||
// debug(chalk.green(`> Report at http://localhost:${port}${publicPath}report.html`))
|
||||
}
|
||||
|
||||
})
|
||||
|
@ -56,7 +56,7 @@ const responseFake = (url, type, respond) => {
|
||||
url: new RegExp(`${process.env.VUE_APP_BASE_API}${url}`),
|
||||
type: type || 'get',
|
||||
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))
|
||||
}
|
||||
}
|
||||
|
@ -59,9 +59,9 @@ module.exports = app => {
|
||||
mockRoutesLength = mockRoutes.mockRoutesLength
|
||||
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) {
|
||||
console.log(chalk.redBright(error))
|
||||
// debug(chalk.redBright(error))
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -238,7 +238,7 @@ export default {
|
||||
updateContabValue(name, value, from) {
|
||||
this.contabValueObj[name] = value
|
||||
if (from && from !== name) {
|
||||
console.log(`来自组件 ${from} 改变了 ${name} ${value}`)
|
||||
// debug(`来自组件 ${from} 改变了 ${name} ${value}`)
|
||||
this.changeRadio(name, value)
|
||||
}
|
||||
},
|
||||
|
@ -53,7 +53,7 @@ export default {
|
||||
}
|
||||
} catch (error) {
|
||||
this.isShow = false
|
||||
console.log(error, 'error')
|
||||
// debug(error, 'error')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -146,7 +146,7 @@ export default {
|
||||
* - el-form 的 resetFields 不会触发 input & change 事件,无法监听
|
||||
* - bug1: https://github.com/FEMessage/el-data-table/issues/176#issuecomment-587280825
|
||||
* - bug2:
|
||||
* 0. 建议先在监听器 watch.value 里 console.log(v.name, oldV.name)
|
||||
* 0. 建议先在监听器 watch.value 里 // debug(v.name, oldV.name)
|
||||
* 1. 打开 basic 示例
|
||||
* 2. 在 label 为 name 的输入框里输入 1,此时 log:'1' ''
|
||||
* 3. 点击 reset 按钮,此时 log 两条数据: '1' '1', '' ''
|
||||
|
@ -97,7 +97,7 @@ export default {
|
||||
},
|
||||
handleClick(button) {
|
||||
const callback = button.callback || function(values, form) {
|
||||
// console.log('Click ', button.title, ': ', values)
|
||||
// debug('Click ', button.title, ': ', values)
|
||||
}
|
||||
const form = this.$refs['form']
|
||||
const values = form.getFormValue()
|
||||
|
@ -72,7 +72,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
defaultCallback: function(action) {
|
||||
// console.log(action)
|
||||
// debug(action)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -205,8 +205,9 @@ export default {
|
||||
}
|
||||
return this.url.indexOf('?') === -1 ? `${this.url}?${query}` : `${this.url}&${query}`
|
||||
},
|
||||
// eslint-disable-next-line handle-callback-err
|
||||
catchError(error) {
|
||||
console.log(error)
|
||||
// debug(error)
|
||||
},
|
||||
onSuccess(msg) {
|
||||
this.errorMsg = ''
|
||||
|
@ -1,5 +1,5 @@
|
||||
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 cloneActions = _.cloneDeep(actions)
|
||||
cloneActions.forEach((action) => {
|
||||
|
@ -17,7 +17,7 @@ export default {
|
||||
}
|
||||
// const locale = this.$i18n.locale
|
||||
// const value = dt.toLocaleString(locale, { hourCycle: 'h23' })
|
||||
// console.log(this.$i18n.locale)
|
||||
// debug(this.$i18n.locale)
|
||||
return {
|
||||
value: value
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// console.log(this.treeSetting)
|
||||
// debug(this.treeSetting)
|
||||
},
|
||||
methods: {
|
||||
handleUrlChange(url) {
|
||||
|
@ -18,7 +18,7 @@ router.beforeEach(async(to, from, next) => {
|
||||
next()
|
||||
} catch (e) {
|
||||
const msg = 'Start service error: ' + e
|
||||
console.log(e)
|
||||
// debug(e)
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -126,7 +126,7 @@ function cleanRoute(tmp, parent) {
|
||||
} else {
|
||||
tmp.meta.fullPath = parentFullPath ? parentFullPath + '/' + tmp.path : parentFullPath
|
||||
}
|
||||
// console.log('Full path: ', tmp.meta.fullPath)
|
||||
// debug('Full path: ', tmp.meta.fullPath)
|
||||
}
|
||||
// 设置默认active menu
|
||||
if (tmp.meta.type === 'crud' && !tmp.meta.activeMenu) {
|
||||
|
@ -82,7 +82,7 @@ const actions = {
|
||||
commit('SET_PROFILE', response)
|
||||
resolve(response)
|
||||
}).catch(error => {
|
||||
// console.log(error)
|
||||
// debug(error)
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
|
@ -36,7 +36,7 @@ function beforeRequestAddTimezone(config) {
|
||||
try {
|
||||
config.headers['X-TZ'] = Intl.DateTimeFormat().resolvedOptions().timeZone
|
||||
} 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 => {
|
||||
// do something with request error
|
||||
console.log(error) // for debug
|
||||
// debug(error) // for debug
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
@ -172,7 +172,7 @@ export default {
|
||||
})
|
||||
},
|
||||
hideMenu() {
|
||||
console.log('Tree: ', this.tree)
|
||||
// debug('Tree: ', this.tree)
|
||||
this.tree.hideRMenu()
|
||||
},
|
||||
getSelectedNodes() {
|
||||
|
@ -116,7 +116,7 @@ export default {
|
||||
this.loading = false
|
||||
})
|
||||
} else {
|
||||
console.log('error submit!!')
|
||||
// debug('error submit!!')
|
||||
return false
|
||||
}
|
||||
})
|
||||
|
@ -101,8 +101,8 @@ export default {
|
||||
).then(newSub => {
|
||||
const msgType = this.idMessageTypeMapper[newSub.message_type]
|
||||
msgType.receivers = newSub.receivers
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
}).catch(() => {
|
||||
// debug(err)
|
||||
})
|
||||
},
|
||||
getNameDisplay(header) {
|
||||
|
@ -79,7 +79,7 @@ describe('Breadcrumb.vue', () => {
|
||||
// router.push('/menu/menu1/menu1-2/menu1-2-2')
|
||||
// const breadcrumbArray = wrapper.findAll('.el-breadcrumb__inner')
|
||||
// const second = breadcrumbArray.at(1)
|
||||
// console.log(breadcrumbArray)
|
||||
// // debug(breadcrumbArray)
|
||||
// const href = second.find('a').attributes().href
|
||||
// expect(href).toBe('#/menu/menu1')
|
||||
// })
|
||||
|
Loading…
Reference in New Issue
Block a user