Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
e402c9b2
Commit
e402c9b2
authored
Apr 20, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
d4f3826e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
xgg-saas-merchant/app/base/system.js
+6
-0
xgg-saas-merchant/app/config/routes/applet.js
+14
-0
No files found.
xgg-saas-merchant/app/base/system.js
View file @
e402c9b2
...
@@ -166,6 +166,12 @@ class System {
...
@@ -166,6 +166,12 @@ class System {
return
uuid
.
join
(
''
);
return
uuid
.
join
(
''
);
}
}
static
endWith
(
source
,
str
){
if
(
!
str
||
!
source
||
source
.
length
==
0
||
str
.
length
>
source
.
length
)
{
return
false
;
}
return
source
.
substring
(
source
.
length
-
str
.
length
)
==
str
;
}
static
microsetting
()
{
static
microsetting
()
{
console
.
log
(
settings
.
env
,
"-------------- microsetting env ------------------"
);
console
.
log
(
settings
.
env
,
"-------------- microsetting env ------------------"
);
var
path
=
"/api/op/action/springboard"
;
var
path
=
"/api/op/action/springboard"
;
...
...
xgg-saas-merchant/app/config/routes/applet.js
View file @
e402c9b2
...
@@ -3,6 +3,20 @@ var System = require("../../base/system");
...
@@ -3,6 +3,20 @@ var System = require("../../base/system");
const
settings
=
require
(
"../settings"
);
const
settings
=
require
(
"../settings"
);
module
.
exports
=
function
(
app
)
{
module
.
exports
=
function
(
app
)
{
app
.
all
(
"/applet/*"
,
function
(
req
,
res
,
next
)
{
app
.
all
(
"/applet/*"
,
function
(
req
,
res
,
next
)
{
let
openid
=
req
.
body
.
openid
||
req
.
query
.
openid
;
if
(
System
.
endWith
(
req
.
url
,
"applet/merchantApplet/login"
)
||
System
.
endWith
(
req
.
url
,
"applet/merchantApplet/uploadConfig"
))
{
if
(
openid
)
{
req
.
openid
=
openid
;
}
else
{
req
.
openid
=
null
;
}
return
next
();
}
if
(
!
openid
)
{
res
.
end
(
JSON
.
stringify
({
code
:
403
,
msg
:
"no login"
}));
return
;
}
return
next
();
return
next
();
});
});
...
...
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