mirror of
https://github.com/doocs/md.git
synced 2024-11-25 03:18:36 +08:00
Compare commits
1 Commits
3f0acd664f
...
79f2cd3e7b
Author | SHA1 | Date | |
---|---|---|---|
|
79f2cd3e7b |
2
package-lock.json
generated
2
package-lock.json
generated
@ -885,7 +885,7 @@
|
|||||||
},
|
},
|
||||||
"node_modules/@clack/prompts/node_modules/is-unicode-supported": {
|
"node_modules/@clack/prompts/node_modules/is-unicode-supported": {
|
||||||
"version": "1.3.0",
|
"version": "1.3.0",
|
||||||
"extraneous": true,
|
"dev": true,
|
||||||
"inBundle": true,
|
"inBundle": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
import { giteeConfig, githubConfig } from '@/config'
|
||||||
|
import fetch from '@/utils/fetch'
|
||||||
|
import { base64encode, safe64, utf16to8 } from '@/utils/tokenTools'
|
||||||
|
import * as tokenTools from '@/utils/tokenTools'
|
||||||
import Buffer from 'buffer-from'
|
import Buffer from 'buffer-from'
|
||||||
import COS from 'cos-js-sdk-v5'
|
import COS from 'cos-js-sdk-v5'
|
||||||
import CryptoJS from 'crypto-js'
|
import CryptoJS from 'crypto-js'
|
||||||
@ -6,10 +10,6 @@ import * as Minio from 'minio'
|
|||||||
import * as qiniu from 'qiniu-js'
|
import * as qiniu from 'qiniu-js'
|
||||||
import OSS from 'tiny-oss'
|
import OSS from 'tiny-oss'
|
||||||
import { v4 as uuidv4 } from 'uuid'
|
import { v4 as uuidv4 } from 'uuid'
|
||||||
import * as tokenTools from '@/utils/tokenTools'
|
|
||||||
import { base64encode, safe64, utf16to8 } from '@/utils/tokenTools'
|
|
||||||
import fetch from '@/utils/fetch'
|
|
||||||
import { giteeConfig, githubConfig } from '@/config'
|
|
||||||
|
|
||||||
function getConfig(useDefault: boolean, platform: string) {
|
function getConfig(useDefault: boolean, platform: string) {
|
||||||
if (useDefault) {
|
if (useDefault) {
|
||||||
@ -87,7 +87,7 @@ async function ghFileUpload(content: string, filename: string) {
|
|||||||
content: {
|
content: {
|
||||||
download_url: string
|
download_url: string
|
||||||
}
|
}
|
||||||
data?: {
|
data: {
|
||||||
content: {
|
content: {
|
||||||
download_url: string
|
download_url: string
|
||||||
}
|
}
|
||||||
@ -106,7 +106,7 @@ async function ghFileUpload(content: string, filename: string) {
|
|||||||
})
|
})
|
||||||
const githubResourceUrl = `raw.githubusercontent.com/${username}/${repo}/${branch}/`
|
const githubResourceUrl = `raw.githubusercontent.com/${username}/${repo}/${branch}/`
|
||||||
const cdnResourceUrl = `fastly.jsdelivr.net/gh/${username}/${repo}@${branch}/`
|
const cdnResourceUrl = `fastly.jsdelivr.net/gh/${username}/${repo}@${branch}/`
|
||||||
res.content = res.data?.content || res.content
|
res.content = res.data.content || res.content
|
||||||
return useDefault
|
return useDefault
|
||||||
? res.content.download_url.replace(githubResourceUrl, cdnResourceUrl)
|
? res.content.download_url.replace(githubResourceUrl, cdnResourceUrl)
|
||||||
: res.content.download_url
|
: res.content.download_url
|
||||||
|
Loading…
Reference in New Issue
Block a user