feat(api): 完善家谱系统API客户端契约
- 实现家谱管理相关方法,包括创建、详情、概览、我的家谱和选项查询 - 添加家谱加入申请功能,支持申请、审核、取消和待审核列表操作 - 集成通知详情获取方法和通知ID安全验证机制 - 完善功德记录、谱文、相册、视频、祭祀活动的完整CRUD操作契约 - 实现家谱成员管理功能,包含成员列表、更新、移除和转让所有者操作 - 优化路径ID验证逻辑,拒绝不安全的数值ID并提供明确错误提示 - 更新测试用例以验证所有新增API方法的路径和请求体白名单机制
This commit is contained in:
@@ -121,11 +121,17 @@
|
||||
});
|
||||
}
|
||||
|
||||
function normalizeGenealogyId(value) {
|
||||
var text = String(value === undefined || value === null ? '' : value).trim();
|
||||
|
||||
return /^[1-9][0-9]*$/.test(text) ? text : '';
|
||||
}
|
||||
|
||||
function getGenealogyId(search) {
|
||||
var source = search === undefined ? (window.location && window.location.search) : search;
|
||||
var params = new URLSearchParams(String(source || '').replace(/^\?/, ''));
|
||||
|
||||
return params.get('genealogyId') || '';
|
||||
return normalizeGenealogyId(params.get('genealogyId'));
|
||||
}
|
||||
|
||||
function withGenealogyId(href, genealogyId) {
|
||||
@@ -135,6 +141,7 @@
|
||||
var parts;
|
||||
var params;
|
||||
|
||||
genealogyId = normalizeGenealogyId(genealogyId);
|
||||
if (!genealogyId || !value || value.charAt(0) === '#' || /^(?:https?:|mailto:|tel:)/i.test(value)) return value;
|
||||
hashIndex = value.indexOf('#');
|
||||
if (hashIndex >= 0) {
|
||||
@@ -278,6 +285,7 @@
|
||||
closeLogout: closeLegacyLogout,
|
||||
initLayui: initLayui,
|
||||
getGenealogyId: getGenealogyId,
|
||||
normalizeGenealogyId: normalizeGenealogyId,
|
||||
withGenealogyId: withGenealogyId,
|
||||
getGenealogyEntryUrl: getGenealogyEntryUrl,
|
||||
syncGenealogyContextLinks: syncGenealogyContextLinks
|
||||
|
||||
Reference in New Issue
Block a user