矿场列表

This commit is contained in:
saplf
2019-09-03 17:24:52 +08:00
parent 47d7819f2d
commit 8742eedac8
13 changed files with 492 additions and 263 deletions

View File

@@ -15,8 +15,8 @@ const successLabel = 'color:white;background-color:green;padding: 1px 2px';
const failureLabel = 'color:white;background-color:red;padding: 1px 2px';
const originLabel = 'color:unset;background-color:unset;padding:unset';
const baseURL = 'https://server.fiv.tacever.org/v1';
// const baseURL = '//yapi.faronear.org/mock/20/v1';
// const baseURL = 'https://server.fiv.tacever.org/v1';
const baseURL = '//yapi.faronear.org/mock/20/v1';
const instance = axios.create({
baseURL,
});

View File

@@ -1,7 +1,9 @@
const userKey = 'user-key';
const areaCodeKey = 'area-code-key';
const mineListKey = 'mine-list-key';
// user info from now on
function storeUser(user: any = undefined) {
if (user === undefined) {
localStorage.removeItem(userKey);
@@ -20,6 +22,8 @@ function loadUser() {
const clearUser = storeUser;
// area code info from now on
function storeAreaCode(codes: any) {
localStorage.setItem(areaCodeKey, JSON.stringify(codes));
}
@@ -32,6 +36,20 @@ function loadAreaCode() {
}
}
// mine list info from now on
function storeMineList(list: any) {
localStorage.setItem(mineListKey, JSON.stringify(list));
}
function loadMineList() {
try {
return JSON.parse(localStorage.getItem(mineListKey) || 'null');
} catch (e) {
return null;
}
}
export {
storeUser,
loadUser,
@@ -39,4 +57,7 @@ export {
storeAreaCode,
loadAreaCode,
storeMineList,
loadMineList,
}