Skip to content

Commit

Permalink
fix: clear console
Browse files Browse the repository at this point in the history
  • Loading branch information
h7ml committed May 6, 2022
1 parent ea88ad2 commit 05876ed
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 31 deletions.
42 changes: 12 additions & 30 deletions src/dgiot/plugins/lajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,6 @@
/**
* 使 Error 对象支持 JSON 序列化
*/
window.console =
window.console ||
(function () {
var c = {}
c.log =
c.warn =
c.debug =
c.info =
c.error =
c.time =
c.dir =
c.profile =
c.clear =
c.exception =
c.trace =
c.assert =
function () {}
return c
})()
if (!('toJSON' in Error.prototype)) {
/* eslint-disable no-extend-native */
Object.defineProperty(Error.prototype, 'toJSON', {
Expand Down Expand Up @@ -696,17 +677,18 @@ class Lajax {
* @memberof Lajax
*/
_printConsole(time, level, ...args) {
if (console) {
if (this.stylize) {
console[level](
`%c[${this._getTimeString(time)}] [${level.toUpperCase()}] -`,
`color: ${Lajax.colorEnum[level]}`,
...args
)
} else {
console[level](...args)
}
}
// if (console) {
// if (this.stylize) {
// console[level](
// `%c[${this._getTimeString(time)}] [${level.toUpperCase()}] -`,
// `color: ${Lajax.colorEnum[level]}`,
// ...args
// )
// } else {
// console[level](...args)
// }
// }
return ''
}

/**
Expand Down
3 changes: 2 additions & 1 deletion src/views/DeviceCloud/manage/component/wmxdetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1269,6 +1269,7 @@
* @description 查询资源通道
*/
// await this.queryResource()
this.resource.data = this.protocol
},
mounted() {},
beforeCreate() {}, //生命周期 - 创建之前
Expand Down Expand Up @@ -1376,7 +1377,7 @@
this.resource.changeData = {}
// this.resource.arrlist = []
// this.$nextTick(async () => {
await this.clearValidate()
// await this.clearValidate()
await this.resource.data.forEach((resource) => {
if (resource.cType == val) {
this.resource.changeData = resource
Expand Down

0 comments on commit 05876ed

Please sign in to comment.