user-behavior-monitor 1.0.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -29
- package/dist/user-behavior-monitor.common.js +311 -120
- package/dist/user-behavior-monitor.common.js.map +1 -1
- package/dist/user-behavior-monitor.umd.js +311 -120
- package/dist/user-behavior-monitor.umd.js.map +1 -1
- package/dist/user-behavior-monitor.umd.min.js +1 -1
- package/dist/user-behavior-monitor.umd.min.js.map +1 -1
- package/package.json +3 -2
- package/src/components/UserBehaviorMonitor.vue +293 -115
- package/src/components/{UserBehaviorMonitor1.vue → UserBehaviorMonitor2.vue} +130 -60
package/README.md
CHANGED
|
@@ -5,14 +5,7 @@ Vue 2.5.2 兼容的用户行为监控组件,用于监测用户操作并在超
|
|
|
5
5
|
## 安装
|
|
6
6
|
|
|
7
7
|
\`\`\`bash
|
|
8
|
-
npm install
|
|
9
|
-
# 安装特定分支
|
|
10
|
-
npm install git+https://code.mysugoncloud.com/linmingchuang/usermonitor.git#branch-name
|
|
11
|
-
|
|
12
|
-
# 安装特定标签
|
|
13
|
-
npm install git+https://code.mysugoncloud.com/linmingchuang/usermonitor.git#v1.0.0
|
|
14
|
-
\`\`\`
|
|
15
|
-
"user-behavior-monitor": "file:/var/jenkins_home/workspace/web-usermonitor"
|
|
8
|
+
npm install user-behavior-monitor
|
|
16
9
|
## 使用方法
|
|
17
10
|
|
|
18
11
|
### 方式一:全局注册
|
|
@@ -44,12 +37,6 @@ export default {
|
|
|
44
37
|
<div id="app">
|
|
45
38
|
<!-- 其他组件 -->
|
|
46
39
|
<user-behavior-monitor
|
|
47
|
-
websocket-url="ws://localhost:8080/websocket"
|
|
48
|
-
:timeout-minutes="10"
|
|
49
|
-
:warning-minutes="1"
|
|
50
|
-
@logout="handleLogout"
|
|
51
|
-
@user-active="handleUserActive"
|
|
52
|
-
@timeout-warning="handleTimeoutWarning"
|
|
53
40
|
/>
|
|
54
41
|
</div>
|
|
55
42
|
</template>
|
|
@@ -62,16 +49,7 @@ export default {
|
|
|
62
49
|
UserBehaviorMonitor
|
|
63
50
|
},
|
|
64
51
|
methods: {
|
|
65
|
-
|
|
66
|
-
// 处理登出逻辑,例如跳转到登录页
|
|
67
|
-
this.$router.push('/login');
|
|
68
|
-
},
|
|
69
|
-
handleUserActive() {
|
|
70
|
-
console.log('用户有活动');
|
|
71
|
-
},
|
|
72
|
-
handleTimeoutWarning() {
|
|
73
|
-
console.log('即将超时警告');
|
|
74
|
-
}
|
|
52
|
+
|
|
75
53
|
}
|
|
76
54
|
};
|
|
77
55
|
</script>
|
|
@@ -79,11 +57,6 @@ export default {
|
|
|
79
57
|
|
|
80
58
|
## Props
|
|
81
59
|
|
|
82
|
-
| 属性名 | 类型 | 默认值 | 说明 |
|
|
83
|
-
| --- | --- | --- | --- |
|
|
84
|
-
| websocket-url | String | 必填 | WebSocket服务器地址 |
|
|
85
|
-
| timeout-minutes | Number | 10 | 超时时间(分钟) |
|
|
86
|
-
| warning-minutes | Number | 1 | 警告提前时间(分钟) |
|
|
87
60
|
|
|
88
61
|
## Events
|
|
89
62
|
|