Skip to content

Commit

Permalink
fix: 重构存储
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Oct 31, 2023
1 parent df8c172 commit c1b646a
Show file tree
Hide file tree
Showing 46 changed files with 98 additions and 98 deletions.
4 changes: 2 additions & 2 deletions src/adaptors/api/cnblogs/useCnblogsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { Utils } from "~/src/utils/utils.ts"
import { CnblogsConfig } from "~/src/adaptors/api/cnblogs/cnblogsConfig.ts"
import { CnblogsApiAdaptor } from "~/src/adaptors/api/cnblogs/cnblogsApiAdaptor.ts"
import { PublisherAppInstance } from "~/src/publisherAppInstance.ts"
import { useSettingStore } from "~/src/stores/useSettingStore.ts"
import { usePublishSettingStore } from "~/src/stores/usePublishSettingStore.ts"
import { JsonUtil, ObjectUtil, StrUtil } from "zhi-common"
import { getDynPostidKey } from "~/src/platforms/dynamicConfig.ts"
import { CategoryTypeEnum } from "zhi-blog-api"
Expand Down Expand Up @@ -58,7 +58,7 @@ export const useCnblogsApi = async (key?: string, newCfg?: CnblogsConfig) => {
cfg = newCfg
} else {
// 从配置中获取数据
const { getSetting } = useSettingStore()
const { getSetting } = usePublishSettingStore()
const setting = await getSetting()
cfg = JsonUtil.safeParse<CnblogsConfig>(setting[key], {} as CnblogsConfig)
// 如果配置为空,则使用默认的环境变量值,并记录日志
Expand Down
4 changes: 2 additions & 2 deletions src/adaptors/api/gitlab-hexo/useGitlabhexoApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import { createAppLogger } from "~/src/utils/appLogger.ts"
import { PublisherAppInstance } from "~/src/publisherAppInstance.ts"
import { useSettingStore } from "~/src/stores/useSettingStore.ts"
import { usePublishSettingStore } from "~/src/stores/usePublishSettingStore.ts"
import { JsonUtil, ObjectUtil, StrUtil } from "zhi-common"
import { Utils } from "~/src/utils/utils.ts"
import { getDynPostidKey } from "~/src/platforms/dynamicConfig.ts"
Expand All @@ -50,7 +50,7 @@ const useGitlabhexoApi = async (key: string, newCfg?: GitlabhexoConfig) => {
cfg = newCfg
} else {
// 从配置中获取数据
const { getSetting } = useSettingStore()
const { getSetting } = usePublishSettingStore()
const setting = await getSetting()
cfg = JsonUtil.safeParse<GitlabhexoConfig>(setting[key], {} as GitlabhexoConfig)

Expand Down
4 changes: 2 additions & 2 deletions src/adaptors/api/gitlab-hugo/useGitlabhugoApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import { createAppLogger } from "~/src/utils/appLogger.ts"
import { PublisherAppInstance } from "~/src/publisherAppInstance.ts"
import { useSettingStore } from "~/src/stores/useSettingStore.ts"
import { usePublishSettingStore } from "~/src/stores/usePublishSettingStore.ts"
import { JsonUtil, ObjectUtil, StrUtil } from "zhi-common"
import { Utils } from "~/src/utils/utils.ts"
import { getDynPostidKey } from "~/src/platforms/dynamicConfig.ts"
Expand All @@ -50,7 +50,7 @@ const useGitlabhugoApi = async (key: string, newCfg?: GitlabhugoConfig) => {
cfg = newCfg
} else {
// 从配置中获取数据
const { getSetting } = useSettingStore()
const { getSetting } = usePublishSettingStore()
const setting = await getSetting()
cfg = JsonUtil.safeParse<GitlabhugoConfig>(setting[key], {} as GitlabhugoConfig)

Expand Down
4 changes: 2 additions & 2 deletions src/adaptors/api/gitlab-jekyll/useGitlabjekyllApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import { createAppLogger } from "~/src/utils/appLogger.ts"
import { PublisherAppInstance } from "~/src/publisherAppInstance.ts"
import { useSettingStore } from "~/src/stores/useSettingStore.ts"
import { usePublishSettingStore } from "~/src/stores/usePublishSettingStore.ts"
import { JsonUtil, ObjectUtil, StrUtil } from "zhi-common"
import { Utils } from "~/src/utils/utils.ts"
import { getDynPostidKey } from "~/src/platforms/dynamicConfig.ts"
Expand All @@ -50,7 +50,7 @@ const useGitlabjekyllApi = async (key: string, newCfg?: GitlabjekyllConfig) => {
cfg = newCfg
} else {
// 从配置中获取数据
const { getSetting } = useSettingStore()
const { getSetting } = usePublishSettingStore()
const setting = await getSetting()
cfg = JsonUtil.safeParse<GitlabjekyllConfig>(setting[key], {} as GitlabjekyllConfig)

Expand Down
4 changes: 2 additions & 2 deletions src/adaptors/api/gitlab-vitepress/useGitlabvitepressApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import { createAppLogger } from "~/src/utils/appLogger.ts"
import { PublisherAppInstance } from "~/src/publisherAppInstance.ts"
import { useSettingStore } from "~/src/stores/useSettingStore.ts"
import { usePublishSettingStore } from "~/src/stores/usePublishSettingStore.ts"
import { JsonUtil, ObjectUtil, StrUtil } from "zhi-common"
import { Utils } from "~/src/utils/utils.ts"
import { getDynPostidKey } from "~/src/platforms/dynamicConfig.ts"
Expand All @@ -50,7 +50,7 @@ const useGitlabvitepressApi = async (key: string, newCfg?: GitlabvitepressConfig
cfg = newCfg
} else {
// 从配置中获取数据
const { getSetting } = useSettingStore()
const { getSetting } = usePublishSettingStore()
const setting = await getSetting()
cfg = JsonUtil.safeParse<GitlabvitepressConfig>(setting[key], {} as GitlabvitepressConfig)

Expand Down
4 changes: 2 additions & 2 deletions src/adaptors/api/gitlab-vuepress/useGitlabvuepressApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import { createAppLogger } from "~/src/utils/appLogger.ts"
import { PublisherAppInstance } from "~/src/publisherAppInstance.ts"
import { useSettingStore } from "~/src/stores/useSettingStore.ts"
import { usePublishSettingStore } from "~/src/stores/usePublishSettingStore.ts"
import { JsonUtil, ObjectUtil, StrUtil } from "zhi-common"
import { Utils } from "~/src/utils/utils.ts"
import { getDynPostidKey } from "~/src/platforms/dynamicConfig.ts"
Expand All @@ -50,7 +50,7 @@ const useGitlabvuepressApi = async (key: string, newCfg?: GitlabvuepressConfig)
cfg = newCfg
} else {
// 从配置中获取数据
const { getSetting } = useSettingStore()
const { getSetting } = usePublishSettingStore()
const setting = await getSetting()
cfg = JsonUtil.safeParse<GitlabvuepressConfig>(setting[key], {} as GitlabvuepressConfig)

Expand Down
4 changes: 2 additions & 2 deletions src/adaptors/api/gitlab-vuepress2/useGitlabvuepress2Api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import { createAppLogger } from "~/src/utils/appLogger.ts"
import { PublisherAppInstance } from "~/src/publisherAppInstance.ts"
import { useSettingStore } from "~/src/stores/useSettingStore.ts"
import { usePublishSettingStore } from "~/src/stores/usePublishSettingStore.ts"
import { JsonUtil, ObjectUtil, StrUtil } from "zhi-common"
import { Utils } from "~/src/utils/utils.ts"
import { getDynPostidKey } from "~/src/platforms/dynamicConfig.ts"
Expand All @@ -50,7 +50,7 @@ const useGitlabvuepress2Api = async (key: string, newCfg?: Gitlabvuepress2Config
cfg = newCfg
} else {
// 从配置中获取数据
const { getSetting } = useSettingStore()
const { getSetting } = usePublishSettingStore()
const setting = await getSetting()
cfg = JsonUtil.safeParse<Gitlabvuepress2Config>(setting[key], {} as Gitlabvuepress2Config)

Expand Down
4 changes: 2 additions & 2 deletions src/adaptors/api/halo/useHaloApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import { HaloConfig } from "~/src/adaptors/api/halo/HaloConfig.ts"
import { createAppLogger } from "~/src/utils/appLogger.ts"
import { PublisherAppInstance } from "~/src/publisherAppInstance.ts"
import { useSettingStore } from "~/src/stores/useSettingStore.ts"
import { usePublishSettingStore } from "~/src/stores/usePublishSettingStore.ts"
import { JsonUtil, ObjectUtil, StrUtil } from "zhi-common"
import { Utils } from "~/src/utils/utils.ts"
import { getDynPostidKey } from "~/src/platforms/dynamicConfig.ts"
Expand All @@ -49,7 +49,7 @@ const useHaloApi = async (key: string, newCfg?: HaloConfig) => {
cfg = newCfg
} else {
// 从配置中获取数据
const { getSetting } = useSettingStore()
const { getSetting } = usePublishSettingStore()
const setting = await getSetting()
cfg = JsonUtil.safeParse<HaloConfig>(setting[key], {} as HaloConfig)

Expand Down
4 changes: 2 additions & 2 deletions src/adaptors/api/hexo/useHexoApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import { createAppLogger } from "~/src/utils/appLogger.ts"
import { PublisherAppInstance } from "~/src/publisherAppInstance.ts"
import { useSettingStore } from "~/src/stores/useSettingStore.ts"
import { usePublishSettingStore } from "~/src/stores/usePublishSettingStore.ts"
import { JsonUtil, ObjectUtil, StrUtil } from "zhi-common"
import { Utils } from "~/src/utils/utils.ts"
import { getDynPostidKey } from "~/src/platforms/dynamicConfig.ts"
Expand All @@ -50,7 +50,7 @@ const useHexoApi = async (key: string, newCfg?: HexoConfig) => {
cfg = newCfg
} else {
// 从配置中获取数据
const { getSetting } = useSettingStore()
const { getSetting } = usePublishSettingStore()
const setting = await getSetting()
cfg = JsonUtil.safeParse<HexoConfig>(setting[key], {} as HexoConfig)

Expand Down
4 changes: 2 additions & 2 deletions src/adaptors/api/hugo/useHugoApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import { createAppLogger } from "~/src/utils/appLogger.ts"
import { PublisherAppInstance } from "~/src/publisherAppInstance.ts"
import { useSettingStore } from "~/src/stores/useSettingStore.ts"
import { usePublishSettingStore } from "~/src/stores/usePublishSettingStore.ts"
import { JsonUtil, ObjectUtil, StrUtil } from "zhi-common"
import { Utils } from "~/src/utils/utils.ts"
import { getDynPostidKey } from "~/src/platforms/dynamicConfig.ts"
Expand All @@ -50,7 +50,7 @@ const useHugoApi = async (key: string, newCfg?: HugoConfig) => {
cfg = newCfg
} else {
// 从配置中获取数据
const { getSetting } = useSettingStore()
const { getSetting } = usePublishSettingStore()
const setting = await getSetting()
cfg = JsonUtil.safeParse<HugoConfig>(setting[key], {} as HugoConfig)

Expand Down
4 changes: 2 additions & 2 deletions src/adaptors/api/jekyll/useJekyllApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import { createAppLogger } from "~/src/utils/appLogger.ts"
import { PublisherAppInstance } from "~/src/publisherAppInstance.ts"
import { useSettingStore } from "~/src/stores/useSettingStore.ts"
import { usePublishSettingStore } from "~/src/stores/usePublishSettingStore.ts"
import { JsonUtil, ObjectUtil, StrUtil } from "zhi-common"
import { Utils } from "~/src/utils/utils.ts"
import { getDynPostidKey } from "~/src/platforms/dynamicConfig.ts"
Expand All @@ -50,7 +50,7 @@ const useJekyllApi = async (key: string, newCfg?: JekyllConfig) => {
cfg = newCfg
} else {
// 从配置中获取数据
const { getSetting } = useSettingStore()
const { getSetting } = usePublishSettingStore()
const setting = await getSetting()
cfg = JsonUtil.safeParse<JekyllConfig>(setting[key], {} as JekyllConfig)

Expand Down
4 changes: 2 additions & 2 deletions src/adaptors/api/metaweblog/useMetaweblogApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import { MetaweblogConfig } from "~/src/adaptors/api/base/metaweblog/metaweblogConfig.ts"
import { createAppLogger } from "~/src/utils/appLogger.ts"
import { PublisherAppInstance } from "~/src/publisherAppInstance.ts"
import { useSettingStore } from "~/src/stores/useSettingStore.ts"
import { usePublishSettingStore } from "~/src/stores/usePublishSettingStore.ts"
import { JsonUtil, ObjectUtil, StrUtil } from "zhi-common"
import { Utils } from "~/src/utils/utils.ts"
import { getDynPostidKey } from "~/src/platforms/dynamicConfig.ts"
Expand Down Expand Up @@ -58,7 +58,7 @@ export const useMetaweblogApi = async (key?: string, newCfg?: MetaweblogConfig)
cfg = newCfg
} else {
// 从配置中获取数据
const { getSetting } = useSettingStore()
const { getSetting } = usePublishSettingStore()
const setting = await getSetting()
cfg = JsonUtil.safeParse<MetaweblogConfig>(setting[key], {} as MetaweblogConfig)
// 如果配置为空,则使用默认的环境变量值,并记录日志
Expand Down
4 changes: 2 additions & 2 deletions src/adaptors/api/notion/notionApiAdaptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { NotionConfig } from "~/src/adaptors/api/notion/notionConfig.ts"
import { createAppLogger } from "~/src/utils/appLogger.ts"
import { ObjectUtil } from "zhi-common"
import { NotionMarkdownConverter } from "zhi-notion-markdown"
import { useSettingStore } from "~/src/stores/useSettingStore.ts"
import { usePublishSettingStore } from "~/src/stores/usePublishSettingStore.ts"

/**
* Notion API 适配器
Expand Down Expand Up @@ -69,7 +69,7 @@ class NotionApiAdaptor extends BaseBlogApi {
// ================================
// 下面这一段是更新postid,需要注意适配
// 写入属性到配置
const { getSetting, updateSetting } = useSettingStore()
const { getSetting, updateSetting } = usePublishSettingStore()
const setting = await getSetting()
const posidKey = this.cfg.posidKey
const id = post.originalId
Expand Down
4 changes: 2 additions & 2 deletions src/adaptors/api/notion/useNotionApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { createAppLogger } from "~/src/utils/appLogger.ts"
import { PublisherAppInstance } from "~/src/publisherAppInstance.ts"
import { Utils } from "~/src/utils/utils.ts"
import { NotionConfig } from "~/src/adaptors/api/notion/notionConfig.ts"
import { useSettingStore } from "~/src/stores/useSettingStore.ts"
import { usePublishSettingStore } from "~/src/stores/usePublishSettingStore.ts"
import { JsonUtil, ObjectUtil, StrUtil } from "zhi-common"
import { getDynPostidKey } from "~/src/platforms/dynamicConfig.ts"
import { NotionApiAdaptor } from "~/src/adaptors/api/notion/notionApiAdaptor.ts"
Expand All @@ -49,7 +49,7 @@ const useNotionApi = async (key: string, newCfg?: NotionConfig) => {
cfg = newCfg
} else {
// 从配置中获取数据
const { getSetting } = useSettingStore()
const { getSetting } = usePublishSettingStore()
const setting = await getSetting()
cfg = JsonUtil.safeParse<NotionConfig>(setting[key], {} as NotionConfig)

Expand Down
4 changes: 2 additions & 2 deletions src/adaptors/api/typecho/useTypechoApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import { createAppLogger } from "~/src/utils/appLogger.ts"
import { PublisherAppInstance } from "~/src/publisherAppInstance.ts"
import { Utils } from "~/src/utils/utils.ts"
import { useSettingStore } from "~/src/stores/useSettingStore.ts"
import { usePublishSettingStore } from "~/src/stores/usePublishSettingStore.ts"
import { TypechoConfig } from "~/src/adaptors/api/typecho/typechoConfig.ts"
import { JsonUtil, ObjectUtil, StrUtil } from "zhi-common"
import { getDynPostidKey } from "~/src/platforms/dynamicConfig.ts"
Expand Down Expand Up @@ -58,7 +58,7 @@ export const useTypechoApi = async (key?: string, newCfg?: TypechoConfig) => {
cfg = newCfg
} else {
// 从配置中获取数据
const { getSetting } = useSettingStore()
const { getSetting } = usePublishSettingStore()
const setting = await getSetting()
cfg = JsonUtil.safeParse<TypechoConfig>(setting[key], {} as TypechoConfig)
// 如果配置为空,则使用默认的环境变量值,并记录日志
Expand Down
4 changes: 2 additions & 2 deletions src/adaptors/api/vitepress/useVitepressApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import { createAppLogger } from "~/src/utils/appLogger.ts"
import { PublisherAppInstance } from "~/src/publisherAppInstance.ts"
import { useSettingStore } from "~/src/stores/useSettingStore.ts"
import { usePublishSettingStore } from "~/src/stores/usePublishSettingStore.ts"
import { JsonUtil, ObjectUtil, StrUtil } from "zhi-common"
import { Utils } from "~/src/utils/utils.ts"
import { getDynPostidKey } from "~/src/platforms/dynamicConfig.ts"
Expand All @@ -50,7 +50,7 @@ const useVitepressApi = async (key: string, newCfg?: VitepressConfig) => {
cfg = newCfg
} else {
// 从配置中获取数据
const { getSetting } = useSettingStore()
const { getSetting } = usePublishSettingStore()
const setting = await getSetting()
cfg = JsonUtil.safeParse<VitepressConfig>(setting[key], {} as VitepressConfig)

Expand Down
4 changes: 2 additions & 2 deletions src/adaptors/api/vuepress/useVuepressApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import { createAppLogger } from "~/src/utils/appLogger.ts"
import { PublisherAppInstance } from "~/src/publisherAppInstance.ts"
import { useSettingStore } from "~/src/stores/useSettingStore.ts"
import { usePublishSettingStore } from "~/src/stores/usePublishSettingStore.ts"
import { JsonUtil, ObjectUtil, StrUtil } from "zhi-common"
import { Utils } from "~/src/utils/utils.ts"
import { getDynPostidKey } from "~/src/platforms/dynamicConfig.ts"
Expand All @@ -50,7 +50,7 @@ const useVuepressApi = async (key: string, newCfg?: VuepressConfig) => {
cfg = newCfg
} else {
// 从配置中获取数据
const { getSetting } = useSettingStore()
const { getSetting } = usePublishSettingStore()
const setting = await getSetting()
cfg = JsonUtil.safeParse<VuepressConfig>(setting[key], {} as VuepressConfig)

Expand Down
4 changes: 2 additions & 2 deletions src/adaptors/api/vuepress2/useVuepress2Api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import { createAppLogger } from "~/src/utils/appLogger.ts"
import { PublisherAppInstance } from "~/src/publisherAppInstance.ts"
import { useSettingStore } from "~/src/stores/useSettingStore.ts"
import { usePublishSettingStore } from "~/src/stores/usePublishSettingStore.ts"
import { JsonUtil, ObjectUtil, StrUtil } from "zhi-common"
import { Utils } from "~/src/utils/utils.ts"
import { getDynPostidKey } from "~/src/platforms/dynamicConfig.ts"
Expand All @@ -50,7 +50,7 @@ const useVuepress2Api = async (key: string, newCfg?: Vuepress2Config) => {
cfg = newCfg
} else {
// 从配置中获取数据
const { getSetting } = useSettingStore()
const { getSetting } = usePublishSettingStore()
const setting = await getSetting()
cfg = JsonUtil.safeParse<Vuepress2Config>(setting[key], {} as Vuepress2Config)

Expand Down
4 changes: 2 additions & 2 deletions src/adaptors/api/wordpress/useWordpressApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import { createAppLogger } from "~/src/utils/appLogger.ts"
import { PublisherAppInstance } from "~/src/publisherAppInstance.ts"
import { Utils } from "~/src/utils/utils.ts"
import { useSettingStore } from "~/src/stores/useSettingStore.ts"
import { usePublishSettingStore } from "~/src/stores/usePublishSettingStore.ts"
import { JsonUtil, ObjectUtil, StrUtil } from "zhi-common"
import { WordpressConfig } from "~/src/adaptors/api/wordpress/wordpressConfig.ts"
import { WordpressApiAdaptor } from "~/src/adaptors/api/wordpress/wordpressApiAdaptor.ts"
Expand Down Expand Up @@ -58,7 +58,7 @@ export const useWordpressApi = async (key?: string, newCfg?: WordpressConfig) =>
cfg = newCfg
} else {
// 从配置中获取数据
const { getSetting } = useSettingStore()
const { getSetting } = usePublishSettingStore()
const setting = await getSetting()
cfg = JsonUtil.safeParse<WordpressConfig>(setting[key], {} as WordpressConfig)
// 如果配置为空,则使用默认的环境变量值,并记录日志
Expand Down
4 changes: 2 additions & 2 deletions src/adaptors/api/yuque/useYuqueApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { createAppLogger } from "~/src/utils/appLogger.ts"
import { PublisherAppInstance } from "~/src/publisherAppInstance.ts"
import { Utils } from "~/src/utils/utils.ts"
import { YuqueConfig } from "~/src/adaptors/api/yuque/yuqueConfig.ts"
import { useSettingStore } from "~/src/stores/useSettingStore.ts"
import { usePublishSettingStore } from "~/src/stores/usePublishSettingStore.ts"
import { JsonUtil, ObjectUtil, StrUtil } from "zhi-common"
import { getDynPostidKey } from "~/src/platforms/dynamicConfig.ts"
import { YuqueApiAdaptor } from "~/src/adaptors/api/yuque/yuqueApiAdaptor.ts"
Expand All @@ -49,7 +49,7 @@ const useYuqueApi = async (key: string, newCfg?: YuqueConfig) => {
cfg = newCfg
} else {
// 从配置中获取数据
const { getSetting } = useSettingStore()
const { getSetting } = usePublishSettingStore()
const setting = await getSetting()
cfg = JsonUtil.safeParse<YuqueConfig>(setting[key], {} as YuqueConfig)

Expand Down
6 changes: 3 additions & 3 deletions src/adaptors/base/baseExtendApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import { DynamicConfig } from "~/src/platforms/dynamicConfig.ts"
import { CATE_AUTO_NAME, MUST_USE_OWN_PLATFORM, MUST_USE_PICBED_PLATFORM } from "~/src/utils/constants.ts"
import { toRaw } from "vue"
import _ from "lodash"
import { usePublishPreferenceSetting } from "~/src/stores/usePublishPreferenceSetting.ts"
import { usePreferenceSettingStore } from "~/src/stores/usePreferenceSettingStore.ts"
import { SiyuanDevice } from "zhi-device"
import { SypConfig } from "~/syp.config.ts"

Expand Down Expand Up @@ -155,7 +155,7 @@ class BaseExtendApi extends WebApi implements IBlogApi, IWebApi {
post.mdFilename = filename
}

const { getReadOnlyPublishPreferenceSetting } = usePublishPreferenceSetting()
const { getReadOnlyPublishPreferenceSetting } = usePreferenceSettingStore()
const pref = getReadOnlyPublishPreferenceSetting()
if (pref.value.fixTitle) {
post.title = HtmlUtil.removeTitleNumber(post.title).replace(/\.md/g, "")
Expand Down Expand Up @@ -263,7 +263,7 @@ class BaseExtendApi extends WebApi implements IBlogApi, IWebApi {
md = md.replace(/\*\*(.*?)\*\*/g, '<span style="font-weight: bold;" data-type="strong">$1</span>')

// 处理外链
const { getReadOnlyPublishPreferenceSetting } = usePublishPreferenceSetting()
const { getReadOnlyPublishPreferenceSetting } = usePreferenceSettingStore()
const pref = getReadOnlyPublishPreferenceSetting()
const outerLinkRegex = /\[(.+?)]\(siyuan:\/\/blocks\/(\d+-\w+)\)/g
md = await this.replaceOuterLinks(md, outerLinkRegex, { pref, cfg, setting })
Expand Down
Loading

0 comments on commit c1b646a

Please sign in to comment.