JOE
2018-10-23 fdef19df5670d7b0a1d61e2b3f72182ab4266c5e
modify url path
6 files modified
26 ■■■■ changed files
config/config.js 3 ●●●● patch | view | raw | blame | history
routes/roles.js 2 ●●● patch | view | raw | blame | history
util/util.js 1 ●●●● patch | view | raw | blame | history
views/layout/header-temp.html 14 ●●●● patch | view | raw | blame | history
views/roles/list.html 4 ●●●● patch | view | raw | blame | history
views/roles/update.html 2 ●●● patch | view | raw | blame | history
config/config.js
....@@ -1,6 +1,7 @@
11 module.exports = {
22 path: {
3
- cdn: 'http://dmp.3ps.io/dmp'
3
+ cdn: 'http://dmp.3ps.io/dmp',
4
+ context: 'http://dmp.3ps.io/mobidmp',
45 },
56 secret: 'AMDMP_2018',
67 db: {
routes/roles.js
....@@ -32,7 +32,7 @@
3232 const data = Object.assign(req.body) || {};
3333 data.welcome_page_modile = util.generatePath(data.welcome_page_modile);
3434 Roles.create(data).then(role => {
35
- res.redirect('../roles/');
35
+ res.redirect(config.path.context + '/roles/');
3636 }).catch(err => {
3737 Modules.find({}).then(function (modules) {
3838 const param = util.initParam();
util/util.js
....@@ -20,6 +20,7 @@
2020 function initParam() {
2121 const param = {};
2222 param.cdnRoot = config.path.cdn;
23
+ param.context = config.path.context;
2324 return param;
2425 }
2526
views/layout/header-temp.html
....@@ -2,15 +2,15 @@
22 <html lang="en">
33 <head>
44 <title>Mobithru DMP</title>
5
- <link rel="stylesheet" href="../css/style.css"/>
5
+ <link rel="stylesheet" href="{{context}}/css/style.css"/>
66 <script src="{{cdnRoot}}/jquery-plugins/jquery-3.3.1.min.js"></script>
77 </head>
88 <body>
99 <div class="header-temp">
10
- <a href="../dashboard/">Dashboard</a>
11
- <a href="../accounts/">Accounts</a>
12
- <a href="../roles/">Roles</a>
13
- <a href="../modules/">Modules</a>
14
- <a href="../api-test/">API Test</a>
15
- <a href="../logout/">Logout</a>
10
+ <a href="{{context}}/dashboard/">Dashboard</a>
11
+ <a href="{{context}}/accounts/">Accounts</a>
12
+ <a href="{{context}}/roles/">Roles</a>
13
+ <a href="{{context}}/modules/">Modules</a>
14
+ <a href="{{context}}/api-test/">API Test</a>
15
+ <a href="{{context}}/logout/">Logout</a>
1616 </div>
views/roles/list.html
....@@ -1,10 +1,10 @@
11 {{>layout/header-temp}}
22 <div class="content">
3
- <h2>Role List&nbsp;<a href="../roles/create">ADD</a></h2>
3
+ <h2>Role List&nbsp;<a href="{{context}}/roles/create">ADD</a></h2>
44 {{#roles}}
55 <h3>
66 {{name}}
7
- <a href="../roles/{{id}}"><span>edit</span></a>
7
+ <a href="{{context}}/roles/{{id}}"><span>edit</span></a>
88 <a id="{{id}}" class="btn_delete" href="#"><span>delete</span></a>
99 </h3>
1010 {{/roles}}
views/roles/update.html
....@@ -1,6 +1,6 @@
11 {{>layout/header-temp}}
22 <div class="content">
3
- <form action="../roles" method="post">
3
+ <form method="post">
44 <h1>Modify Role</h1>
55 {{#result}}
66 <h4>{{result}}</h4>