Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
web-project
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
海康威视
web-project
Commits
43ea53e8
Commit
43ea53e8
authored
Jan 13, 2025
by
方建宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
警告接口、热用户数据接口、AI无人站接口
parent
22f69d70
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
124 additions
and
121 deletions
+124
-121
AItoken.js
src/views/AIStation/AItoken.js
+28
-28
HeatUserPage.vue
src/views/HeatUserPage/HeatUserPage.vue
+22
-19
home.vue
src/views/home.vue
+74
-74
No files found.
src/views/AIStation/AItoken.js
View file @
43ea53e8
...
...
@@ -6,22 +6,22 @@ import store from "@/store/index.js";
export
function
handleGetAIToken
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
AIToken
=
localStorage
.
getItem
(
'AIToken'
);
if
(
AIToken
)
{
// 有存储token判断token有没有过期
// 检验token是否过期
checkToken
(
AIToken
).
then
(
res
=>
{
if
(
res
.
data
===
false
)
{
localStorage
.
removeItem
(
'AIToken'
);
// token过期
getToken
().
then
(
resolve
).
catch
(
reject
);
}
else
{
resolve
();
}
}).
catch
(
reject
);
}
else
{
// 没有token的话获取存储token
getToken
().
then
(
resolve
).
catch
(
reject
);
}
//
if (AIToken) {
//
// 有存储token判断token有没有过期
//
// 检验token是否过期
//
checkToken(AIToken).then(res => {
//
if (res.data === false) {
//
localStorage.removeItem('AIToken');
//
// token过期
//
getToken().then(resolve).catch(reject);
//
} else {
//
resolve();
//
}
//
}).catch(reject);
//
} else {
//
// 没有token的话获取存储token
//
getToken().then(resolve).catch(reject);
//
}
});
}
...
...
@@ -31,17 +31,17 @@ function getToken() {
const
userId
=
userInfo
.
userId
;
const
params
=
{
username
:
userName
};
// 通过userName获取uuid
return
getAuthUUID
(
params
).
then
(
res
=>
{
const
uuid
=
res
.
data
;
const
params
=
{
userId
:
userId
,
username
:
userName
,
uuid
:
uuid
,
};
//
return getAuthUUID(params).then(res => {
//
const uuid = res.data;
//
const params = {
//
userId: userId,
//
username: userName,
//
uuid: uuid,
//
};
// 通过userId,username,uuid获取token
return
createToken
(
params
).
then
(
r
es
=>
{
const
token
=
res
.
data
;
localStorage
.
setItem
(
'AIToken'
,
token
);
});
});
// return createToken(params).then(r-
es => {
//
const token = res.data;
//
localStorage.setItem('AIToken', token);
//
});
//
});
}
src/views/HeatUserPage/HeatUserPage.vue
View file @
43ea53e8
...
...
@@ -490,17 +490,20 @@ async function getName() {
//根据参数获得数据
async
function
getHisDataByInfo
(
name
,
start
,
end
,
startPage
,
pagesCount
,
sort
)
{
loading
.
value
=
true
await
http
.
post
(
dataUrl
,
{
name
:
name
,
startTime
:
start
,
endTime
:
end
,
start
:
startPage
,
count
:
pagesCount
,
sort
:
sort
}).
then
((
result
)
=>
{
if
(
result
.
status
===
0
)
{
//
await http.post(dataUrl, { name: name, startTime: start, endTime: end, start: startPage, count: pagesCount, sort: sort }).then((result) => {
//
if (result.status === 0) {
//处理返回数据
tableInfo
.
hisData
=
result
.
data
.
dataInfoList
;
total
.
value
=
result
.
data
.
rowCount
;
// tableInfo.hisData = result.data.dataInfoList;
// total.value = result.data.rowCount;
// setshowData();
tableInfo
.
hisData
=
tigerTigerHeatUserHis
.
dataInfoList
;
total
.
value
=
tigerTigerHeatUserHis
.
rowCount
;
setshowData
();
}
else
{
tableInfo
.
tableData
.
length
=
0
;
total
.
value
=
0
;
}
})
//
} else {
//
tableInfo.tableData.length = 0;
//
total.value=0;
//
}
//
})
loading
.
value
=
false
}
...
...
src/views/home.vue
View file @
43ea53e8
...
...
@@ -864,80 +864,80 @@ export default defineComponent({
RoleId
:
roleIds
.
value
,
};
}
function
alarm
()
{
http
.
post
(
"/api/alarm/GetAlarmMsg"
,
AlarmInfo
.
value
,
false
)
.
then
((
result
)
=>
{
if
(
result
.
success
&&
result
.
data
.
lenth
===
0
&&
sta
.
value
===
0
)
{
sta
.
value
=
1
;
title
.
value
=
result
.
data
[
0
].
title
;
msg
.
value
=
result
.
data
[
0
].
msg
;
id
.
value
=
result
.
data
[
0
].
id
;
ElNotification
({
title
:
title
.
value
,
dangerouslyUseHTMLString
:
true
,
message
:
msg
.
value
.
replace
(
"
\n
"
,
"<br />"
),
position
:
"bottom-right"
,
type
:
"error"
,
duration
:
0
,
onClick
()
{
activeTable
.
value
=
"/Video"
;
localStorage
.
setItem
(
"activeTab"
,
"/Video"
);
//路由跳转
this
.
$router
.
push
({
//如果要是用 name 传参 就直接 携带一个 query 对象中包含参数
path
:
"/Video"
,
query
:
{
id
:
id
.
value
,
},
});
},
onClose
()
{
sta
.
value
=
0
;
},
});
}
});
}
function
countalarm
()
{
http
.
post
(
"/api/alarm/GetAlarmMsg"
,
AlarmInfo
.
value
).
then
((
result
)
=>
{
if
(
result
.
success
&&
result
.
data
.
lenth
===
0
&&
consta
.
value
===
0
)
{
consta
.
value
=
1
;
counttitle
.
value
=
result
.
data
[
1
].
title
;
countmsg
.
value
=
result
.
data
[
1
].
msg
;
countid
.
value
=
result
.
data
[
1
].
id
;
ElNotification
({
title
:
counttitle
.
value
,
dangerouslyUseHTMLString
:
true
,
message
:
countmsg
.
value
.
replace
(
"
\n
"
,
"<br />"
),
position
:
"bottom-right"
,
type
:
"error"
,
duration
:
0
,
onClick
()
{
activeTable
.
value
=
"/Video"
;
localStorage
.
setItem
(
"activeTab"
,
"/Video"
);
//路由跳转
this
.
$router
.
push
({
//如果要是用 name 传参 就直接 携带一个 query 对象中包含参数
path
:
"/Video"
,
query
:
{
id
:
countid
.
value
,
},
});
},
onClose
()
{
consta
.
value
=
0
;
},
});
}
});
}
setInterval
(()
=>
{
getinfo
();
alarm
();
countalarm
();
},
60
*
1000
);
// 每分钟执行一次
//警告接口
//
function alarm() {
//
http
//
.post("/api/alarm/GetAlarmMsg", AlarmInfo.value, false)
//
.then((result) => {
//
if (result.success && result.data.lenth === 0 && sta.value === 0) {
//
sta.value = 1;
//
title.value = result.data[0].title;
//
msg.value = result.data[0].msg;
//
id.value = result.data[0].id;
//
ElNotification({
//
title: title.value,
//
dangerouslyUseHTMLString: true,
//
message: msg.value.replace("\n", "
<
br
/>
"),
//
position: "
bottom
-
right
",
//
type: "
error
",
//
duration: 0,
//
onClick() {
//
activeTable.value = "
/
Video
";
//
localStorage.setItem("
activeTab
", "
/
Video
");
//
//路由跳转
//
this.$router.push({
//
//如果要是用 name 传参 就直接 携带一个 query 对象中包含参数
//
path: "
/
Video
",
//
query: {
//
id: id.value,
//
},
//
});
//
},
//
onClose() {
//
sta.value = 0;
//
},
//
});
//
}
//
});
//
}
//
function countalarm() {
//
http.post("
/
api
/
alarm
/
GetAlarmMsg
", AlarmInfo.value).then((result) => {
//
if (result.success && result.data.lenth === 0 && consta.value === 0) {
//
consta.value = 1;
//
counttitle.value = result.data[1].title;
//
countmsg.value = result.data[1].msg;
//
countid.value = result.data[1].id;
//
ElNotification({
//
title: counttitle.value,
//
dangerouslyUseHTMLString: true,
//
message: countmsg.value.replace("
\
n
", "
<
br
/>
"),
//
position: "
bottom
-
right
",
//
type: "
error
",
//
duration: 0,
//
onClick() {
//
activeTable.value = "
/
Video
";
//
localStorage.setItem("
activeTab
", "
/
Video
");
//
//路由跳转
//
this.$router.push({
//
//如果要是用 name 传参 就直接 携带一个 query 对象中包含参数
//
path: "
/
Video
",
//
query: {
//
id: countid.value,
//
},
//
});
//
},
//
onClose() {
//
consta.value = 0;
//
},
//
});
//
}
//
});
//
}
//
setInterval(() => {
//
getinfo();
//
alarm();
//
countalarm();
//
}, 60 * 1000); // 每分钟执行一次
//个人资料弹出框
const funsel = ref(true);
...
...
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