Commit e188adb7 by 王昆

gsb

parent bbb9e050
...@@ -24,7 +24,7 @@ module.exports = (db, DataTypes) => { ...@@ -24,7 +24,7 @@ module.exports = (db, DataTypes) => {
indexes: [ indexes: [
// Create a unique index on email // Create a unique index on email
// { // {
// unique: true, // unique: true,sign_body
// fields: ['email'] // fields: ['email']
// }, // },
// //
......
...@@ -27,7 +27,7 @@ module.exports = function (app) { ...@@ -27,7 +27,7 @@ module.exports = function (app) {
app.all('*', function (req, res, next) { app.all('*', function (req, res, next) {
req.objs = system; req.objs = system;
res.header('Access-Control-Allow-Origin', '*'); res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Headers', 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With , yourHeaderFeild, xggadminsid'); res.header('Access-Control-Allow-Headers', 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With , yourHeaderFeild, bpostatsid');
res.header('Access-Control-Allow-Methods', 'PUT, POST, GET, DELETE, OPTIONS'); res.header('Access-Control-Allow-Methods', 'PUT, POST, GET, DELETE, OPTIONS');
// res.header('Access-Control-Allow-Credentials', 'true'); // res.header('Access-Control-Allow-Credentials', 'true');
if (req.method == 'OPTIONS') { if (req.method == 'OPTIONS') {
......
...@@ -5,53 +5,40 @@ var userCtl = system.getObject("web.auth.userCtl"); ...@@ -5,53 +5,40 @@ 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) {
// var xggadminsid; let bpostatsid = req.headers["bpostatsid"] || "";
// var jsonUser = req.session.user; jsonUser = await redisClient.get(bpostatsid);
// // var jsonUser = null; if (jsonUser) {
// if(!jsonUser) { jsonUser = JSON.parse(jsonUser);
// xggadminsid = req.headers["xggadminsid"] || ""; }
// jsonUser = await redisClient.get(xggadminsid);
// if(jsonUser) { if (req.url.indexOf("auth/userCtl/login") > 0 ||
// jsonUser = JSON.parse(jsonUser); req.url.indexOf("auth/userCtl/register") > 0 ||
// } req.url.indexOf("getRsConfig") > 0) {
// }
// if (jsonUser) {
// if (req.url.indexOf("auth/userCtl/login") > 0 || req.loginUser = jsonUser;
// req.url.indexOf("uc/userCtl/login") > 0 || } else {
// req.url.indexOf("auth/userCtl/smsCode") > 0 || req.loginUser = null;
// req.url.indexOf("common/metaCtl/getApiDoc") > 0 || }
// req.url.indexOf("common/captchaCtl/captcha") > 0 || return next();
// }
// req.url.indexOf("getRsConfig") > 0) {
// if (jsonUser) { if (!jsonUser) {
// req.loginUser = jsonUser; res.end(JSON.stringify({status: -99, msg: "no login"}));
// } else { return;
// req.loginUser = null; }
// }
// return next(); if (bpostatsid) {
// } redisClient.setWithEx(bpostatsid, JSON.stringify(jsonUser), 60 * 60 * 60);
// }
// if (!jsonUser) {
// res.end(JSON.stringify({ status: -99, msg: "no login" })); req.loginUser = jsonUser;
// return; next();
// } });
//
// if(xggadminsid) {
// redisClient.setWithEx(xggadminsid, JSON.stringify(jsonUser), 60 * 60 * 60);
// }
//
// req.loginUser = jsonUser;
// // if(req.loginUser.uctype != 3) {
// // res.end(JSON.stringify({ status: -99, msg: "no deliver user, kick off" }));
// // return;
// // }
// req.loginUser = jsonUser;
// 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});
// console.log(req.hostname); // console.log(req.hostname);
// var appinfo=await metaCtl.getAppInfo(req); // var appinfo=await metaCtl.getAppInfo(req);
...@@ -68,7 +55,7 @@ module.exports = function (app) { ...@@ -68,7 +55,7 @@ module.exports = function (app) {
classPath = gname + "." + classPath; classPath = gname + "." + classPath;
var params = []; var params = [];
if(req.loginUser) { if (req.loginUser) {
req.query = req.query || {}; req.query = req.query || {};
req.query.sign_body = req.loginUser.sign_body; req.query.sign_body = req.loginUser.sign_body;
} }
...@@ -100,7 +87,7 @@ module.exports = function (app) { ...@@ -100,7 +87,7 @@ module.exports = function (app) {
req.body.agent = req.headers["user-agent"]; req.body.agent = req.headers["user-agent"];
req.body.classname = classPath; req.body.classname = classPath;
if(req.loginUser) { if (req.loginUser) {
req.body.saas_id = req.loginUser.saas_id; req.body.saas_id = req.loginUser.saas_id;
req.body.sign_body = req.loginUser.sign_body; req.body.sign_body = req.loginUser.sign_body;
} }
......
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