Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
mini-program
/
ai-card
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 228a4869
authored
Oct 30, 2022
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
add sentry config
1 parent
fbffc1a7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
23 deletions
app.js
utils/lib/sentry-miniapp.js
app.js
View file @
228a486
//app.js
//app.js
import
*
as
Sentry
from
'./utils/lib/sentry-miniapp'
Sentry
.
init
({
// dsn: 'http://ebcf31c417cc4ce185782f046e4a87a2@sentry.glsx.com.cn/5'
dsn
:
'https://e440585f391e46278c3c72ddabb1d17f@sentry.glsx.com.cn/31'
})
import
router
from
'./router/index.js'
import
router
from
'./router/index.js'
import
util
from
'./utils/util.js'
import
util
from
'./utils/util.js'
import
'./utils/Track'
import
'./utils/Track'
import
{
import
{
ssoApi
,
wechatApi
}
from
'./api/api'
ssoApi
,
import
{
trackData
}
from
'./utils/data'
wechatApi
}
from
'./api/api'
import
{
trackData
}
from
'./utils/data'
import
eventbus
from
'./utils/evenbus'
import
eventbus
from
'./utils/evenbus'
// 实例化对象存储
// 实例化对象存储
import
{
Storage
}
from
'./utils/cache/storage'
import
{
Storage
}
from
'./utils/cache/storage'
const
$Storage
=
new
Storage
()
const
$Storage
=
new
Storage
()
App
({
App
({
onLaunch
:
function
(
options
)
{
onLaunch
:
function
(
options
)
{
console
.
log
(
options
)
console
.
log
(
options
)
...
@@ -26,7 +27,8 @@ App({
...
@@ -26,7 +27,8 @@ App({
wx
.
$imgUrl
=
'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/'
wx
.
$imgUrl
=
'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/'
wx
.
$appId
=
wx
.
getAccountInfoSync
().
miniProgram
.
appId
wx
.
$appId
=
wx
.
getAccountInfoSync
().
miniProgram
.
appId
const
systemInfo
=
wx
.
getStorageSync
(
'aicard_system_info'
)
const
systemInfo
=
wx
.
getStorageSync
(
'aicard_system_info'
)
if
(
!
systemInfo
)
wx
.
getSystemInfo
({
if
(
!
systemInfo
)
wx
.
getSystemInfo
({
success
(
res
)
{
success
(
res
)
{
util
.
setStorageSync
(
'aicard_system_info'
,
res
)
util
.
setStorageSync
(
'aicard_system_info'
,
res
)
}
}
...
@@ -43,13 +45,13 @@ App({
...
@@ -43,13 +45,13 @@ App({
let
wechatInfo
=
null
let
wechatInfo
=
null
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
wx
.
login
({
wx
.
login
({
success
({
success
({
code
})
{
code
ssoApi
})
{
.
jsCodeLogin
({
ssoApi
.
jsCodeLogin
({
code
,
code
,
appId
:
wx
.
$appId
appId
:
wx
.
$appId
}).
then
(
res
=>
{
})
.
then
(
res
=>
{
wechatInfo
=
res
.
data
wechatInfo
=
res
.
data
util
.
setStorageSync
(
'aicard_info'
,
wechatInfo
)
util
.
setStorageSync
(
'aicard_info'
,
wechatInfo
)
wx
.
$authStatus
=
res
.
code
!=
0
wx
.
$authStatus
=
res
.
code
!=
0
...
@@ -69,11 +71,11 @@ App({
...
@@ -69,11 +71,11 @@ App({
wx
.
$trackData
.
type
=
systemInfo
.
environment
?
2
:
1
wx
.
$trackData
.
type
=
systemInfo
.
environment
?
2
:
1
wx
.
$Track
.
sendTrack
(
trackData
.
COMPANY
,
wechatInfo
)
wx
.
$Track
.
sendTrack
(
trackData
.
COMPANY
,
wechatInfo
)
})
})
}
else
if
(
wx
.
$trackData
.
detailShare
)
{
}
else
if
(
wx
.
$trackData
.
detailShare
)
{
// d+产品分享在这里设置埋点
// d+产品分享在这里设置埋点
const
detailShare
=
wx
.
$trackData
.
detailShare
const
detailShare
=
wx
.
$trackData
.
detailShare
console
.
log
(
1211
)
console
.
log
(
1211
)
for
(
let
i
in
trackData
)
{
for
(
let
i
in
trackData
)
{
console
.
log
(
i
)
console
.
log
(
i
)
if
(
trackData
[
i
].
pageName
==
detailShare
)
{
if
(
trackData
[
i
].
pageName
==
detailShare
)
{
console
.
log
(
trackData
[
i
])
console
.
log
(
trackData
[
i
])
...
@@ -92,9 +94,11 @@ App({
...
@@ -92,9 +94,11 @@ App({
wx
.
$trackData
.
type
=
systemInfo
.
environment
?
2
:
1
wx
.
$trackData
.
type
=
systemInfo
.
environment
?
2
:
1
wx
.
$Track
.
sendTrack
(
trackData
.
COMPANY
,
wechatInfo
)
wx
.
$Track
.
sendTrack
(
trackData
.
COMPANY
,
wechatInfo
)
}
}
ssoApi
.
getUserInfo
({
ssoApi
.
getUserInfo
({
openId
openId
}).
then
(
result
=>
{
})
.
then
(
result
=>
{
if
(
returnResponse
)
{
if
(
returnResponse
)
{
resolve
(
result
)
resolve
(
result
)
}
else
{
}
else
{
...
@@ -106,23 +110,25 @@ App({
...
@@ -106,23 +110,25 @@ App({
resolve
(
result
)
resolve
(
result
)
}
}
})
})
}).
catch
(()
=>
{
})
.
catch
(()
=>
{
wx
.
$authStatus
=
true
wx
.
$authStatus
=
true
reject
()
reject
()
})
})
}
}
})
})
})
})
},
},
getScene
(
scene
)
{
getScene
(
scene
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
wechatApi
.
getSceneById
({
wechatApi
.
getSceneById
({
id
:
decodeURIComponent
(
scene
).
split
(
'='
)[
1
]
id
:
decodeURIComponent
(
scene
).
split
(
'='
)[
1
]
}).
then
(({
data
})
=>
{
})
.
then
(({
data
})
=>
{
let
op
=
{}
let
op
=
{}
data
.
scene
.
split
(
'&'
).
map
(
item
=>
{
data
.
scene
.
split
(
'&'
).
map
(
item
=>
{
const
[
key
,
val
]
=
item
.
split
(
"="
)
const
[
key
,
val
]
=
item
.
split
(
'='
)
op
[
key
]
=
val
op
[
key
]
=
val
})
})
resolve
(
op
)
resolve
(
op
)
...
@@ -191,6 +197,5 @@ App({
...
@@ -191,6 +197,5 @@ App({
})
})
}
}
},
},
globalData
:
{
globalData
:
{}
}
})
})
utils/lib/sentry-miniapp.js
0 → 100644
View file @
228a486
This diff is collapsed.
Click to expand it.
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