fix: accept access token response

This commit is contained in:
rain
2026-07-11 09:41:32 +08:00
parent 8a18202878
commit edc0a58a54
4 changed files with 20 additions and 3 deletions
+17
View File
@@ -178,6 +178,23 @@ async function run() {
);
assert.strictEqual(missingTokenStore.getItem('token-key'), null);
const snakeTokenStore = createStore();
const snakeTokenClient = GenealogyApi.createClient({
baseUrl: 'http://182.61.18.23:8080',
clientId: 'client-x',
tenantId: 'tenant-x',
tokenKey: 'token-key',
tokenStore: snakeTokenStore,
axiosInstance: {
request: async () => ({
status: 200,
data: { code: 200, data: { access_token: 'snake-token' } }
})
}
});
await snakeTokenClient.login({ phone: '13800000000', password: 'md5' });
assert.strictEqual(snakeTokenStore.getItem('token-key'), 'snake-token');
store.setItem('token-key', 'logout-token');
await client.logout();
assert.strictEqual(calls[9].url, '/genealogy/pc/auth/logout');