mirror of
https://github.com/marktext/marktext.git
synced 2025-05-19 02:10:34 +08:00
Fix can not fetch unsplash pictures (#1518)
This commit is contained in:
parent
ca0905dc60
commit
f1f048f53d
@ -12,7 +12,7 @@ class ImageSelector extends BaseFloat {
|
|||||||
|
|
||||||
constructor (muya, options) {
|
constructor (muya, options) {
|
||||||
const name = 'ag-image-selector'
|
const name = 'ag-image-selector'
|
||||||
const { applicationId, secret } = options
|
const { accessKey } = options
|
||||||
options = Object.assign(options, {
|
options = Object.assign(options, {
|
||||||
placement: 'bottom-center',
|
placement: 'bottom-center',
|
||||||
modifiers: {
|
modifiers: {
|
||||||
@ -27,8 +27,7 @@ class ImageSelector extends BaseFloat {
|
|||||||
this.oldVnode = null
|
this.oldVnode = null
|
||||||
this.imageInfo = null
|
this.imageInfo = null
|
||||||
this.unsplash = new Unsplash({
|
this.unsplash = new Unsplash({
|
||||||
applicationId,
|
accessKey
|
||||||
secret
|
|
||||||
})
|
})
|
||||||
this.photoList = []
|
this.photoList = []
|
||||||
this.loading = false
|
this.loading = false
|
||||||
|
@ -452,8 +452,7 @@ export default {
|
|||||||
Muya.use(EmojiPicker)
|
Muya.use(EmojiPicker)
|
||||||
Muya.use(ImagePathPicker)
|
Muya.use(ImagePathPicker)
|
||||||
Muya.use(ImageSelector, {
|
Muya.use(ImageSelector, {
|
||||||
applicationId: process.env.UNSPLASH_ACCESS_KEY,
|
accessKey: process.env.UNSPLASH_ACCESS_KEY,
|
||||||
secret: process.env.UNSPLASH_SECRET_KEY,
|
|
||||||
photoCreatorClick: this.photoCreatorClick
|
photoCreatorClick: this.photoCreatorClick
|
||||||
})
|
})
|
||||||
Muya.use(Transformer)
|
Muya.use(Transformer)
|
||||||
|
Loading…
Reference in New Issue
Block a user