Commit 7b70c9cd by 王昆

gsb

parent 1efbfed3
...@@ -5,37 +5,37 @@ var userCtl = system.getObject("web.auth.userCtl"); ...@@ -5,37 +5,37 @@ var userCtl = system.getObject("web.auth.userCtl");
const redisClient = system.getObject("util.redisClient"); const redisClient = system.getObject("util.redisClient");
module.exports = function (app) { module.exports = function (app) {
// app.all("/web/*", async function (req, res, next) { app.all("/web/*", async function (req, res, next) {
// let bpostatsid = req.headers["bpostatsid"] || ""; let bpostatsid = req.headers["bpostatsid"] || "";
// jsonUser = await redisClient.get(bpostatsid); jsonUser = await redisClient.get(bpostatsid);
// if (jsonUser) { if (jsonUser) {
// jsonUser = JSON.parse(jsonUser); jsonUser = JSON.parse(jsonUser);
// } }
//
// if (req.url.indexOf("auth/userCtl/login") > 0 || if (req.url.indexOf("auth/userCtl/login") > 0 ||
// req.url.indexOf("auth/userCtl/register") > 0 || req.url.indexOf("auth/userCtl/register") > 0 ||
// req.url.indexOf("getRsConfig") > 0) { req.url.indexOf("getRsConfig") > 0) {
//
// if (jsonUser) { if (jsonUser) {
// req.loginUser = jsonUser; req.loginUser = jsonUser;
// } else { } else {
// req.loginUser = null; req.loginUser = null;
// } }
// return next(); return next();
// } }
//
// if (!jsonUser) { if (!jsonUser) {
// res.end(JSON.stringify({status: -99, msg: "no login"})); res.end(JSON.stringify({status: -99, msg: "no login"}));
// return; return;
// } }
//
// if (bpostatsid) { if (bpostatsid) {
// redisClient.setWithEx(bpostatsid, JSON.stringify(jsonUser), 60 * 60 * 60); redisClient.setWithEx(bpostatsid, JSON.stringify(jsonUser), 60 * 60 * 60);
// } }
//
// req.loginUser = jsonUser; req.loginUser = jsonUser;
// next(); next();
// }); });
app.get("/", async function (req, res) { app.get("/", async function (req, res) {
res.render("index", {appinfo: null, app: null}); res.render("index", {appinfo: null, app: null});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment