Commit 560eb614 by v_vjyjiang

d

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