Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mongo-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
mongo-ui
Commits
becf339b
Commit
becf339b
authored
Sep 01, 2020
by
郭志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 分享问题
parent
9c46aca9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
8 deletions
+6
-8
wxJsSdk.js
src/service/wxJsSdk.js
+5
-7
index.vue
src/views/Consultant/Buy/index.vue
+1
-1
No files found.
src/service/wxJsSdk.js
View file @
becf339b
...
@@ -2,12 +2,13 @@
...
@@ -2,12 +2,13 @@
* @Description: weixin-js-sdk
* @Description: weixin-js-sdk
* @LastEditors: gzw
* @LastEditors: gzw
* @Date: 20120-08-30 18:40:11
* @Date: 20120-08-30 18:40:11
* @LastEditTime: 2020-09-01 19:
06:07
* @LastEditTime: 2020-09-01 19:
27:35
*/
*/
import
cfg
from
"
@/config/index
"
;
import
cfg
from
"
@/config/index
"
;
import
{
getwxAuth
}
from
"
@/api/user
"
;
import
{
getwxAuth
}
from
"
@/api/user
"
;
import
wx
from
"
weixin-js-sdk
"
;
import
wx
from
"
weixin-js-sdk
"
;
import
{
isWeixinBrower
}
from
"
@/service/validation
"
;
import
{
isWeixinBrower
}
from
"
@/service/validation
"
;
import
{
parseSearch
}
from
"
@/service/utils
"
;
import
localStorage
from
"
@/service/localStorage
"
;
import
localStorage
from
"
@/service/localStorage
"
;
/**
/**
...
@@ -22,7 +23,7 @@ export async function setShare({
...
@@ -22,7 +23,7 @@ export async function setShare({
// console.log(title, desc, link, imgUrl);
// console.log(title, desc, link, imgUrl);
const
res
=
await
getwxAuth
({
const
res
=
await
getwxAuth
({
appId
:
cfg
.
wxAppId
,
appId
:
cfg
.
wxAppId
,
url
:
window
.
location
.
href
url
:
link
});
});
const
{
appId
,
timestamp
,
nonceStr
,
signature
}
=
res
;
const
{
appId
,
timestamp
,
nonceStr
,
signature
}
=
res
;
wx
.
config
({
wx
.
config
({
...
@@ -69,10 +70,10 @@ export async function setShare({
...
@@ -69,10 +70,10 @@ export async function setShare({
*/
*/
export
function
checkOpenId
()
{
export
function
checkOpenId
()
{
const
openId
=
localStorage
.
get
(
"
openId
"
);
const
openId
=
localStorage
.
get
(
"
openId
"
);
const
_param
=
parseSearch
(
window
.
location
.
href
);
const
local
=
window
.
location
.
href
;
const
local
=
window
.
location
.
href
;
console
.
log
(
!
openId
,
isWeixinBrower
);
console
.
log
(
!
openId
,
isWeixinBrower
);
if
(
!
openId
&&
isWeixinBrower
)
{
if
(
!
openId
&&
isWeixinBrower
&&
!
_param
.
code
)
{
alert
(
"
无openid
"
);
var
nextPage
=
document
.
createElement
(
"
a
"
);
var
nextPage
=
document
.
createElement
(
"
a
"
);
nextPage
.
setAttribute
(
nextPage
.
setAttribute
(
"
href
"
,
"
href
"
,
...
@@ -83,8 +84,5 @@ export function checkOpenId() {
...
@@ -83,8 +84,5 @@ export function checkOpenId() {
"
&response_type=code&scope=snsapi_base&state=1#wechat_redirect
"
"
&response_type=code&scope=snsapi_base&state=1#wechat_redirect
"
);
);
nextPage
.
click
();
nextPage
.
click
();
return
false
;
}
else
{
return
true
;
}
}
}
}
src/views/Consultant/Buy/index.vue
View file @
becf339b
...
@@ -223,7 +223,7 @@ export default {
...
@@ -223,7 +223,7 @@ export default {
}
}
},
},
created
()
{
created
()
{
!
checkOpenId
();
checkOpenId
();
},
},
mounted
()
{
mounted
()
{
this
.
updateRemain
();
this
.
updateRemain
();
...
...
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