设备号
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
import { sys } from "cc";
|
||||
|
||||
export default class KVStore {
|
||||
constructor(private prefix = "app:") {}
|
||||
private key(k: string) { return `${this.prefix}${k}`; }
|
||||
|
||||
get(k: string): string | null { return sys.localStorage.getItem(this.key(k)); }
|
||||
set(k: string, v: string): void { sys.localStorage.setItem(this.key(k), v); }
|
||||
remove(k: string): void { sys.localStorage.removeItem(this.key(k)); }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "be7e3168-3885-4ad8-8775-8e2f1fe957ce",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
Reference in New Issue
Block a user