feat: migrate platform login scenes and native login flows

This commit is contained in:
2026-09-06 09:06:00 +08:00
parent f2a948f059
commit 695d3be25c
140 changed files with 7599 additions and 4397 deletions
@@ -0,0 +1,15 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { readPhoneCode } from '../../YouleNexus/assets/framework/adapters/native/phone-code.ts';
test('original phone cache restores the number and 30-second remainder without auto-filling the code',()=>{
const raw=JSON.stringify({phoneNumber:'0013800138000',code:'1234',codeTime:1000});
assert.deepEqual(readPhoneCode(raw,2500),{phoneNumber:'0013800138000',restTime:28});
assert.deepEqual(readPhoneCode(raw,31000),{phoneNumber:'0013800138000',restTime:0});
assert.deepEqual(readPhoneCode(raw,32000),{phoneNumber:'0013800138000',restTime:0});
assert.equal(readPhoneCode(null,32000),null);
});
test('malformed phone cache exposes the source error',()=>{
assert.throws(()=>readPhoneCode('{',100),SyntaxError);
assert.throws(()=>readPhoneCode(JSON.stringify({phoneNumber:'123',codeTime:'bad'}),100),/codeTime/);
});