From 2979de5c59bacc36e68594d7393fea0420bef0e7 Mon Sep 17 00:00:00 2001 From: 622aa39c1f9b166ab1a38c05 <622aa39c1f9b166ab1a38c05@devide> Date: Mon, 10 Jul 2023 03:49:00 +0000 Subject: [PATCH] Mon Jul 10 03:49:00 UTC 2023 inscode --- src/App.vue | 9 +++++++++ src/js/pod.js | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 src/js/pod.js diff --git a/src/App.vue b/src/App.vue index e4a864d..8d8e52a 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 0000000..8971cbd --- /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 -- GitLab