Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
shuzilixiangwaibao
/
wanda-vr
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
1
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
837c088a
authored
Sep 11, 2020
by
白宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reset_applcation
parent
9893c088
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
0 deletions
+45
-0
libs/helper.js
+45
-0
No files found.
libs/helper.js
View file @
837c088a
...
...
@@ -90,6 +90,9 @@ const $get = (url)=>{
if
(
res
.
data
.
code
===
0
){
resolve
(
res
.
data
)
}
else
{
if
(
res
.
data
.
code
==
'100100'
||
res
.
data
.
code
==
'100101'
){
reset_applcation
()
}
reject
(
Error
(
res
.
data
.
msg
))
}
}).
catch
(
err
=>
{
...
...
@@ -106,6 +109,9 @@ const $post = (url,data)=>{
if
(
res
.
data
.
code
===
0
){
resolve
(
res
.
data
)
}
else
{
if
(
res
.
data
.
code
==
'100100'
||
res
.
data
.
code
==
'100101'
){
reset_applcation
()
}
reject
(
Error
(
res
.
data
.
msg
))
}
...
...
@@ -114,7 +120,46 @@ const $post = (url,data)=>{
})
})
}
function
_init_wx_jssdk
(){
if
(
wx
){
wx
.
updateAppMessageShareData
({
title
:
FRONT_TITLE
,
// 分享标题
desc
:
FRONT_DESC
,
// 分享描述
link
:
FRONT_URL
+
'?'
+
new
Date
().
getTime
(),
// 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl
:
shareImg
(),
// 分享图标
success
:
function
()
{
// 设置成功
}
})
var
title
=
FRONT_TITLE
try
{
title
=
`
${
getUserInfoByLocalStorage
()}
的2020幸运打卡地:丹寨`
}
catch
(
error
)
{
}
// alert(title)
var
img
=
shareImg
()
// alert(img)
// wx.onMenuShareTimeline({
wx
.
updateTimelineShareData
({
title
:
title
,
// 分享标题
link
:
FRONT_URL
+
'?'
+
new
Date
().
getTime
(),
// 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl
:
img
,
// 分享图标
success
:
function
()
{
// 设置成功
}
})
}
}
async
function
reset_applcation
()
{
localStorage
.
clear
()
const
{
url
,
appid
}
=
await
$get
(
'/weixin/info'
).
then
(
res
=>
res
.
data
).
catch
(
err
=>
{
throw
err
})
location
.
href
=
url
}
/**
* 获取信息
* @returns {Promise<unknown>}
...
...
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