25 lines
862 B
JavaScript
25 lines
862 B
JavaScript
|
|
/// <reference path="../pb_data/types.d.ts" />
|
||
|
|
|
||
|
|
routerUse(function (e) {
|
||
|
|
try {
|
||
|
|
return e.next()
|
||
|
|
} catch (err) {
|
||
|
|
const status =
|
||
|
|
(err && typeof err.statusCode === 'number' && err.statusCode)
|
||
|
|
|| (err && typeof err.status === 'number' && err.status)
|
||
|
|
|| 500
|
||
|
|
|
||
|
|
return e.json(status, {
|
||
|
|
code: status,
|
||
|
|
msg: (err && err.message) || '服务器内部错误',
|
||
|
|
data: (err && err.data) || {},
|
||
|
|
})
|
||
|
|
}
|
||
|
|
})
|
||
|
|
|
||
|
|
require(`${__hooks}/bai_api_pb_hooks/bai_api_routes/system/hello.js`)
|
||
|
|
require(`${__hooks}/bai_api_pb_hooks/bai_api_routes/system/health.js`)
|
||
|
|
require(`${__hooks}/bai_api_pb_hooks/bai_api_routes/wechat/login.js`)
|
||
|
|
require(`${__hooks}/bai_api_pb_hooks/bai_api_routes/wechat/profile.js`)
|
||
|
|
require(`${__hooks}/bai_api_pb_hooks/bai_api_routes/wechat/refresh-token.js`)
|