Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-serivce
/
glsx-insurance-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit f10a1c64
authored
Nov 25, 2020
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改设备登录接口
1 parent
86508d32
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
14 deletions
app/controller/biz/devices.js
app/service/biz/devices.js
app/controller/biz/devices.js
View file @
f10a1c6
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: chenwq
* @Author: chenwq
* @Date: 2020-06-16 10:40:02
* @Date: 2020-06-16 10:40:02
* @Last Modified by: huyue
* @Last Modified by: huyue
* @Last Modified time: 2020-11-2
4 17:59:15
* @Last Modified time: 2020-11-2
5 14:23:16
*/
*/
"use strict"
;
"use strict"
;
...
@@ -45,8 +45,8 @@
...
@@ -45,8 +45,8 @@
* @Request searcher
* @Request searcher
* @Response 200 response ok
* @Response 200 response ok
*/
*/
async
searchlogin
({
request
:
{
body
:
{
pager
,
searcher
}
}
})
{
async
searchlogin
({
request
:
{
body
:
searcher
}
})
{
const
result
=
await
this
.
devicesService
.
searchlogin
({
pager
,
searcher
});
const
result
=
await
this
.
devicesService
.
searchlogin
({
searcher
});
this
.
ctx
.
body
=
this
.
ServerResponse
.
Success
(
result
);
this
.
ctx
.
body
=
this
.
ServerResponse
.
Success
(
result
);
}
}
}
}
...
...
app/service/biz/devices.js
View file @
f10a1c6
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: chenwq
* @Author: chenwq
* @Date: 2020-06-16 10:02:39
* @Date: 2020-06-16 10:02:39
* @Last Modified by: huyue
* @Last Modified by: huyue
* @Last Modified time: 2020-11-2
4 18:14:52
* @Last Modified time: 2020-11-2
5 14:23:10
* 设备信息
* 设备信息
*/
*/
...
@@ -131,21 +131,33 @@ class DevicesService extends Service {
...
@@ -131,21 +131,33 @@ class DevicesService extends Service {
* 调用后台接口
* 调用后台接口
*/
*/
async
searchlogin
({
async
searchlogin
({
pager
=
{},
searcher
=
{}
searcher
=
{}
})
{
})
{
const
ctx
=
this
.
ctx
const
ctx
=
this
.
ctx
const
result
=
await
ctx
.
curl
(
'https://oss-config.test.glsx.com.cn/mock/5e87f9bda9495b066dc5010b/glsx-staging/user.loginTem'
,
{
let
req
=
''
dataType
:
'json'
,
for
(
let
i
in
searcher
)
{
method
:
'POST'
,
req
=
req
+
`
${
i
}
=
${
searcher
[
i
]}
&`
data
:
{
}
pager
:
pager
,
req
=
req
.
substr
(
0
,
req
.
length
-
1
)
searcher
:
searcher
const
result
=
await
ctx
.
curl
(
`http://192.168.3.20:8099/?
${
req
}
`
,
{
},
dataType
:
'text'
,
method
:
'GET'
,
timeout
:
3000
,
timeout
:
3000
,
})
})
// ctx.body = result.data
let
data
=
result
.
data
.
split
(
'\n'
)
return
result
.
data
console
.
log
(
'---------'
)
console
.
log
(
result
.
data
,
data
)
let
datalist
=
[]
if
(
data
[
1
])
{
// 有数据,去掉头尾
for
(
let
i
=
1
;
i
<
data
.
length
-
1
;
i
++
)
{
let
[
deviceno
,
ip
,
login
,
logoff
,
iccid
]
=
data
[
i
].
split
(
','
)
datalist
.
push
({
deviceno
,
ip
,
login
,
logoff
,
iccid
})
}
}
else
{
datalist
=
[]
}
return
datalist
}
}
}
}
module
.
exports
=
DevicesService
;
module
.
exports
=
DevicesService
;
\ No newline at end of file
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
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 post a comment