|
@@ -9,18 +9,21 @@ const _store = {
|
|
|
loginName: "",
|
|
|
password: "",
|
|
|
server: { host: "", name: "" },
|
|
|
- user: {},
|
|
|
- },
|
|
|
+ user: {} as Store["env"]["user"],
|
|
|
+ exam: {} as Store["env"]["exam"],
|
|
|
+ examId: -1,
|
|
|
+ } as Store["env"],
|
|
|
config: JSON.parse(JSON.stringify(window.electron.config)) || {},
|
|
|
- pageInputs: {},
|
|
|
+ pageInputs: {} as Store["pageInputs"],
|
|
|
+ syncTime: [],
|
|
|
} as Store;
|
|
|
|
|
|
// for dev
|
|
|
-Object.assign(
|
|
|
- _store,
|
|
|
- JSON.parse(window.localStorage.getItem("store") || "{}"),
|
|
|
- { config: JSON.parse(JSON.stringify(window.electron.config)) || {} } // use 最新的config
|
|
|
-);
|
|
|
+// Object.assign(
|
|
|
+// _store,
|
|
|
+// JSON.parse(window.localStorage.getItem("store") || "{}"),
|
|
|
+// { config: JSON.parse(JSON.stringify(window.electron.config)) || {} } // use 最新的config
|
|
|
+// );
|
|
|
|
|
|
const handler = function () {
|
|
|
return {
|
|
@@ -38,7 +41,8 @@ const handler = function () {
|
|
|
if (!_inited) {
|
|
|
Object.assign(
|
|
|
_store,
|
|
|
- JSON.parse(window.localStorage.getItem("store") || "{}")
|
|
|
+ JSON.parse(window.localStorage.getItem("store") || "{}"),
|
|
|
+ { config: JSON.parse(JSON.stringify(window.electron.config)) || {} } // use 最新的config
|
|
|
);
|
|
|
_inited = true;
|
|
|
}
|