Skip to content
Permalink
Browse files

fix($core): cannot use correct api base url for custom yuque domain

  • Loading branch information...
ulivz committed Feb 14, 2019
1 parent c68fb6a commit 818343eeee8d7113280a799957f367c3b3824f78
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/yuque.js
@@ -101,6 +101,8 @@ module.exports = class Yuque {
)

const base = `${protocol}//${host}/api/v2/`
Yuque.base = base

const { data: repos } = await Yuque.getRepos(base, groupId)
assert(
Array.isArray(repos),
@@ -117,11 +119,14 @@ module.exports = class Yuque {
}

constructor(repoId) {
this.base = 'https://www.yuque.com/api/v2/'
this.repoId = repoId
this.store = store.get(`yuque_repo_${repoId}`)
}

get base() {
return Yuque.base || 'https://www.yuque.com/api/v2/'
}

async getRepos() {
return Yuque.getRepos(this.base, this.repoId)
}

0 comments on commit 818343e

Please sign in to comment.
You can’t perform that action at this time.