mirror of
https://github.com/shuaiplus/nodewarden.git
synced 2026-06-20 21:00:41 +00:00
docs: update README files for clarity on deployment steps and features
This commit is contained in:
+5
-18
@@ -30,7 +30,11 @@ export function loadSession(): SessionState | null {
|
||||
if (!raw) return null;
|
||||
const parsed = JSON.parse(raw) as SessionState;
|
||||
if (!parsed.accessToken || !parsed.refreshToken) return null;
|
||||
return parsed;
|
||||
return {
|
||||
accessToken: parsed.accessToken,
|
||||
refreshToken: parsed.refreshToken,
|
||||
email: parsed.email,
|
||||
};
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
@@ -45,8 +49,6 @@ export function saveSession(session: SessionState | null): void {
|
||||
accessToken: session.accessToken,
|
||||
refreshToken: session.refreshToken,
|
||||
email: session.email,
|
||||
symEncKey: session.symEncKey,
|
||||
symMacKey: session.symMacKey,
|
||||
};
|
||||
localStorage.setItem(SESSION_KEY, JSON.stringify(persisted));
|
||||
}
|
||||
@@ -328,21 +330,6 @@ export async function getSends(authedFetch: (input: string, init?: RequestInit)
|
||||
return body?.data || [];
|
||||
}
|
||||
|
||||
export async function updateProfile(
|
||||
authedFetch: (input: string, init?: RequestInit) => Promise<Response>,
|
||||
payload: { name: string; email: string }
|
||||
): Promise<Profile> {
|
||||
const resp = await authedFetch('/api/accounts/profile', {
|
||||
method: 'PUT',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(payload),
|
||||
});
|
||||
if (!resp.ok) throw new Error('Save profile failed');
|
||||
const body = await parseJson<Profile>(resp);
|
||||
if (!body) throw new Error('Invalid profile');
|
||||
return body;
|
||||
}
|
||||
|
||||
export async function changeMasterPassword(
|
||||
authedFetch: (input: string, init?: RequestInit) => Promise<Response>,
|
||||
args: {
|
||||
|
||||
@@ -196,6 +196,7 @@ const messages: Record<Locale, Record<string, string>> = {
|
||||
txt_copied: "Copied",
|
||||
txt_log_in: "Log In",
|
||||
txt_log_out: "Log Out",
|
||||
txt_lock: "Lock",
|
||||
txt_login: "Login",
|
||||
txt_login_credentials: "Login Credentials",
|
||||
txt_login_failed: "Login failed",
|
||||
@@ -368,7 +369,7 @@ const zhCNOverrides: Record<string, string> = {
|
||||
nav_device_management: '设备管理',
|
||||
nav_support_center: '支持中心',
|
||||
support_title: '支持中心',
|
||||
support_under_construction: '正在搭建中。',
|
||||
support_under_construction: '正在搭建中',
|
||||
txt_sign_out: '退出登录',
|
||||
txt_log_in: '登录',
|
||||
txt_log_out: '退出',
|
||||
@@ -392,7 +393,7 @@ const zhCNOverrides: Record<string, string> = {
|
||||
txt_search_your_secure_vault: '搜索你的保险库...',
|
||||
txt_refresh: '刷新',
|
||||
txt_sync: '同步',
|
||||
txt_sync_vault: '同步保险库',
|
||||
txt_sync_vault: '同步',
|
||||
txt_add: '新增',
|
||||
txt_edit: '编辑',
|
||||
txt_delete: '删除',
|
||||
@@ -720,6 +721,8 @@ const zhCNOverrides: Record<string, string> = {
|
||||
txt_copied: '已复制',
|
||||
};
|
||||
|
||||
zhCNOverrides.txt_lock = '\u9501\u5b9a';
|
||||
|
||||
messages['zh-CN'] = { ...messages.en, ...zhCNOverrides };
|
||||
|
||||
function resolveInitialLocale(): Locale {
|
||||
|
||||
Reference in New Issue
Block a user