Commit 560eb614 by v_vjyjiang

d

parent 610b2eb8
......@@ -19,23 +19,7 @@ module.exports = function (app) {
app.use(bodyParser.json({ limit: '50mb' }));
app.use(bodyParser.urlencoded({ limit: '50mb', extended: true }));
routes(app);//初始化路由
app.use(history(
{
rewrites: [
{
from: /.*/,
to: function (context) {
if (context.parsedUrl.pathname.indexOf("autologin") >= 0) {
return context.parsedUrl.pathname
} else {
return '/index.html';
}
}
}
]
}
));
app.use(history());
app.use(express.static(path.join(settings.basepath, '/app/front/entry/public')));
// development only
if ('development' == app.get('env')) {
......
......@@ -7,7 +7,7 @@ const companyS = System.getObject("service.common.companySve")
const settings = require("../settings.js")
let channelCache = {};
module.exports = function (app) {
app.get("/autologin", async function (req, res, next) {
app.post("/autologin", async function (req, res, next) {
let appkey = req.query.appkey.trim()
if (!appkey) {
res.end("没有资质宝appkey,请联系资质宝服务提供方")
......@@ -70,7 +70,8 @@ module.exports = function (app) {
uf = await userS.registerByTantent(reguser)
}
let rtnobj = await userS.loginApp(appkey, userName)
res.redirect(rtnobj.homePage + "?code=" + rtnobj.code)
let rtn = JSON.stringify({ openurl: rtnobj.homePage + "?code=" + rtnobj.code })
res.end(rtn)
})
app.post("*", async function (req, res, next) {
try {
......
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