Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
飞
飞鹤小程序
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
FH
飞鹤小程序
Commits
f5e44883
Commit
f5e44883
authored
Jun 13, 2025
by
tao.huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 神策初始化
parent
4bd707e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
5 deletions
+24
-5
main.js
main.js
+24
-5
No files found.
main.js
View file @
f5e44883
import
App
from
"./App"
;
// import apiRequest from "@/api/request.js";
import
*
as
Pinia
from
'pinia'
;
import
*
as
Pinia
from
"pinia"
;
import
sensors
from
"sa-sdk-miniprogram"
;
const
BASE_URL
=
'https://duiba.oss-cn-hangzhou.aliyuncs.com/fh/'
;
const
SENSORS_URL
=
"https://sensors.feihe.com/sa?project=XMH_Content"
;
const
BASE_URL
=
"https://duiba.oss-cn-hangzhou.aliyuncs.com/fh/"
;
// const BASE_URL = 'https://firmus-member-test-1253290912.cos.ap-beijing.myqcloud.com/xmh-mini-program/';
sensors
.
setPara
({
name
:
"sensors"
,
server_url
:
SENSORS_URL
,
show_log
:
true
,
autoTrack
:
{
appLaunch
:
true
,
// 默认为 true,false 则关闭 $MPLaunch 事件采集
appShow
:
true
,
// 默认为 true,false 则关闭 $MPShow 事件采集
appHide
:
true
,
// 默认为 true,false 则关闭 $MPHide 事件采集
pageShow
:
true
,
// 默认为 true,false 则关闭 $MPViewScreen 事件采集
pageShare
:
true
,
// 默认为 true,false 则关闭 $MPShare 事件采集
mpClick
:
true
,
// 默认为 false,true 则开启 $MPClick 事件采集
mpFavorite
:
true
,
// 默认为 true,false 则关闭 $MPAddFavorites 事件采集
pageLeave
:
true
,
// 默认为 false, true 则开启 $MPPageLeave事件采集
},
});
sensors
.
init
();
// #ifndef VUE3
import
Vue
from
"vue"
;
import
"./uni.promisify.adaptor"
;
// 全局挂载后使用
// Vue.prototype.$api = apiRequest.api;
Vue
.
prototype
.
$baseUrl
=
BASE_URL
;
Vue
.
prototype
.
$sensors
=
sensors
;
Vue
.
config
.
productionTip
=
false
;
App
.
mpType
=
"app"
;
...
...
@@ -31,9 +49,10 @@ export function createApp() {
app
.
use
(
Pinia
.
createPinia
());
// app.config.globalProperties.$api = apiRequest.api;
app
.
config
.
globalProperties
.
$baseUrl
=
BASE_URL
;
app
.
config
.
globalProperties
.
$sensors
=
sensors
;
return
{
app
,
Pinia
Pinia
,
};
}
// #endif
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