This commit is contained in:
tamaina
2021-02-15 06:17:21 +09:00
parent bf1db27824
commit 1ae1385d43
6 changed files with 51 additions and 55 deletions

View File

@@ -1,7 +1,7 @@
import { get } from 'idb-keyval';
export async function getAccountFromId(id: string) {
const accounts = await get('accounts') as { token: string; id: string; }[];
if (!accounts) console.log('Accounts are not recorded');
return accounts.find(e => e.id === id)
const accounts = await get('accounts') as { token: string; id: string; }[];
if (!accounts) console.log('Accounts are not recorded');
return accounts.find(e => e.id === id);
}

View File

@@ -1,11 +1,11 @@
export function appendLoginId(url: string, loginId: string) {
const u = new URL(url, origin);
u.searchParams.append('loginId', loginId);
return u.toString();
const u = new URL(url, origin);
u.searchParams.append('loginId', loginId);
return u.toString();
}
export function deleteLoginId(url: string) {
const u = new URL(url);
u.searchParams.delete('loginId');
return u.toString();
const u = new URL(url);
u.searchParams.delete('loginId');
return u.toString();
}