mirror of
https://github.com/jumpserver/lina.git
synced 2025-08-02 07:27:01 +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 () {
|
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`))
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
@ -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))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -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)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -53,7 +53,7 @@ export default {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.isShow = false
|
this.isShow = false
|
||||||
console.log(error, 'error')
|
// debug(error, 'error')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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', '' ''
|
||||||
|
@ -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()
|
||||||
|
@ -72,7 +72,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
defaultCallback: function(action) {
|
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}`
|
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 = ''
|
||||||
|
@ -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) => {
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// console.log(this.treeSetting)
|
// debug(this.treeSetting)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleUrlChange(url) {
|
handleUrlChange(url) {
|
||||||
|
@ -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)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -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) {
|
||||||
|
@ -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)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -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)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@ -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() {
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -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) {
|
||||||
|
@ -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')
|
||||||
// })
|
// })
|
||||||
|
Loading…
Reference in New Issue
Block a user