...
|
...
|
@@ -39,15 +39,6 @@ exports.createApp = async(app) => { |
|
|
res.status(200).end();
|
|
|
});
|
|
|
|
|
|
if (!app.locals.proEnv) {
|
|
|
app.use((req, res, next) => {
|
|
|
if (/cordova/.test(req.url)) {
|
|
|
return res.status(404).end();
|
|
|
}
|
|
|
return next();
|
|
|
});
|
|
|
}
|
|
|
|
|
|
app.use(require('./doraemon/middleware/backlist'));
|
|
|
|
|
|
const logger = global.yoho.logger;
|
...
|
...
|
@@ -94,6 +85,29 @@ exports.createApp = async(app) => { |
|
|
// YOHO 前置中间件
|
|
|
app.use(setYohoDataMiddleware);
|
|
|
app.use(userMiddleware);
|
|
|
|
|
|
if (!app.locals.proEnv) {
|
|
|
app.use((req, res, next) => {
|
|
|
if (/cordova/.test(req.url)) {
|
|
|
return res.status(404).end();
|
|
|
}
|
|
|
return next();
|
|
|
});
|
|
|
app.use('/passport/login/user', (req, res) => {
|
|
|
let result = {
|
|
|
code: 403,
|
|
|
message: '未登录',
|
|
|
data: ''
|
|
|
};
|
|
|
|
|
|
if (req.user.uid) {
|
|
|
result.code = 200;
|
|
|
result.message = '已登录';
|
|
|
result.data = req.user.uid.toString();
|
|
|
}
|
|
|
res.jsonp(result);
|
|
|
});
|
|
|
}
|
|
|
app.get('/grass/getToken', qiniuMiddleware.getToken);
|
|
|
app.use('/grass', ssrApiMiddleware);
|
|
|
|
...
|
...
|
|