增加新模块

This commit is contained in:
何江明
2025-03-20 08:46:07 +08:00
parent 15014e22aa
commit 2ae62b59ed
1729 changed files with 94700 additions and 4232 deletions
+44
View File
@@ -0,0 +1,44 @@
"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