Mon Jul 10 03:49:00 UTC 2023 inscode

上级 60e0d27d
......@@ -156,6 +156,7 @@ import OpenAI from './js/openai.js'
import Config from './js/config.js'
import SDApi from './js/sd.js'
import StorageApi from './js/storage.js'
import PodsApi from './js/pod.js'
// import MarkdownItVue from 'markdown-it-vue'
// import 'markdown-it-vue/dist/markdown-it-vue.css'
......@@ -521,6 +522,13 @@ export default {
config.sdServerUrl = this.sdServerUrl
config.sdServerType = this.sdServerType
localStorage.setItem('ai-config', JSON.stringify(config))
},
getPods () {
PodsApi.getPods().then(res => {
})
}
},
mounted() {
......@@ -533,6 +541,7 @@ export default {
if (this.mode === 'draw') {
this.prompt = this.default_prompt
}
this.getPods()
}
};
......
import axios from "axios";
export default {
getPods () {
return new Promise(function(resolve,rejcet){
const data = {"pageNum":1,"pageSize":10,"total":0,"isDelete":0}
const headers = {
'content-type': 'application/json'
};
let api = 'https://inscode-api.csdn.net/api/v2/resource/pagekey/ipod/kppod_self'
axios.post(api, data, { headers }).then(response => {
debugger
if (response.status === 200 && response?.data?.images){
const image = response?.data?.images[0]
resolve('data:image/png;base64,' + image)
}
}).catch(err => {
rejcet(err)
});
})
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册