Skip to content

Commit

Permalink
1015 #30 繼續做這個
Browse files Browse the repository at this point in the history
  • Loading branch information
Pulipuli Chen committed Oct 15, 2019
1 parent 5a0a114 commit 227230a
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 36 deletions.
21 changes: 15 additions & 6 deletions public/spa/admin-components/domain.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/spa/admin-components/domain.js.map

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions public/spa/commons.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/spa/commons.js.map

Large diffs are not rendered by default.

21 changes: 15 additions & 6 deletions webpack-app/admin/components/DomainAdd/DomainAdd.js
Expand Up @@ -34,13 +34,22 @@ let DomainAdd = {
},
methods: {
addSubmit: async function () {
let data = JSON.parse(JSON.stringify(this.addInput))
data.admins = data.admins.replace(/\n/g, ' ').trim().split(' ')
if (data.config !== '') {
data.config = JSON.parse(data.config)
let input = JSON.parse(JSON.stringify(this.addInput))
let data = {
domain: input.domain
}
else {
delete data.config

if (input.title !== '') {
data.title = input.title
}
if (input.admins !== '') {
data.admins = input.admins.replace(/\n/g, ' ').trim().split(' ')
}
if (input.config !== '') {
try {
data.config = JSON.parse(data.config)
}
catch (e) {}
}

let result = await this.lib.AxiosHelper.post('/admin/Domain/add', data)
Expand Down
14 changes: 7 additions & 7 deletions webpack-app/components/ErrorHandler/ErrorHandler.js
Expand Up @@ -80,7 +80,12 @@ let ErrorHandler = {
try {
data = JSON.parse(data)
}
catch (e) {}
catch (e) {}

if (typeof(data) === 'object') {
data = JSON.stringify(data, null, ' ').slice(2, -2)
}

return data
}
}
Expand Down Expand Up @@ -111,15 +116,10 @@ let ErrorHandler = {
this.showError = false

let data = this.error.config.params
console.log(data)
console.log(typeof(data))
if (typeof(data) === 'undefined') {
data = this.error.config.data
}
console.log(data)
console.log(typeof(data))
let result = await this.lib.AxiosHelper[this.error.config.method](this.error.config.url, data)
//let url =
await this.lib.AxiosHelper[this.error.config.method](this.error.config.url, data)
}
} // methods
}
Expand Down
17 changes: 10 additions & 7 deletions webpack-app/components/ErrorHandler/ErrorHandler.less
Expand Up @@ -24,6 +24,15 @@
}
}

.description {
pre {
margin-top: 0;

&:first-of-type {
margin-bottom: 0;
}
}
}

.header {
cursor: inherit !important;
Expand Down Expand Up @@ -52,12 +61,6 @@
overflow-y: hidden;
}

& pre {
margin-top: 0;

&:first-of-type {
margin-bottom: 0;
}
}

}
}

0 comments on commit 227230a

Please sign in to comment.