diff --git a/src/App.vue b/src/App.vue index e4a864dd45e22357133ece4a2372fe85967c4c74..8d8e52a7879f61a9e2d4d9f685885d6aa76adb95 100644 --- a/src/App.vue +++ b/src/App.vue @@ -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() } }; diff --git a/src/js/pod.js b/src/js/pod.js new file mode 100644 index 0000000000000000000000000000000000000000..8971cbdbece435a410a6133294e218fee85d8cce --- /dev/null +++ b/src/js/pod.js @@ -0,0 +1,32 @@ +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