整体UI修改

This commit is contained in:
谢宇宁
2026-10-27 17:39:27 +07:00
parent 8cdbfee08f
commit e289658a28
99 changed files with 1227 additions and 4118 deletions
+3 -3
View File
@@ -11,11 +11,11 @@ async function moduleUrl(file,transform=code=>code){
const protocol=await moduleUrl('../src/lib/api/protocol.ts'),auth=await moduleUrl('../src/lib/client/auth.ts');
const apiUrl=await moduleUrl('../src/lib/client/api.ts',code=>code.replace('"../api/protocol"',JSON.stringify(protocol)).replace('"./auth"',JSON.stringify(auth)));
const {ApiClient}=await import(apiUrl);
const startupUrl='data:text/javascript,export const calls=[];export function startTracker(){calls.push("tracker")}export function startApplication(...args){calls.push(args)}';
const startupUrl='data:text/javascript,export const calls=[];export function startApplication(...args){calls.push(args)}';
const startup=await import(startupUrl);
const scriptUrl='data:text/javascript,export default function Script(){}';
const runtimeUrl=await moduleUrl('../src/components/site/SiteRuntime.tsx',code=>{
const imports={'react/jsx-runtime':import.meta.resolve('react/jsx-runtime'),'next/script':scriptUrl,'@/lib/client/application':startupUrl,'@/lib/client/analytics':startupUrl};
const imports={'react/jsx-runtime':import.meta.resolve('react/jsx-runtime'),'next/script':scriptUrl,'@/lib/client/application':startupUrl};
for(const [path,url] of Object.entries(imports))for(const quote of ["'",'"'])code=code.replace(quote+path+quote,JSON.stringify(url));
return code;
});
@@ -63,7 +63,7 @@ test('home, player, navigation and wallet hydration starts normally without logg
for(const page of [{path:'/',panel:'home'},{path:'/detail/7/',player:{title:'短剧'}},{path:'/info/deposit/page/2/',panel:'info',info:{key:'deposit',wallet}}]){
const start=startup.calls.length;
SiteRuntime({home,homeLoaded:true,page,navigation}).props.onReady();
assert.equal(startup.calls[start],'tracker');assert.equal(startup.calls[start+1][0],home);assert.equal(startup.calls[start+1][3],page);
assert.equal(startup.calls.length,start+1);assert.equal(startup.calls[start][0],home);assert.equal(startup.calls[start][3],page);
}
assert.equal(wallet.user.token,'session-secret');
});