Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
Y
ybf
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xulili
ybf
Commits
18fe2e61
Commit
18fe2e61
authored
Mar 16, 2020
by
Z
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of gitlabz:xulili/ybf
parents
f87e6e63
ee7458d0
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
32 deletions
+55
-32
index.html
ybf_wx/public/index.html
+1
-0
jquery-3.4.1.min.js
ybf_wx/public/js/jquery-3.4.1.min.js
+2
-0
home.vue
ybf_wx/src/views/home.vue
+3
-3
index.vue
ybf_wx/src/views/qrCode/index.vue
+41
-29
vue.config.js
ybf_wx/vue.config.js
+8
-0
No files found.
ybf_wx/public/index.html
View file @
18fe2e61
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
<meta
name=
"viewport"
content=
"width=device-width,initial-scale=1.0"
>
<meta
name=
"viewport"
content=
"width=device-width,initial-scale=1.0"
>
<link
rel=
"icon"
href=
"<%= BASE_URL %>favicon.ico"
>
<link
rel=
"icon"
href=
"<%= BASE_URL %>favicon.ico"
>
<title>
亿百分
</title>
<title>
亿百分
</title>
<script
type=
"text/javascript"
src=
"js/jquery-3.4.1.min.js"
></script>
<script
src=
"http://res.wx.qq.com/open/js/jweixin-1.6.0.js"
></script>
<script
src=
"http://res.wx.qq.com/open/js/jweixin-1.6.0.js"
></script>
</head>
</head>
<body>
<body>
...
...
ybf_wx/public/js/jquery-3.4.1.min.js
0 → 100644
View file @
18fe2e61
This diff is collapsed.
Click to expand it.
ybf_wx/src/views/home.vue
View file @
18fe2e61
...
@@ -107,7 +107,7 @@ export default {
...
@@ -107,7 +107,7 @@ export default {
);
);
if
(
this
.
$route
.
query
.
code
===
undefined
)
{
if
(
this
.
$route
.
query
.
code
===
undefined
)
{
this
.
zTestPreAuthCode
();
//
this.zTestPreAuthCode();
}
else
{
}
else
{
this
.
zTestGetNowUrlInfo
()
this
.
zTestGetNowUrlInfo
()
// this.zTestGetUserInfoByOldToken()
// this.zTestGetUserInfoByOldToken()
...
...
ybf_wx/src/views/qrCode/index.vue
View file @
18fe2e61
<
template
>
<
template
>
<div
class=
"qr-code"
>
<div
class=
"qr-code"
>
<
canvas
id=
"QRCode_header"
></canvas
>
<
img
id=
"image"
src=
""
alt=
""
>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
QRCode
from
'qrcode
'
import
axios
from
'axios
'
export
default
{
export
default
{
name
:
'index'
,
name
:
'index'
,
data
(){
data
()
{
return
{
return
{
QRCodeMsg
:
''
accessToken
:
""
}
}
},
},
mounted
(){
mounted
()
{
this
.
creatQrCode
()
this
.
getAcessToken
()
this
.
createCode
()
},
},
methods
:{
methods
:
{
creatQrCode
(){
getAcessToken
(){
let
opts
=
{
let
_this
=
this
errorCorrectionLevel
:
"H"
,
//容错级别
axios
({
type
:
"image/png"
,
//生成的二维码类型
url
:
"http://139.155.48.151:8085/workWx/auth/oauth2/getAccessToken"
,
quality
:
0.3
,
//二维码质量
method
:
"get"
,
margin
:
12
,
//二维码留白边距
}).
then
(
res
=>
{
width
:
200
,
//宽
_this
.
accessToken
=
res
.
data
.
data
height
:
180
,
//高
_this
.
createCode
()
color
:
{
})
dark
:
"#333333"
,
//前景色
},
light
:
"#fff"
//背景色
createCode
()
{
let
pageUrl
=
`/wxx/cgi-bin/wxaapp/createwxaqrcode?access_token=
${
this
.
accessToken
}
`
$
.
ajax
({
type
:
"POST"
,
url
:
pageUrl
,
data
:
JSON
.
stringify
({
"path"
:
"pages/signIn/signIn"
}),
xhrFields
:
{
responseType
:
"arraybuffer"
},
success
:
function
(
res
)
{
let
imgUrl
=
'data:image/png;base64,'
+
btoa
(
new
Uint8Array
(
res
).
reduce
((
data
,
byte
)
=>
data
+
String
.
fromCharCode
(
byte
),
''
))
$
(
'#image'
).
attr
(
'src'
,
imgUrl
)
},
error
:
function
(
data
)
{
console
.
log
(
data
)
}
}
};
// this.QRCodeMsg = window.location.href; //生成的二维码为URL地址js
// this.QRCodeMsg = window.location.href; //生成的二维码为URL地址js
alert
(
`
${
window
.
location
.
origin
}
/voucherInfo`
)
this
.
QRCodeMsg
=
`
${
window
.
location
.
origin
}
/voucherInfo`
;
//生成的二维码为URL地址js
let
msg
=
document
.
getElementById
(
"QRCode_header"
);
// 将获取到的数据(val)画到msg(canvas)上
QRCode
.
toCanvas
(
msg
,
this
.
QRCodeMsg
,
opts
,
function
(
error
)
{
console
.
log
(
error
)
});
});
}
,
}
}
}
}
}
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
>
<
style
scoped
lang=
"scss"
>
.qr-code
{
text-align
:
center
;
padding-top
:
50px
;
#image
{
display
:
inline-block
;
width
:
60%
;
}
}
</
style
>
</
style
>
ybf_wx/vue.config.js
View file @
18fe2e61
...
@@ -22,6 +22,14 @@ module.exports = {
...
@@ -22,6 +22,14 @@ module.exports = {
'^/api'
:
''
'^/api'
:
''
}
}
},
},
'/wxx'
:
{
ws
:
false
,
target
:
'https://api.weixin.qq.com'
,
changeOrigin
:
true
,
pathRewrite
:
{
'^/wxx'
:
''
}
},
}
}
},
},
css
:
{
css
:
{
...
...
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