-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
787 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
.vercel | ||
.nuxt | ||
node_modules | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<template> | ||
<div> | ||
<NuxtWelcome /> | ||
</div> | ||
</template> | ||
<NuxtLayout> | ||
<NuxtPage/> | ||
</NuxtLayout> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<template> | ||
<div> | ||
Some *custom* layout | ||
<slot/> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<template> | ||
<div> | ||
A *default* layout | ||
<slot/> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import {MetaWeblogApiAdaptor} from "~/lib/platform/metaweblog/metaweblogApiAdaptor"; | ||
import {IApi} from "~/lib/api"; | ||
import {API_TYPE_CONSTANTS} from "~/lib/constants"; | ||
import {MetaWeblogApi} from "~/lib/platform/metaweblog/metaweblogApi"; | ||
|
||
/** | ||
* 博客园的API适配器 | ||
*/ | ||
export class CnblogsApiAdaptor extends MetaWeblogApiAdaptor implements IApi { | ||
private readonly env:any | ||
|
||
constructor(env:any) { | ||
super(); | ||
|
||
this.env = env | ||
this.apiUrl = process.env.CNBLOGS_API_URL || "" | ||
this.username = process.env.CNBLOGS_USERNAME || "" | ||
this.password = process.env.CNBLOGS_PASSWORD || "" | ||
this.appkey = API_TYPE_CONSTANTS.API_TYPE_CNBLOGS | ||
|
||
this.metaWeblog = new MetaWeblogApi(this.appkey, this.apiUrl, this.username, this.password); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import {IApi} from "~/lib/api"; | ||
import {MetaWeblogApiAdaptor} from "~/lib/platform/metaweblog/metaweblogApiAdaptor"; | ||
import {API_TYPE_CONSTANTS} from "~/lib/constants"; | ||
import {MetaWeblogApi} from "~/lib/platform/metaweblog/metaweblogApi"; | ||
|
||
/** | ||
* Confluence的API适配器 | ||
*/ | ||
export class ConfApiAdaptor extends MetaWeblogApiAdaptor implements IApi { | ||
private readonly env: any | ||
|
||
constructor(env: any) { | ||
super(); | ||
|
||
this.env = env | ||
this.apiUrl = env.CONF_API_URL || "" | ||
this.username = env.CONF_USERNAME || "" | ||
this.password = env.CONF_PASSWORD || "" | ||
this.appkey = API_TYPE_CONSTANTS.API_TYPE_CONF | ||
|
||
this.metaWeblog = new MetaWeblogApi(this.appkey, this.apiUrl, this.username, this.password); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import logUtil from "~/lib/logUtil"; | ||
// @ts-ignore | ||
import * as Serializer from 'xmlrpc/lib/serializer' | ||
import { parse } from 'arraybuffer-xml-parser'; | ||
console.log(Serializer) | ||
|
||
/** | ||
* 自定义xmlrpc的请求与解析,解决apache xmlrpc的扩展问题 | ||
* @param apiUrl | ||
* @param reqMethod | ||
* @param reqParams | ||
*/ | ||
export async function fetchCustom(apiUrl: string, reqMethod: string, reqParams: Array<string>) { | ||
try { | ||
const methodBodyXml = Serializer.serializeMethodCall(reqMethod, reqParams, "utf8") | ||
|
||
const response = await fetch(apiUrl, { | ||
method: "POST", | ||
headers: { | ||
"content-type": "text/xml" | ||
}, | ||
body: methodBodyXml | ||
}) | ||
const resXml = await response.text() | ||
logUtil.logInfo("resXml=>", resXml) | ||
|
||
const parseResult: any = parse(resXml) | ||
logUtil.logInfo("parseResult=>", parseResult) | ||
|
||
const resJson = parseResult.methodResponse || {} | ||
logUtil.logInfo("resJson=>", JSON.stringify(resJson)) | ||
|
||
return resJson | ||
} catch (e: any) { | ||
throw new Error(e) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import {MetaWeblogApiAdaptor} from "~/lib/platform/metaweblog/metaweblogApiAdaptor"; | ||
import {API_TYPE_CONSTANTS} from "~/lib/constants"; | ||
import {MetaWeblogApi} from "~/lib/platform/metaweblog/metaweblogApi"; | ||
import {IApi} from "~/lib/api"; | ||
|
||
/** | ||
* JVue的API适配器 | ||
*/ | ||
export class JvueApiAdaptor extends MetaWeblogApiAdaptor implements IApi { | ||
private readonly env:any | ||
|
||
constructor(env:any) { | ||
super(); | ||
|
||
this.env = env | ||
this.apiUrl = env.JVUE_API_URL || "" | ||
this.username = env.JVUE_USERNAME || "" | ||
this.password = env.JVUE_PASSWORD || "" | ||
this.appkey = API_TYPE_CONSTANTS.API_TYPE_JVUE | ||
|
||
this.metaWeblog = new MetaWeblogApi(this.appkey, this.apiUrl, this.username, this.password); | ||
} | ||
} |
Oops, something went wrong.