修改功能

This commit is contained in:
2026-08-29 19:06:07 +08:00
parent f94c652c7c
commit aaed0584b1
142 changed files with 6176 additions and 869 deletions
+12 -2
View File
@@ -6,6 +6,16 @@ const test = require('node:test');
const modulePath = path.join(__dirname, '..', 'public', 'js', 'album-pages.js');
const AlbumPages = fs.existsSync(modulePath) ? require(modulePath) : {};
function fileAccess(name, url) {
return {
fileId: '2060000000000000090',
ossId: '2060000000000000091',
fileName: name,
mediaType: 'image/jpeg',
accessUrl: url
};
}
function requireFunction(name) {
assert.equal(typeof AlbumPages[name], 'function', `缺少 AlbumPages.${name}`);
return AlbumPages[name];
@@ -106,7 +116,7 @@ test('相册和照片响应使用完整 PC Vo 并拒绝不安全 ID', () => {
genealogyId: '2060000000000000002',
albumId: '2060000000000000001',
albumName: '祠堂旧影',
ossId: '2060000000000000005',
photoFile: fileAccess('photo.jpg', 'https://files.example/photo.jpg'),
photoTitle: '合影',
photoDesc: '清明祭祖',
photographer: '宗亲',
@@ -119,7 +129,7 @@ test('相册和照片响应使用完整 PC Vo 并拒绝不安全 ID', () => {
assert.equal(album.albumId, '2060000000000000001');
assert.equal(album.photoCount, 2);
assert.equal(photo.photoId, '2060000000000000004');
assert.equal(photo.ossId, '2060000000000000005');
assert.equal(photo.photoFile.accessUrl, 'https://files.example/photo.jpg');
assert.equal(normalizeAlbum({
albumId: Number('2060000000000000001'),
genealogyId: '2',