Skip to content

Commit

Permalink
fix: #326 思源配置读取出错
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Jan 11, 2023
1 parent 412a08e commit b3b8ddd
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions utils/platform/siyuan/siYuanConfig.ts
Expand Up @@ -45,7 +45,11 @@ export class SiYuanConfig {
}

/**
* 获取思源笔记配置,优先读取配置的值,如果没有配置,读取启动环境变量
* 获取思源笔记配置,优先级如下:
* <p>1.本地保存的配置的值</p>
* <P>2.启动环境变量</P>
* @author terwer
* @since 0.6.0
*/
export const getSiyuanCfg = (): SiYuanConfig => {
let baseUrl = getEnv("VITE_SIYUAN_API_URL") // Base Url,开发阶段需要填写
Expand All @@ -63,16 +67,5 @@ export const getSiyuanCfg = (): SiYuanConfig => {
middlewareUrl = siyuanCfg.middlewareUrl
}

// if (isBrowser()) {
// // 不是Chrome浏览器插件,并且页面地址与API地址不一致的时候,以页面地址为准
// if (
// !(window.location.href.indexOf("localhost") > -1) &&
// !(window.location.href.indexOf("chrome-extension") > -1) &&
// !window.location.href.includes(baseUrl)
// ) {
// baseUrl = window.location.protocol + "//" + window.location.host
// }
// }

return new SiYuanConfig(baseUrl, token, middlewareUrl)
}

0 comments on commit b3b8ddd

Please sign in to comment.