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
890b7026
Commit
890b7026
authored
Mar 18, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
8bec8718
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
126 additions
and
18 deletions
+126
-18
center-channel/app/base/api/impl/auth/accessAuth.js
+27
-5
center-channel/app/base/api/impl/opreceive/need.js
+6
-1
center-channel/app/base/service/impl/utilsSve/utilsAuthSve.js
+2
-2
center-channel/app/base/service/impl/utilsSve/utilsNeedSve.js
+50
-0
center-channel/峰擎文档
+38
-9
center-channel/提示编码使用
+3
-1
No files found.
center-channel/app/base/api/impl/auth/accessAuth.js
View file @
890b7026
...
...
@@ -4,6 +4,7 @@ class AccessAuthAPI extends WEBBase {
constructor
()
{
super
();
this
.
utilsAuthSve
=
system
.
getObject
(
"service.utilsSve.utilsAuthSve"
);
this
.
utilsNeedSve
=
system
.
getObject
(
"service.utilsSve.utilsNeedSve"
);
}
/**
* 接口跳转-POST请求
...
...
@@ -29,13 +30,34 @@ class AccessAuthAPI extends WEBBase {
case
"test"
:
//测试
opResult
=
system
.
getResultSuccess
(
null
,
"测试成功"
);
break
;
case
"getUserPinByChannelUserId"
:
//获取渠道用户userpin信息,通过userName
opResult
=
await
this
.
utilsAuthSve
.
getUserPinByChannelUserId
(
pobj
,
pobj
.
actionBody
);
if
(
opResult
.
status
==
0
)
{
return
system
.
getResultSuccess
({
userpin
:
pobj
.
actionBody
.
userpin
})
case
"getNeedUserPinByChannelUserId"
:
//渠道通过账户进行登录,有则返回用户信息,没有则创建用户
opResult
=
await
this
.
utilsAuthSve
.
getLoginByUserName
(
pobj
,
pobj
.
actionBody
);
if
(
opResult
.
status
!=
0
&&
opResult
.
status
!=
2060
)
{
return
opResult
;
}
opResult
=
system
.
getResultSuccess
({
userpin
:
pobj
.
actionBody
.
userpin
})
if
(
opResult
.
status
==
2060
)
{
opResult
.
msg
=
opResult
.
msg
;
opResult
.
data
.
userpin
=
opResult
.
data
.
userpin
;
}
//获取需求信息
pobj
.
actionType
=
"getItemByNeedNo"
;
var
needResult
=
await
this
.
utilsNeedSve
.
getItemByNeedNo
(
pobj
,
pobj
.
actionBody
);
if
(
needResult
.
status
!=
0
)
{
return
needResult
;
}
opResult
.
data
.
channelTypeCode
=
needResult
.
data
.
channelTypeCode
;
opResult
.
data
.
typeCode
=
needResult
.
data
.
typeCode
break
;
case
"getLoginByUserName"
:
//渠道通过账户进行登录,有则返回用户信息,没有则创建用户
opResult
=
await
this
.
utilsAuthSve
.
getLoginByUserName
(
pobj
,
pobj
.
actionBody
);
if
(
opResult
.
status
!=
0
&&
opResult
.
status
!=
2060
)
{
return
opResult
;
}
opResult
=
system
.
getResultSuccess
({
userpin
:
pobj
.
actionBody
.
userpin
})
if
(
opResult
.
status
==
2060
)
{
return
system
.
getResultSuccess
({
userpin
:
opResult
.
data
.
userpin
},
opResult
.
msg
)
opResult
.
msg
=
opResult
.
msg
;
opResult
.
data
.
userpin
=
opResult
.
data
.
userpin
;
}
break
;
case
"getVerifyCode"
:
//获取默认模板的手机验证码
...
...
center-channel/app/base/api/impl/opreceive/need.js
View file @
890b7026
...
...
@@ -4,6 +4,7 @@ var settings = require("../../../../config/settings");
class
Need
extends
APIBase
{
constructor
()
{
super
();
this
.
utilsNeedSve
=
system
.
getObject
(
"service.utilsSve.utilsNeedSve"
);
}
/**
...
...
@@ -25,7 +26,11 @@ class Need extends APIBase {
async
opActionProcess
(
pobj
,
action_process
,
action_type
,
action_body
,
req
)
{
var
opResult
=
null
;
switch
(
action_type
)
{
case
"close"
:
//关闭需求
case
"submitNeed"
:
//提交需求
opResult
=
await
this
.
utilsNeedSve
.
submitNeed
(
pobj
,
pobj
.
actionBody
);
break
;
case
"needClose"
:
//关闭需求
opResult
=
await
this
.
utilsNeedSve
.
needClose
(
pobj
,
pobj
.
actionBody
);
break
;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
...
...
center-channel/app/base/service/impl/utilsSve/utilsAuthSve.js
View file @
890b7026
...
...
@@ -35,11 +35,11 @@ class UtilsAuthSve extends AppServiceBase {
* @param {*} pobj
* @param {*} actionBody {channelUserId:XX}
*/
async
get
UserPinByChannelUserId
(
pobj
,
actionBody
)
{
//渠道通过账户进行登录,有则返回用户信息,没有则创建用户---actionBody.channelUserId
async
get
LoginByUserName
(
pobj
,
actionBody
)
{
//渠道通过账户进行登录,有则返回用户信息,没有则创建用户---actionBody.channelUserId
if
(
!
actionBody
.
channelUserId
)
{
return
system
.
getResult
(
null
,
"actionBody.channelUserId can not be empty"
);
}
var
acckapp
=
await
this
.
restClient
.
execPost
(
pobj
,
settings
.
centerAppUrl
()
+
"auth/accessAuth/get
UserPinByChannelUserId
"
);
var
acckapp
=
await
this
.
restClient
.
execPost
(
pobj
,
settings
.
centerAppUrl
()
+
"auth/accessAuth/get
LoginByUserName
"
);
var
result
=
acckapp
.
stdout
;
if
(
result
)
{
var
tmp
=
JSON
.
parse
(
result
);
...
...
center-channel/app/base/service/impl/utilsSve/utilsNeedSve.js
0 → 100644
View file @
890b7026
var
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
const
AppServiceBase
=
require
(
"../../app.base"
);
//商标查询操作
class
UtilsNeedSve
extends
AppServiceBase
{
constructor
()
{
super
();
this
.
centerOrderUrl
=
settings
.
centerOrderUrl
();
}
/**
* 提交需求
* @param {*} pobj
* @param {*} actionBody
*/
async
submitNeed
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
needNo
)
{
return
system
.
getResult
(
null
,
"actionBody.needNo can not be empty,100380"
);
}
var
reqUrl
=
this
.
centerOrderUrl
+
"action/need/springBoard"
;
return
await
this
.
restPostUrl
(
pobj
,
url
);
}
/**
* 获取需求详情
* @param {*} pobj
* @param {*} actionBody needNo 需求号
*/
async
getItemByNeedNo
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
needNo
)
{
return
system
.
getResult
(
null
,
"actionBody.needNo can not be empty,100380"
);
}
var
reqUrl
=
this
.
centerOrderUrl
+
"action/need/springBoard"
;
var
itemResult
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
return
itemResult
;
}
/**
* 关闭需求
* @param {*} pobj
* @param {*} actionBody
*/
async
needClose
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
needNo
)
{
return
system
.
getResult
(
null
,
"actionBody.needNo can not be empty,100380"
);
}
var
reqUrl
=
this
.
centerOrderUrl
+
"action/need/springBoard"
;
return
await
this
.
restPostUrl
(
pobj
,
url
);
}
}
module
.
exports
=
UtilsNeedSve
;
center-channel/峰擎文档
View file @
890b7026
1.获取请
求token
1.获取请
求token
...
...
@@ -25,11 +25,12 @@ HTTP请求方式 POST
请求方式:POST
请求头中需要有token(token值从接口1中获取)
{
"actionType": "getUserPinByChannelUserId",
"actionType": "get
Need
UserPinByChannelUserId",
"actionBody": {
"channelUserId":"xxxxxxxxx",// Y 渠道用户ID
"needNo":"N2020021413152wiWI2e",// Y 需求号
"channelUserId":"15010929366",// Y 渠道用户ID
"channelUserName":"",// N 渠道用户名
"mobile":"", // N 渠道用户手机号
"mobile":"
15010929366
", // N 渠道用户手机号
"nickName":"", // N 用户昵称
"orgName":"" // N 公司名称
}
...
...
@@ -38,21 +39,49 @@ HTTP请求方式 POST
{
"status": 0,//0成功,否则失败
"msg": "success",
"data": {userpin:"c54abe7249a2a1195d236b333f79"},
"data": {
"userpin":"c54abe7249a2a1195d236b333f79",
"channelTypeCode":"",//阿里公司注册编码:普通公司注册:esp.companyreg、云上公司注册:esp.companyreg_cloud
"typeCode":"gszc"//gszc公司注册,ysgszc云上公司注册
},
"requestId": "2016c54abe7249a2a1195d236b333f79"
}
3.渠道通过账户进行登录,有则返回用户信息,没有则创建用户
地址:[/web/auth/accessAuth/springBoard]
请求方式:POST
请求头中需要有token(token值从接口1中获取)
{
"actionType": "getLoginByUserName",
"actionBody": {
"channelUserId":"15010929366",// Y 渠道用户ID
"channelUserName":"",// N 渠道用户名
"mobile":"15010929366", // N 渠道用户手机号
"nickName":"", // N 用户昵称
"orgName":"" // N 公司名称
}
}
返回结果
{
"status": 0,//0成功,否则失败
"msg": "success",
"data": {
"userpin":"c54abe7249a2a1195d236b333f79"//用户登录后的userpin
},
"requestId": "2016c54abe7249a2a1195d236b333f79"
}
3.查看需求方案列表信息
地址:[/#/needProxy?needNo=XXX&userId=jfklajflsjfs&nickName=松XXX&mobile=15010929368&orgName=汉唐集团]
请求方式:GET
请求头中需要有token(token值从接口1中获取)
地址:[/#/needProxy?needNo=XXX&userId=jfklajflsjfs&nickName=松XXX&mobile=15010929368&orgName=汉唐集团&token=XXXXX]
请求方式:GET
参数说明:
参数说明:
needNo//需求号
userId//用户唯一码
nickName//用户名称
mobile//用户手机号
orgName//公司名称
orgName//公司名称
token//token值
4.推送公司表单材料
...
...
center-channel/提示编码使用
View file @
890b7026
已经使用的
编码汇总:
已经使用的
编码汇总:
...
...
@@ -36,3 +36,4 @@
100350
100360
100370
100380
\ No newline at end of file
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