重复请求了多语言文案并且包含了错误的请求参数 #50
Labels
No Label
area/smartpanel
bug
done-waiting-confirmed
kind/feature
page/admin
page/simplepage
page/tab-admin
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: smartoilets-front/projects#50
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
问题
两个问题:
只需要保留带有 type=simplepage 的那一条请求就可以了
https://smartoilets.net/openapi/api/configI18N/info/get?retainAlertTextReplaceCopy=true&siteName=twsc&mode=keyName&type=simplepage
新API
https://smartoilets.net/openapi/api/configI18N/v1/get?typeNames=simplepage,wcName,device&siteName=KWH&profile=${PROFILE}
可以从这个API获取到可用的 type,https://smartoilets.net/openapi/api/configI18N/info/types (需要token)
profile 参数则是页面URL中的 profile query 参数
API 进行了破坏性变更,数据结构与原来的API不同。
data 第一层是类型,第二层则是多语言文案对象,包含id name以及语言对应的文案。
simplepage 中多语言命名: {{availablecount}} 因此使用的是多语言文案对象的name字段,而不应该使用 ID, 虽然返回了 ID,但前端都应该使用 name 来进行匹配。
TODO: SVG命名规范应该需要更新为 {{ I18N.${type}.key }}, 例如 {{ I18N.simplepage.availablecount }} 表示可用座厕多语言文案。 与 {{ siteName }} (从URL获取到的变量值) 进行区分
^^^
SVG多语言文案命名更新:
原本是直接在标签里面用 文本 作为 多语言文案的key,现在更新为在标签里面添加一个 i18nid 的 attribute, 值为 I18N 多语言文案的key
例如目前是这样的
更新后为
因此这里的多语言文案最终会 找到 type 为 simplepage 且 key 为 availablecount 的内容.
只需要保留带有 type=simplepage 的那一条请求就可以了
看下中午是否有空处理,至少将所有重复的请求都添加type=simplepage参数