Parcourir la source

feat: 优化日志展示

double.huang il y a 5 ans
Parent
commit
2bde2ebe96
1 fichiers modifiés avec 3 ajouts et 3 suppressions
  1. 3 3
      src/views/tracker/index.vue

+ 3 - 3
src/views/tracker/index.vue

@@ -160,9 +160,9 @@ export default {
       this.temp = Object.assign({}, row)
       this.$api.sysTracker.get({ id: row.id }).then(res => {
         const { data: { header, res_body, req_body }} = res
-        this.temp.header = header && atob(header)
-        this.temp.res_body = res_body && atob(res_body)
-        this.temp.req_body = req_body && atob(req_body)
+        this.temp.header = header && decodeURIComponent(atob(header))
+        this.temp.res_body = res_body && JSON.stringify(JSON.parse(decodeURIComponent(atob(res_body))), null, '\t')
+        this.temp.req_body = req_body && JSON.stringify(JSON.parse(decodeURIComponent(atob(req_body))), null, '\t')
         this.dialogVisible = true
       })
     }