hujike commited on
Commit
e4486f4
·
1 Parent(s): ae751f3

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +33 -37
index.html CHANGED
@@ -134,43 +134,39 @@
134
  this.loading = false
135
  })
136
  },
137
- getResult(msg_Id) {
138
- axios({
139
- method: 'post',
140
- url: 'https://gghfpp.laf.dev/mj-func',
141
- data: {
142
- type: 'retrieveMessages'
143
- }
144
- }).then(res => {
145
- console.log('[ res ] >', res)
146
- const { data } = res
147
- const resIndex = data.findIndex(item => item.content.includes(msg_Id))
148
- if (resIndex < 0) {
149
- this.$message.success('正在努力生成,请耐心等待')
150
- return
151
- }
152
- const { id, attachments } = data[resIndex]
153
- if (!attachments.length) {
154
- this.$message.success('正在努力生成,请耐心等待')
155
- return
156
- }
157
- const { url, width } = attachments[0]
158
- if (width >= 2048) {
159
- const myIndex = this.tasks.findIndex(item => item.msg_Id == msg_Id)
160
- this.tasks[myIndex].result = {
161
- id,
162
- url
163
- }
164
- window.localStorage.setItem('task', JSON.stringify(this.tasks))
165
- } else {
166
- this.$message.success('正在努力生成,请耐心等待')
167
- return
168
- }
169
- }).catch(err => {
170
- console.log('[ err ] >', err)
171
- }).finally(() => {
172
- })
173
- },
174
  variation({ result, question, msg_Id }, index) {
175
  console.log(result, question, index);
176
  // this.$message.warning('正在努力开发中...')
 
134
  this.loading = false
135
  })
136
  },
137
+ function getResult(msg_Id) {
138
+ axios({
139
+ method: 'post',
140
+ url: 'https://gghfpp.laf.dev/mj-func',
141
+ data: {
142
+ type: 'retrieveMessages'
143
+ }
144
+ }).then(res => {
145
+ console.log('[ res ] >', res)
146
+ const { data } = res
147
+ const resIndex = data.findIndex(item => item.content.includes(msg_Id))
148
+ if (resIndex < 0) {
149
+ this.$message.success('正在努力生成,请耐心等待')
150
+ return
151
+ }
152
+ const { id, attachments } = data[resIndex]
153
+ if (!attachments.length) {
154
+ this.$message.success('正在努力生成,请耐心等待')
155
+ return
156
+ }
157
+ const { pic } = attachments[0]
158
+ if (pic) {
159
+ const myIndex = this.tasks.findIndex(item => item.msg_Id == msg_Id)
160
+ this.tasks[myIndex].result = { id, url: pic }
161
+ window.localStorage.setItem('task', JSON.stringify(this.tasks))
162
+ } else {
163
+ this.$message.success('正在努力生成,请耐心等待')
164
+ return
165
+ }
166
+ }).catch(err => {
167
+ console.log('[ err ] >', err)
168
+ })
169
+ },
 
 
 
 
170
  variation({ result, question, msg_Id }, index) {
171
  console.log(result, question, index);
172
  // this.$message.warning('正在努力开发中...')