Task #28 - Update variables to standard and created export controller

This commit is contained in:
QiTao 2020-02-08 05:17:29 -06:00
parent 7f832c0d92
commit 68b20a5cf4
4 changed files with 6 additions and 5 deletions

View File

@ -24,8 +24,8 @@ class Home extends Controller {
return res.page('welcome', {user: req.user}) return res.page('welcome', {user: req.user})
} }
async get_login(req, res){ async get_login(req, res){
const app_name = this.configs.get('app.name') const AppName = this.configs.get('app.name')
return res.page('login', {app_name}) return res.page('login', {AppName})
} }
} }

View File

@ -18,8 +18,8 @@ class Example extends Model {
*/ */
static get schema() { static get schema() {
return { return {
name: String, Name: String,
create_date: {type: Date, default: () => new Date}, CreateDate: {type: Date, default: () => new Date},
} }
} }

View File

@ -46,6 +46,7 @@ const index = {
// your own route protected by 'middleware::auth:UserOnly' // your own route protected by 'middleware::auth:UserOnly'
'/dash': [ 'controller::Home.welcome' ], '/dash': [ 'controller::Home.welcome' ],
'/login': [ 'middleware::auth:GuestOnly', 'controller::Home.get_login' ], '/login': [ 'middleware::auth:GuestOnly', 'controller::Home.get_login' ],
'/test-export' : ['controller::Export.json_export' ],
}, },
/* /*

View File

@ -61,7 +61,7 @@ html
body body
.container#intro .container#intro
h1 Hi, Welcome to h1 Hi, Welcome to
span#name #{app_name}. span#name #{AppName}.
h2 Choose your login method. h2 Choose your login method.
.container#login .container#login