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
8308739e
Commit
8308739e
authored
Mar 21, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
ce007b5d
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
74 additions
and
37 deletions
+74
-37
xgg-saas-merchant/app/base/controller/impl/saas/orderCtl.js
+35
-0
xgg-saas-merchant/app/base/controller/impl/uc/userCtl.js
+2
-6
xgg-saas-merchant/app/base/service/impl/saas/orderSve.js
+26
-0
xgg-saas-merchant/app/base/service/impl/uc/userSve.js
+3
-29
xgg-saas-merchant/app/base/system.js
+1
-1
xgg-saas-merchant/app/config/routes/web.js
+3
-1
xgg-saas-merchant/app/front/entry/public/apidoc/user/login.md
+4
-0
No files found.
xgg-saas-merchant/app/base/controller/impl/saas/orderCtl.js
0 → 100644
View file @
8308739e
var
system
=
require
(
"../../../system"
)
const
CtlBase
=
require
(
"../../ctlms.base"
);
class
ChannelCtl
extends
CtlBase
{
constructor
()
{
super
();
this
.
orderSve
=
system
.
getObject
(
"service.saas.orderSve"
);
}
async
microAdd
(
params
,
pobj2
,
req
)
{
try
{
return
await
this
.
orderSve
.
microAdd
(
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
async
info
(
params
,
pobj2
,
req
)
{
try
{
return
await
this
.
orderSve
.
info
(
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
async
page
(
params
,
pobj2
,
req
)
{
try
{
return
await
this
.
orderSve
.
page
(
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
}
module
.
exports
=
ChannelCtl
;
\ No newline at end of file
xgg-saas-merchant/app/base/controller/impl/uc/userCtl.js
View file @
8308739e
...
@@ -42,12 +42,8 @@ class UserCtl extends CtlBase {
...
@@ -42,12 +42,8 @@ class UserCtl extends CtlBase {
}
}
async
setLogin
(
user
)
{
async
setLogin
(
user
)
{
let
loginsid
=
"saasp_"
+
uuidv4
();
let
loginsid
=
"saasmcth_"
+
uuidv4
();
// if(settings.env == 'dev') {
loginsid
=
"saasmcth_"
+
"2cb49932-fa02-44f0-90db-9f06fe02e5c7"
;
// user.loginsid = "jfs_" + "3cb49932-fa02-44f0-90db-9f06fe02e5c7";
// user.subsid = "sub_" + "3cb49932-fa02-44f0-90db-9f06fe02e5c7";
// }
loginsid
=
"saasp_"
+
"2cb49932-fa02-44f0-90db-9f06fe02e5c7"
;
await
this
.
redisClient
.
setWithEx
(
loginsid
,
JSON
.
stringify
(
user
),
60
*
60
*
5
);
await
this
.
redisClient
.
setWithEx
(
loginsid
,
JSON
.
stringify
(
user
),
60
*
60
*
5
);
return
loginsid
;
return
loginsid
;
}
}
...
...
xgg-saas-merchant/app/base/service/impl/saas/orderSve.js
0 → 100644
View file @
8308739e
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../svems.base"
)
const
settings
=
require
(
"../../../../config/settings"
)
class
OrderService
extends
ServiceBase
{
constructor
()
{
super
();
}
async
microAdd
(
params
)
{
var
rs
=
await
this
.
callms
(
"order"
,
"saasOrderMicroAdd"
,
params
);
return
rs
;
}
async
info
(
params
)
{
var
rs
=
await
this
.
callms
(
"order"
,
"saasOrderInfo"
,
params
);
return
rs
;
}
async
page
(
params
)
{
var
rs
=
await
this
.
callms
(
"order"
,
"saasOrderPage"
,
params
);
return
rs
;
}
}
module
.
exports
=
OrderService
;
\ No newline at end of file
xgg-saas-merchant/app/base/service/impl/uc/userSve.js
View file @
8308739e
...
@@ -10,23 +10,7 @@ class UserService extends ServiceBase {
...
@@ -10,23 +10,7 @@ class UserService extends ServiceBase {
async
login
(
params
)
{
async
login
(
params
)
{
try
{
try
{
return
await
this
.
callms
(
"uc"
,
"platformLogin"
,
params
);
return
await
this
.
callms
(
"uc"
,
"merchantLogin"
,
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
async
registerInner
(
params
)
{
try
{
return
await
this
.
callms
(
"uc"
,
"platformRegisterInner"
,
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
async
resetPasswordInner
(
params
)
{
try
{
return
await
this
.
callms
(
"uc"
,
"platformResetPasswordInner"
,
params
);
}
catch
(
error
)
{
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
...
@@ -34,15 +18,7 @@ class UserService extends ServiceBase {
...
@@ -34,15 +18,7 @@ class UserService extends ServiceBase {
async
info
(
params
)
{
async
info
(
params
)
{
try
{
try
{
return
await
this
.
callms
(
"uc"
,
"platformInfo"
,
params
);
return
await
this
.
callms
(
"uc"
,
"merchantInfo"
,
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
async
enabled
(
params
)
{
try
{
return
await
this
.
callms
(
"uc"
,
"platformEnabled"
,
params
);
}
catch
(
error
)
{
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
...
@@ -50,12 +26,11 @@ class UserService extends ServiceBase {
...
@@ -50,12 +26,11 @@ class UserService extends ServiceBase {
async
mapByIds
(
params
)
{
async
mapByIds
(
params
)
{
try
{
try
{
return
await
this
.
callms
(
"uc"
,
"
platfor
MapByIds"
,
params
);
return
await
this
.
callms
(
"uc"
,
"
merchant
MapByIds"
,
params
);
}
catch
(
error
)
{
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
}
}
}
}
module
.
exports
=
UserService
;
module
.
exports
=
UserService
;
\ No newline at end of file
xgg-saas-merchant/app/base/system.js
View file @
8308739e
...
@@ -182,7 +182,7 @@ class System {
...
@@ -182,7 +182,7 @@ class System {
// merchant: "http://127.0.0.1:3101" + path,
// merchant: "http://127.0.0.1:3101" + path,
// 订单服务
// 订单服务
order
:
domain
2
+
":3103"
+
path
,
order
:
domain
+
":3103"
+
path
,
// order: "http://127.0.0.1:3103" + path,
// order: "http://127.0.0.1:3103" + path,
// 发票服务
// 发票服务
...
...
xgg-saas-merchant/app/config/routes/web.js
View file @
8308739e
...
@@ -10,7 +10,7 @@ module.exports = function (app) {
...
@@ -10,7 +10,7 @@ module.exports = function (app) {
var
jsonUser
=
req
.
session
.
user
;
var
jsonUser
=
req
.
session
.
user
;
// var jsonUser = null;
// var jsonUser = null;
if
(
!
jsonUser
)
{
if
(
!
jsonUser
)
{
loginsid
=
req
.
headers
[
"xggsaa
splatform
sid"
]
||
""
;
loginsid
=
req
.
headers
[
"xggsaa
merchant
sid"
]
||
""
;
jsonUser
=
await
redisClient
.
get
(
loginsid
);
jsonUser
=
await
redisClient
.
get
(
loginsid
);
if
(
jsonUser
)
{
if
(
jsonUser
)
{
jsonUser
=
JSON
.
parse
(
jsonUser
);
jsonUser
=
JSON
.
parse
(
jsonUser
);
...
@@ -63,6 +63,7 @@ module.exports = function (app) {
...
@@ -63,6 +63,7 @@ module.exports = function (app) {
if
(
req
.
loginUser
)
{
if
(
req
.
loginUser
)
{
req
.
query
=
req
.
query
||
{};
req
.
query
=
req
.
query
||
{};
req
.
query
.
saas_id
=
req
.
loginUser
.
saas_id
;
req
.
query
.
saas_id
=
req
.
loginUser
.
saas_id
;
req
.
query
.
saas_merchant_id
=
req
.
loginUser
.
saas_merchant_id
;
}
}
params
.
push
(
methodName
);
params
.
push
(
methodName
);
params
.
push
(
req
.
body
);
params
.
push
(
req
.
body
);
...
@@ -94,6 +95,7 @@ module.exports = function (app) {
...
@@ -94,6 +95,7 @@ module.exports = function (app) {
if
(
req
.
loginUser
)
{
if
(
req
.
loginUser
)
{
req
.
body
.
saas_id
=
req
.
loginUser
.
saas_id
;
req
.
body
.
saas_id
=
req
.
loginUser
.
saas_id
;
req
.
body
.
saas_merchant_id
=
req
.
loginUser
.
saas_merchant_id
;
}
}
params
.
push
(
methodName
);
params
.
push
(
methodName
);
...
...
xgg-saas-merchant/app/front/entry/public/apidoc/user/login.md
View file @
8308739e
...
@@ -16,6 +16,10 @@
...
@@ -16,6 +16,10 @@
#### 返回结果
#### 返回结果
```
javascript
```
javascript
header
传值
key
"xggsaamerchantsid"
:
"xxxxxxx"
{
{
"status"
:
0
,
"status"
:
0
,
"msg"
:
"success"
,
"msg"
:
"success"
,
...
...
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