JOE
2018-10-23 5c2356dd3e71d093d41127d726cc40ec11a90c49
modify url path
6 files modified
20 ■■■■ changed files
routes/accounts.js 4 ●●●● patch | view | raw | blame | history
routes/modules.js 4 ●●●● patch | view | raw | blame | history
routes/roles.js 2 ●●● patch | view | raw | blame | history
views/accounts/list.html 4 ●●●● patch | view | raw | blame | history
views/accounts/update.html 2 ●●● patch | view | raw | blame | history
views/modules/list.html 4 ●●●● patch | view | raw | blame | history
routes/accounts.js
....@@ -36,7 +36,7 @@
3636 router.post('/create', function(req, res, next) {
3737 const data = Object.assign(req.body) || {};
3838 Account.create(data).then(role => {
39
- res.redirect('/accounts/');
39
+ res.redirect(config.path.context + '/accounts/');
4040 }).catch(err => {
4141 Modules.find({}).then(async function (modules) {
4242 const param = util.initParam();
....@@ -75,7 +75,7 @@
7575 param.account = data;
7676 res.render('accounts/update', param);
7777 } else {
78
- res.redirect('/accounts/');
78
+ res.redirect(config.path.context + '/accounts/');
7979 }
8080 });
8181 });
routes/modules.js
....@@ -31,7 +31,7 @@
3131 router.post('/create', function(req, res, next) {
3232 const data = Object.assign(req.body) || {};
3333 Modules.create(data).then(role => {
34
- res.redirect('/modules/');
34
+ res.redirect(config.path.context + '/modules/');
3535 }).catch(err => {
3636 Modules.find({}).then(function (modules) {
3737 const param = util.initParam();
....@@ -74,7 +74,7 @@
7474 res.render('modules/update', param);
7575 });
7676 } else {
77
- res.redirect('/modules/');
77
+ res.redirect(config.path.context + '/modules/');
7878 }
7979 });
8080 });
routes/roles.js
....@@ -74,7 +74,7 @@
7474 res.render('roles/update', param);
7575 });
7676 } else {
77
- res.redirect('/roles/');
77
+ res.redirect(config.path.context + '/roles/');
7878 }
7979 });
8080 });
views/accounts/list.html
....@@ -1,11 +1,11 @@
11 {{>layout/header-temp}}
22 <body>
33 <div class="content">
4
- <h2>Account List&nbsp;<a href="{{contextRoot}}/accounts/create">ADD</a></h2>
4
+ <h2>Account List&nbsp;<a href="{{context}}/accounts/create">ADD</a></h2>
55 {{#accounts}}
66 <h3>
77 [{{role.name}}] {{name}}
8
- <a href="/accounts/{{id}}"><span>edit</span></a>
8
+ <a href="{{context}}/accounts/{{id}}"><span>edit</span></a>
99 <a id="{{id}}" class="btn_delete" href="#"><span>delete</span></a>
1010 </h3>
1111 {{/accounts}}
views/accounts/update.html
....@@ -1,6 +1,6 @@
11 {{>layout/header-temp}}
22 <div class="content">
3
- <form action="{{contextRoot}}/accounts/update" method="post">
3
+ <form action="{{context}}/accounts/update" method="post">
44 <h1>Modify Account</h1>
55 {{#error}}
66 <h4 class="error">{{error}}</h4>
views/modules/list.html
....@@ -1,11 +1,11 @@
11 {{>layout/header-temp}}
22 <body>
33 <div class="content">
4
- <h2>Module List&nbsp;<a href="../modules/create">ADD</a></h2>
4
+ <h2>Module List&nbsp;<a href="{{context}}/modules/create">ADD</a></h2>
55 {{#modules}}
66 <h3>
77 {{name}}
8
- <a href="../modules/{{id}}"><span>edit</span></a>
8
+ <a href="{{context}}/modules/{{id}}"><span>edit</span></a>
99 <a id="{{id}}" class="btn_delete" href="#"><span>delete</span></a>
1010 </h3>
1111 {{/modules}}