diff --git a/src/layout/feedback.vue b/src/layout/feedback.vue index e8be2c6..8a46c3e 100644 --- a/src/layout/feedback.vue +++ b/src/layout/feedback.vue @@ -1,22 +1,36 @@ @@ -50,7 +64,7 @@ export default { }, methods: { - async loadLibrary () { + async loadLibrary() { if (typeof html2canvas === 'undefined') { try { console.error('html2canvas not import', e.toString()) @@ -71,16 +85,19 @@ export default { modals[i].setAttribute('data-html2canvas-ignore', 'true') } - html2canvas(document.body, { logging: false }) + html2canvas(document.body, { logging: false }) .then(canvas => { let screenshot = document.getElementById('screenshot') canvas.setAttribute('style', 'width:100%') screenshot.appendChild(canvas) this.dataLoading = false - window.sdb = new SimpleDrawingBoard(screenshot.getElementsByTagName('canvas')[0], { - lineColor: '#ff0000', - lineSize: 4 - }) + window.sdb = new SimpleDrawingBoard( + screenshot.getElementsByTagName('canvas')[0], + { + lineColor: '#ff0000', + lineSize: 4 + } + ) }) .catch(e => { this.dataLoading = false @@ -106,21 +123,29 @@ export default { } formData.append('feedback', this.feedback.info) } - let res = await axios.post('http://', formData, { - headers: { - 'Origin': window.location.origin, - 'Content-Type': 'multipart/form-data' - }, - changeOrigin: true - }) + // let res = await axios.post('http://', formData, { + // headers: { + // 'Origin': window.location.origin, + // 'Content-Type': 'multipart/form-data' + // }, + // changeOrigin: true + // }) this.confirmLoading = false - util.showResponseMessage(res.data.data) + this.$notify({ + title: '反馈成功', + type: 'success', + duration: 2500 + }) if (res.data.data.status === 1) { this.show = false } } catch (e) { - util.showErrorMessageBox(e) + this.$notify({ + title: '提交失败', + type: 'error', + duration: 2500 + }) this.confirmLoading = false } } @@ -130,7 +155,8 @@ export default {