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
d7141989
Commit
d7141989
authored
Jul 30, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
7d150077
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
16 deletions
+23
-16
bpo-web/app/base/api/impl/bpoSDPJApi.js
+15
-0
bpo-web/app/base/utils/qrClient.js
+6
-14
bpo-web/app/config/settings.js
+2
-2
No files found.
bpo-web/app/base/api/impl/bpoSDPJApi.js
View file @
d7141989
...
...
@@ -51,6 +51,21 @@ class BpoSDPJApi {
return
o
.
toString
().
trim
();
}
async
testqr
(
obj
,
req
)
{
let
arr
=
[];
for
(
let
i
=
0
;
i
<
20
;
i
++
)
{
this
.
tttttt
();
// let url = await this.qrClient.generateQR("https://bpohhr.gongsibao.com/sdpj?no=D6L0EoGg1wkzO5GEvm%2B9hA%3D%3D&outTradeNo=01234567891011121319&mchtId=1286935856342376450");
// arr.push(url);
}
return
arr
;
}
async
tttttt
()
{
let
url
=
await
this
.
qrClient
.
generateQR
(
"https://bpohhr.gongsibao.com/sdpj?no=D6L0EoGg1wkzO5GEvm%2B9hA%3D%3D&outTradeNo=01234567891011121319&mchtId=1286935856342376450"
);
console
.
log
(
url
);
}
/**
* 生成二维码
* @param obj
...
...
bpo-web/app/base/utils/qrClient.js
View file @
d7141989
...
...
@@ -6,6 +6,7 @@ const fs = require("fs");
class
QrClient
{
constructor
(){
this
.
redisClient
=
system
.
getObject
(
"util.redisClient"
);
this
.
ossClient
=
system
.
getObject
(
"util.ossClient"
);
}
/**
...
...
@@ -20,20 +21,11 @@ class QrClient{
return
null
;
}
let
key
=
prev
+
await
this
.
redisClient
.
genrateId
(
"qrcode"
)
+
".png"
;
let
filePath
=
settings
.
localPath
();
var
qr_png
=
qr
.
image
(
text
,
{
size
:
10
});
let
_r
=
await
qr_png
.
pipe
(
require
(
'fs'
).
createWriteStream
(
`
${
filePath
}${
key
}
`
));
console
.
log
(
_r
);
if
(
!
_r
){
return
null
;
}
let
urlRes
=
await
new
ossClient
().
upfile
(
key
,
`
${
filePath
}${
key
}
`
);
fs
.
unlink
(
`
${
filePath
}${
key
}
`
,
(
err
)
=>
{
if
(
err
){
console
.
log
(
`二维码删除失败`
);
}
console
.
log
(
'已成功地删除文件'
);
});
console
.
log
(
1
,
key
);
let
is
=
qr
.
imageSync
(
text
,
{
type
:
'png'
,
size
:
10
});
console
.
log
(
2
);
let
urlRes
=
await
this
.
ossClient
.
upfile
(
key
,
is
);
console
.
log
(
3
,
urlRes
);
return
urlRes
.
url
;
}
catch
(
e
)
{
console
.
log
(
e
);
...
...
bpo-web/app/config/settings.js
View file @
d7141989
...
...
@@ -35,9 +35,9 @@ var settings = {
let
rootPath
=
""
;
// windows
if
(
platform
.
toLocaleLowerCase
().
startsWith
(
'win'
))
{
rootPath
=
"D:/tmp"
;
rootPath
=
"D:/tmp
/
"
;
}
else
{
rootPath
=
"/tmp"
rootPath
=
"/tmp
/
"
}
return
rootPath
;
},
...
...
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