ARTEX — AI 自主渗透测试系统(Go 后端 + Next.js 前端,单二进制内嵌)。 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
20 lines
441 B
TypeScript
20 lines
441 B
TypeScript
"use client";
|
|
|
|
export function setLocalStorageValue(key: string, value: string) {
|
|
try {
|
|
window.localStorage.setItem(key, value);
|
|
} catch (error) {
|
|
if (process.env.NODE_ENV !== "production") {
|
|
console.error("[localStorage] Failed to write value:", error);
|
|
}
|
|
}
|
|
}
|
|
|
|
export function getLocalStorageValue(key: string): string | null {
|
|
try {
|
|
return window.localStorage.getItem(key);
|
|
} catch {
|
|
return null;
|
|
}
|
|
}
|