Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
mini-program
/
hmd
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 daa50a73
authored
Jul 17, 2023
by
liimin
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
调整结构
1 parent
5cd9f8cf
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
25 deletions
api/request/sign.js
app.js
lib/index.js
utils/sentryConfig/sentryInit.js
utils/utils_wx.js
api/request/sign.js
View file @
daa50a7
import
sha1
from
'../../utils/lib/sha1.js'
import
{
sha1
,
qs
}
from
'../../lib/index'
import
qs
from
'../../utils/lib/qs'
import
environment
from
'../env/index.js'
import
environment
from
'../env/index.js'
const
sign
=
(
params
,
secret
,
noSignAttr
=
[])
=>
{
const
sign
=
(
params
,
secret
,
noSignAttr
=
[])
=>
{
delete
params
.
sign
delete
params
.
sign
...
...
app.js
View file @
daa50a7
// app.js
// app.js
// 初始化sentry
// 初始化sentry
import
sentryInit
from
'~/utils/sentryConfig/sentryInit'
import
sentryInit
from
"~/utils/sentryConfig/sentryInit"
;
sentryInit
()
sentryInit
()
;
import
api
from
'./api/index'
import
api
from
"./api/index"
;
import
{
router
}
from
'./router/index'
import
{
router
}
from
"./router/index"
;
// 判断小程序是否需要更新
// 判断小程序是否需要更新
import
getUpdateManager
from
'./lib/wxUpdateManager'
import
{
getUpdateManager
}
from
"./lib/index"
;
import
utils
from
'./utils/index'
import
utils
from
"./utils/index"
;
// 埋点 有需要再引入
// 埋点 有需要再引入
// import './utils/track/Track'
// import './utils/track/Track'
App
({
App
({
onLaunch
(
options
)
{
onLaunch
(
options
)
{
getUpdateManager
()
getUpdateManager
()
;
/**挂载到wx对象 */
/**挂载到wx对象 */
wx
.
p
=
{
wx
.
p
=
{
authStatus
:
false
,
authStatus
:
false
,
...
utils
,
...
utils
,
api
,
api
,
router
,
router
,
storage
:
new
utils
.
cache
.
Storage
(),
storage
:
new
utils
.
cache
.
Storage
(),
}
}
;
// 存储设备信息
// 存储设备信息
utils
.
cache
.
storageApi
.
setSystem_info
()
utils
.
cache
.
storageApi
.
setSystem_info
()
;
},
},
/**页面不存在时触发 */
/**页面不存在时触发 */
onPageNotFound
(
e
)
{
onPageNotFound
(
e
)
{
wx
.
p
.
router
.
goHome
()
wx
.
p
.
router
.
goHome
()
;
},
},
onHide
()
{},
onHide
()
{},
globalData
:
{
globalData
:
{
ROUTE_QUERY
:
{}
ROUTE_QUERY
:
{},
}
}
,
})
})
;
lib/index.js
0 → 100644
View file @
daa50a7
import
sha1
from
'./sha1.js'
import
qs
from
'./qs'
import
wxqrcode
from
'./wxqrcode.js'
import
getUpdateManager
from
"./wxUpdateManager"
;
import
*
as
Sentry
from
'./sentry-miniapp'
module
.
exports
=
{
sha1
,
qs
,
wxqrcode
,
getUpdateManager
,
Sentry
}
\ No newline at end of file
\ No newline at end of file
utils/sentryConfig/sentryInit.js
View file @
daa50a7
import
{
dsnUrl
}
from
'~/config'
import
{
dsnUrl
}
from
"~/config"
;
import
*
as
Sentry
from
'~/utils/lib/sentry-miniapp'
import
{
Sentry
}
from
"~/lib/index"
;
export
default
function
sentryInit
()
{
export
default
function
sentryInit
()
{
// accountInfo.miniProgram.envVersion == 'release' &&
// accountInfo.miniProgram.envVersion == 'release' &&
const
accountInfo
=
wx
.
getAccountInfoSync
()
const
accountInfo
=
wx
.
getAccountInfoSync
()
;
//测试和生产才开发sentry
//测试和生产才开发sentry
const
env
=
[
'trial'
,
'release'
]
const
env
=
[
"trial"
,
"release"
];
env
.
includes
(
accountInfo
.
miniProgram
.
envVersion
)
&&
env
.
includes
(
accountInfo
.
miniProgram
.
envVersion
)
&&
Sentry
.
init
({
Sentry
.
init
({
// dsn: 'http://ebcf31c417cc4ce185782f046e4a87a2@sentry.glsx.com.cn/5'
// dsn: 'http://ebcf31c417cc4ce185782f046e4a87a2@sentry.glsx.com.cn/5'
dsn
:
dsnUrl
dsn
:
dsnUrl
,
})
})
;
}
}
utils/utils_wx.js
View file @
daa50a7
import
wxqrcode
from
'~/utils/lib/wxqrcode
.js'
import
{
wxqrcode
}
from
'~/lib/index
.js'
/**
/**
* 禁止滑动
* 禁止滑动
...
...
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