Files
frontend-app/unpackage/dist/dev/mp-weixin/utils/auth.js
T
2025-03-20 08:46:07 +08:00

45 lines
1.1 KiB
JavaScript

"use strict";
const common_vendor = require("../common/vendor.js");
const TOKEN_NAME = "fcc-token";
const USER_KEY = "fcc-user-key";
const USER_DATA = "fcc-user-data";
const USER_LOGIN_TIME = "fcc-login-time";
function setStorageFun(key, value, sync = true) {
try {
if (sync) {
return common_vendor.index.setStorageSync(key, value);
} else {
common_vendor.index.setStorage({
key,
data: value
});
}
} catch (e) {
}
}
function getStorageFun(key, sync = true) {
try {
if (sync) {
return common_vendor.index.getStorageSync(key);
} else {
let data = "";
common_vendor.index.getStorage({
key,
success: function(res) {
data = res.data;
}
});
return data;
}
} catch (e) {
return false;
}
}
exports.TOKEN_NAME = TOKEN_NAME;
exports.USER_DATA = USER_DATA;
exports.USER_KEY = USER_KEY;
exports.USER_LOGIN_TIME = USER_LOGIN_TIME;
exports.getStorageFun = getStorageFun;
exports.setStorageFun = setStorageFun;
//# sourceMappingURL=../../.sourcemap/mp-weixin/utils/auth.js.map