chore: move nc-gui-v2 to nc-gui

This commit is contained in:
Wing-Kam Wong
2022-09-06 12:00:09 +08:00
parent 7b7ed2b894
commit f97ea536b4
447 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
import JSONTemplateAdapter from './JSONTemplateAdapter'
import { useNuxtApp } from '#imports'
export default class JSONUrlTemplateAdapter extends JSONTemplateAdapter {
url: string
$api: any
constructor(url: string, parserConfig: Record<string, any>) {
const { $api } = useNuxtApp()
const name = url.split('/').pop()
super(name, parserConfig)
this.url = url
this.$api = $api
}
async init() {
const data = await this.$api.utils.axiosRequestMake({
apiMeta: {
url: this.url,
},
})
this._jsonData = data
await super.init()
}
}