|
@@ -15,16 +15,27 @@ export default {
|
15
|
15
|
setup(props) {
|
16
|
16
|
// console.log(props.title)
|
17
|
17
|
const router = useRouter();
|
18
|
|
- const query_Obj = '';
|
19
|
|
- // const query_Obj = router.currentRoute.value.query
|
|
18
|
+ // const query_Obj = '';
|
|
19
|
+ const query_Obj = router.currentRoute.value.query
|
20
|
20
|
const url_st = ref()//企微地址,需要在企微环境中打开
|
21
|
|
- console.log('window.location.href',window.location.href);
|
22
|
|
- console.log('#/radar [0]',window.location.href.split('#/radar')[0]);
|
23
|
|
- console.log('#/radar [0] []',window.location.href.split('#/radar')[0].split('index.html?')[1]);
|
24
|
|
- console.log('code state',window.location.href.split('#/radar')[0].split('index.html?')[1].split['&']);
|
25
|
|
- console.log('router',router);
|
26
|
|
- console.log('router.currentRoute',router.currentRoute);
|
27
|
|
- console.log(router.currentRoute.value.fullPath);
|
|
21
|
+ const locationHref = window.location.href.split('#/radar')[0].split('index.html?')[1]
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+ // console.log('window.location.href',window.location.href);
|
|
25
|
+ // console.log('#/radar [0]',window.location.href.split('#/radar')[0]);
|
|
26
|
+ // console.log('#/radar [0] []',window.location.href.split('#/radar')[0].split('index.html?')[1]);
|
|
27
|
+ // console.log('code state',window.location.href.split('#/radar')[0].split('index.html?')[1].split['&']);
|
|
28
|
+ // console.log('router',router);
|
|
29
|
+ // console.log('router.currentRoute',router.currentRoute);
|
|
30
|
+ // console.log(router.currentRoute.value.fullPath);
|
|
31
|
+
|
|
32
|
+ let a= locationHref
|
|
33
|
+ let b_code = a.split('&')[0]
|
|
34
|
+ let c_state = a.split('&')[1]
|
|
35
|
+ console.log(b_code);
|
|
36
|
+ console.log(c_state);
|
|
37
|
+ console.log(b_code.substr(5));
|
|
38
|
+ console.log(c_state.substr(6));
|
28
|
39
|
|
29
|
40
|
|
30
|
41
|
// const get_token_timestamp = () => {
|
|
@@ -45,66 +56,66 @@ export default {
|
45
|
56
|
// }
|
46
|
57
|
// get_token_timestamp()
|
47
|
58
|
|
48
|
|
- // const getUserInfo = () => {
|
49
|
|
- // axios.get('/api/oauth2/userInfo', {
|
50
|
|
- // params: {
|
51
|
|
- // corpid: query_Obj.corpid,
|
52
|
|
- // code: query_Obj.code,
|
53
|
|
- // state: query_Obj.state
|
54
|
|
- // }
|
55
|
|
- // }).then((res) => {
|
56
|
|
- // let now_res=res.data.rst
|
57
|
|
- // behaviorReport(now_res)
|
58
|
|
- //
|
59
|
|
- // }).catch((err) => {
|
60
|
|
- // console.log(err)
|
61
|
|
- // })
|
62
|
|
- // }
|
63
|
|
- // getUserInfo()
|
|
59
|
+ const getUserInfo = () => {
|
|
60
|
+ axios.get('/api/oauth2/userInfo', {
|
|
61
|
+ params: {
|
|
62
|
+ corpid: query_Obj.corpid,
|
|
63
|
+ code: b_code,
|
|
64
|
+ state: c_state
|
|
65
|
+ }
|
|
66
|
+ }).then((res) => {
|
|
67
|
+ let now_res=res.data.rst
|
|
68
|
+ behaviorReport(now_res)
|
64
|
69
|
|
65
|
|
- // const getRadarDetial = () => {
|
66
|
|
- // axios.get('/api/radarPage/detail', {
|
67
|
|
- // params: {
|
68
|
|
- // corpid: query_Obj.corpid,
|
69
|
|
- // radar_id: query_Obj.radar_id,
|
70
|
|
- // user_id: query_Obj.user_id,
|
71
|
|
- // token:query_Obj.token,
|
72
|
|
- // timestamp:query_Obj.timestamp,
|
73
|
|
- //
|
74
|
|
- // }
|
75
|
|
- // }).then((res) => {
|
76
|
|
- //
|
77
|
|
- // }).catch((err) => {
|
78
|
|
- // console.log(err)
|
79
|
|
- // })
|
80
|
|
- // }
|
81
|
|
- // getRadarDetial()
|
82
|
|
- // const behaviorReport = (now_res) => {
|
83
|
|
- // axios.get('/api/radarPage/report', {
|
84
|
|
- // params: {
|
85
|
|
- // corpid: query_Obj.corpid,
|
86
|
|
- // radar_id: query_Obj.radar_id,
|
87
|
|
- // user_id: query_Obj.user_id,
|
88
|
|
- // token:query_Obj.token,
|
89
|
|
- // timestamp:query_Obj.timestamp,
|
90
|
|
- // rule_id: query_Obj.rule_id,
|
91
|
|
- // channel: query_Obj.channel,
|
92
|
|
- // state: query_Obj.state,
|
93
|
|
- //
|
94
|
|
- // external_userid:now_res.external_userid,
|
95
|
|
- // openid:now_res.openid,
|
96
|
|
- // device_id:now_res.device_id
|
97
|
|
- //
|
98
|
|
- // }
|
99
|
|
- // }).then((res) => {
|
100
|
|
- //
|
101
|
|
- // }).catch((err) => {
|
102
|
|
- // console.log(err)
|
103
|
|
- // })
|
104
|
|
- // }
|
|
70
|
+ }).catch((err) => {
|
|
71
|
+ console.log(err)
|
|
72
|
+ })
|
|
73
|
+ }
|
|
74
|
+ getUserInfo()
|
|
75
|
+
|
|
76
|
+ const getRadarDetial = () => {
|
|
77
|
+ axios.get('/api/radarPage/detail', {
|
|
78
|
+ params: {
|
|
79
|
+ corpid: query_Obj.corpid,
|
|
80
|
+ radar_id: query_Obj.radar_id,
|
|
81
|
+ user_id: query_Obj.user_id,
|
|
82
|
+ token:query_Obj.token,
|
|
83
|
+ timestamp:query_Obj.timestamp,
|
|
84
|
+
|
|
85
|
+ }
|
|
86
|
+ }).then((res) => {
|
105
|
87
|
|
106
|
|
- //getUserInfo,getRadarDetial,behaviorReport,
|
107
|
|
- return {url_st,router}
|
|
88
|
+ }).catch((err) => {
|
|
89
|
+ console.log(err)
|
|
90
|
+ })
|
|
91
|
+ }
|
|
92
|
+ getRadarDetial()
|
|
93
|
+ const behaviorReport = (now_res) => {
|
|
94
|
+ axios.get('/api/radarPage/report', {
|
|
95
|
+ params: {
|
|
96
|
+ corpid: query_Obj.corpid,
|
|
97
|
+ radar_id: query_Obj.radar_id,
|
|
98
|
+ user_id: query_Obj.user_id,
|
|
99
|
+ token:query_Obj.token,
|
|
100
|
+ timestamp:query_Obj.timestamp,
|
|
101
|
+ rule_id: query_Obj.rule_id,
|
|
102
|
+ channel: query_Obj.channel,
|
|
103
|
+ state: query_Obj.state,
|
|
104
|
+
|
|
105
|
+ external_userid:now_res.external_userid,
|
|
106
|
+ openid:now_res.openid,
|
|
107
|
+ device_id:now_res.device_id
|
|
108
|
+
|
|
109
|
+ }
|
|
110
|
+ }).then((res) => {
|
|
111
|
+
|
|
112
|
+ }).catch((err) => {
|
|
113
|
+ console.log(err)
|
|
114
|
+ })
|
|
115
|
+ }
|
|
116
|
+
|
|
117
|
+ //
|
|
118
|
+ return {getUserInfo,getRadarDetial,behaviorReport,url_st,router}
|
108
|
119
|
}
|
109
|
120
|
}
|
110
|
121
|
</script>
|