Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
duiba-minipgm
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
方雄韬
duiba-minipgm
Commits
3420be83
Commit
3420be83
authored
Feb 07, 2018
by
方雄韬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
069a460d
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
4 additions
and
4 deletions
+4
-4
app.js
app.js
+0
-0
duiba.js
controllers/duiba.js
+0
-0
package.json
package.json
+1
-1
controller.js
utils/controller.js
+3
-3
blowfishCryptDemo.js
utils/signTools/blowfishCryptDemo.js
+0
-0
encryption.js
utils/signTools/encryption.js
+0
-0
md5.js
utils/signTools/md5.js
+0
-0
static-files.js
utils/static-files.js
+0
-0
templating.js
utils/templating.js
+0
-0
No files found.
server/
app.js
→
app.js
View file @
3420be83
File moved
server/
controllers/duiba.js
→
controllers/duiba.js
View file @
3420be83
File moved
package.json
View file @
3420be83
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
"description"
:
"wechat minigrogram duiba credits mall demo"
,
"description"
:
"wechat minigrogram duiba credits mall demo"
,
"main"
:
"app.js"
,
"main"
:
"app.js"
,
"scripts"
:
{
"scripts"
:
{
"start"
:
"node
./server/
app.js"
,
"start"
:
"node app.js"
,
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
},
},
"keywords"
:
[
"keywords"
:
[
...
...
server/
utils/controller.js
→
utils/controller.js
View file @
3420be83
/**
/**
* 自动扫描加载
路由
* 自动扫描加载
控制器,配置路由。
*/
*/
const
fs
=
require
(
'fs'
);
const
fs
=
require
(
'fs'
);
// process.cwd() 是当前执行node命令时候的文件夹地址
// process.cwd() 是当前执行node命令时候的文件夹地址
...
@@ -23,14 +23,14 @@ function addMapping(router, mapping) {
...
@@ -23,14 +23,14 @@ function addMapping(router, mapping) {
}
}
function
addControllers
(
router
)
{
function
addControllers
(
router
)
{
var
files
=
fs
.
readdirSync
(
cwd
+
'/
server/
controllers'
);
var
files
=
fs
.
readdirSync
(
cwd
+
'/controllers'
);
var
js_files
=
files
.
filter
((
f
)
=>
{
var
js_files
=
files
.
filter
((
f
)
=>
{
return
f
.
endsWith
(
'.js'
);
return
f
.
endsWith
(
'.js'
);
});
});
for
(
var
f
of
js_files
)
{
for
(
var
f
of
js_files
)
{
console
.
log
(
`process controller:
${
f
}
...`
);
console
.
log
(
`process controller:
${
f
}
...`
);
let
mapping
=
require
(
cwd
+
'/
server/
controllers/'
+
f
);
let
mapping
=
require
(
cwd
+
'/controllers/'
+
f
);
addMapping
(
router
,
mapping
);
addMapping
(
router
,
mapping
);
}
}
}
}
...
...
server/
utils/signTools/blowfishCryptDemo.js
→
utils/signTools/blowfishCryptDemo.js
View file @
3420be83
File moved
server/
utils/signTools/encryption.js
→
utils/signTools/encryption.js
View file @
3420be83
File moved
server/
utils/signTools/md5.js
→
utils/signTools/md5.js
View file @
3420be83
File moved
server/
utils/static-files.js
→
utils/static-files.js
View file @
3420be83
File moved
server/
utils/templating.js
→
utils/templating.js
View file @
3420be83
File moved
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment