Skip to content

Commit

Permalink
fix: 对不支持标签的平台隐藏标签设置
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Sep 5, 2023
1 parent 7ecfb23 commit 690bf9d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
10 changes: 9 additions & 1 deletion src/adaptors/web/wechat/wechatWebAdaptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import { BaseWebApi } from "~/src/adaptors/web/base/baseWebApi.ts"
import * as cheerio from "cheerio"
import { HtmlUtil, JsonUtil, ObjectUtil, StrUtil } from "zhi-common"
import {Post, UserBlog} from "zhi-blog-api"
import { Post, UserBlog } from "zhi-blog-api"
import { toRaw } from "vue"
import { isDev } from "~/src/utils/constants.ts"

Expand Down Expand Up @@ -472,6 +472,14 @@ class WechatWebAdaptor extends BaseWebApi {
const token = this.cfg.metadata.token
return `https://mp.weixin.qq.com/cgi-bin/appmsg?t=media/appmsg_edit&action=edit&type=77&appmsgid=${postid}&token=${token}&lang=zh_CN`
}

public async uploadFile(file: File | Blob, filename?: string): Promise<any> {
this.logger.debug(`wechat start uploadFile ${filename}=>`, file)
if (file instanceof Blob) {
}

return {}
}
}

export { WechatWebAdaptor }
8 changes: 4 additions & 4 deletions src/types/IPublishCfg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
*/

import { SypConfig } from "~/syp.config.ts"
import { CommonBlogConfig } from "~/src/adaptors/api/base/commonBlogConfig.ts"
import { DynamicConfig } from "~/src/platforms/dynamicConfig.ts"
import { BlogConfig } from "zhi-blog-api"

/**
* 表示发布配置的接口
Expand All @@ -48,11 +48,11 @@ interface IPublishCfg {
dynamicConfigArray: DynamicConfig[]

/**
* CommonBlogConfig 类型的配置对象
* BlogConfig 类型的配置对象
*
* @type {CommonBlogConfig}
* @type {BlogConfig}
*/
cfg: CommonBlogConfig
cfg: BlogConfig

/**
* DynamicConfig 类型的动态配置对象
Expand Down
2 changes: 1 addition & 1 deletion src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const DYNAMIC_CONFIG_KEY = "dynamic-config"
/**
* 必须使用平台自带的图片上传的平台
*/
export const MUST_USE_OWN_PLATFORM = ["custom_Zhihu", "custom_Csdn"]
export const MUST_USE_OWN_PLATFORM = ["custom_Zhihu", "custom_Csdn", "custom_Wechat"]

/**
* 必须使用图床的平台
Expand Down

0 comments on commit 690bf9d

Please sign in to comment.