🚧 WIP(custom): v3.0.0 migrate to vite and esm

This commit is contained in:
Kuingsmile
2025-07-31 17:37:30 +08:00
parent cd76bc7c10
commit 054f4b4cff
597 changed files with 197292 additions and 13329 deletions

View File

@@ -1,8 +1,10 @@
import axios from 'axios'
import crypto from 'crypto'
import querystring from 'querystring'
import crypto from 'node:crypto'
import querystring from 'node:querystring'
import picgo from '@core/picgo'
import axios from 'axios'
import { IObj } from '#/types/types'
export interface DogecloudToken {
accessKeyId: string
@@ -10,7 +12,7 @@ export interface DogecloudToken {
sessionToken: string
}
export async function dogecloudApi(
export async function dogecloudApi (
apiPath: string,
data = {},
jsonMode: boolean = false,
@@ -43,7 +45,7 @@ export async function dogecloudApi(
}
}
export async function getTempToken(accessKey: string, secretKey: string): Promise<IObj | DogecloudToken> {
export async function getTempToken (accessKey: string, secretKey: string): Promise<IObj | DogecloudToken> {
const dogeTempToken = (await picgo.getConfig('Credentials.doge-token')) || ({} as any)
if (dogeTempToken.token && dogeTempToken.expires > Date.now() + 7200000) {
return dogeTempToken.token