Skip to content

Commit 3c8c491

Browse files
authored
Merge pull request #230 from terwerinc/dev
fix(utils): fix share error for old UI
2 parents 502533b + 5036748 commit 3c8c491

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/topbar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class Topbar {
108108
if (vipInfo.code === 0) {
109109
const docCheck = this.checkDocId()
110110
if (docCheck.flag) {
111-
const docInfo = await this.shareService.getSharedDocInfo(docCheck.docId)
111+
const docInfo = await this.shareService.getSharedDocInfo(docCheck.docId, cfg?.serviceApiConfig?.token ?? "")
112112
const isShared = docInfo.code === 0
113113
const shareData = docInfo?.data ? JSON.parse(docInfo.data) : null
114114
if (shareData) {

src/utils/AttrUtils.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,14 @@ class AttrUtils {
8686

8787
// 处理每个字段
8888
fieldMappings.forEach(({ objectKey, settingKey, isNumber }) => {
89+
// 首先检查 from 是否存在
90+
if (!from || typeof from !== "object") {
91+
attrs[settingKey] = ""
92+
return attrs
93+
}
8994
// 1. 获取原始值(直接从接口键名获取)
90-
const value = from[objectKey]
95+
// const value = from[objectKey]
96+
const value = Object.prototype.hasOwnProperty.call(from, objectKey) ? from[objectKey] : undefined
9197

9298
// 2. 验证逻辑(完全拆解版)
9399
// 2.1 检查值是否已定义

0 commit comments

Comments
 (0)