Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gassafety-progress
Project
Project
Details
Activity
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
耿迪迪
gassafety-progress
Commits
2f652115
Commit
2f652115
authored
Apr 01, 2022
by
耿迪迪
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
ssh://111.61.77.35:15/gengdidi/gassafety-progress
parents
40acc4e5
ae9566f7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
71 additions
and
38 deletions
+71
-38
App.vue
gassafetyprogress-web/src/App.vue
+14
-4
rightBar.vue
gassafetyprogress-web/src/components/emergency/rightBar.vue
+1
-1
Navbar.vue
gassafetyprogress-web/src/layout/components/Navbar.vue
+1
-1
permission.js
gassafetyprogress-web/src/permission.js
+51
-30
permission.js
gassafetyprogress-web/src/store/modules/permission.js
+2
-0
yjmap.js
gassafetyprogress-web/src/utils/mapClass/yjmap.js
+1
-1
index.vue
gassafetyprogress-web/src/views/emergency/index.vue
+1
-1
No files found.
gassafetyprogress-web/src/App.vue
View file @
2f652115
<!--
* @Author: your name
* @Date: 2022-02-26 22:22:56
* @LastEditTime: 2022-03-31 15:28:05
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /gassafety-progress/gassafetyprogress-web/src/App.vue
-->
<
template
>
<div
id=
"app"
>
<router-view
/>
<transition
name=
"fade"
mode=
"out-in"
>
<router-view
/>
</transition>
</div>
</
template
>
<
script
>
export
default
{
name
:
'App'
}
export
default
{
name
:
"App"
,
}
;
</
script
>
gassafetyprogress-web/src/components/emergency/rightBar.vue
View file @
2f652115
...
...
@@ -302,7 +302,7 @@ export default {
socket
()
{
console
.
log
(
"socket执行"
);
this
.
ws
=
new
WebSocket
(
"ws://
192.168.2.17:8903
/gassafety/websocketServer"
"ws://
222.223.203.154:8902
/gassafety/websocketServer"
);
this
.
ws
.
onopen
=
(
evt
)
=>
{
console
.
log
(
"WebSockets开启"
);
...
...
gassafetyprogress-web/src/layout/components/Navbar.vue
View file @
2f652115
...
...
@@ -164,7 +164,7 @@ mounted(){
socket
()
{
console
.
log
(
"socket执行"
);
this
.
ws
=
new
WebSocket
(
"ws://
192.168.2.17:8903
/gassafety/websocketServer"
"ws://
222.223.203.154:8902
/gassafety/websocketServer"
);
this
.
ws
.
onopen
=
(
evt
)
=>
{
console
.
log
(
"WebSockets开启"
);
...
...
gassafetyprogress-web/src/permission.js
View file @
2f652115
import
router
from
'./router'
import
store
from
'./store'
import
{
Message
}
from
'element-ui'
import
NProgress
from
'nprogress'
import
'nprogress/nprogress.css'
import
{
getToken
}
from
'@/utils/auth'
import
router
from
"./router"
;
import
store
from
"./store"
;
import
{
Message
}
from
"element-ui"
;
import
NProgress
from
"nprogress"
;
import
"nprogress/nprogress.css"
;
import
{
getToken
}
from
"@/utils/auth"
;
NProgress
.
configure
({
showSpinner
:
false
})
NProgress
.
configure
({
showSpinner
:
false
})
;
const
whiteList
=
[
'/login'
,
'/auth-redirect'
,
'/bind'
,
'/register'
]
const
whiteList
=
[
"/login"
,
"/auth-redirect"
,
"/bind"
,
"/register"
];
// 路由前置守卫
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
NProgress
.
start
()
NProgress
.
start
();
// 如果cookie里有token
if
(
getToken
())
{
/* has token*/
if
(
to
.
path
===
'/login'
)
{
next
({
path
:
'/'
})
NProgress
.
done
()
// 如果要去login,就直接去默认页面
if
(
to
.
path
===
"/login"
)
{
next
({
path
:
"/"
});
NProgress
.
done
();
}
else
{
// 如果没有获得当前用户的所有信息
if
(
store
.
getters
.
roles
.
length
===
0
)
{
// 判断当前用户是否已拉取完user_info信息
store
.
dispatch
(
'GetInfo'
).
then
(()
=>
{
store
.
dispatch
(
'GenerateRoutes'
).
then
(
accessRoutes
=>
{
// 根据roles权限生成可访问的路由表
router
.
addRoutes
(
accessRoutes
)
// 动态添加可访问路由表
next
({
...
to
,
replace
:
true
})
// hack方法 确保addRoutes已完成
})
}).
catch
(
err
=>
{
store
.
dispatch
(
'LogOut'
).
then
(()
=>
{
Message
.
error
(
err
)
next
({
path
:
'/'
})
})
store
.
dispatch
(
"GetInfo"
)
.
then
(()
=>
{
// 生成路有树
store
.
dispatch
(
"GenerateRoutes"
).
then
((
accessRoutes
)
=>
{
// 根据roles权限生成可访问的路由表
router
.
addRoutes
(
accessRoutes
);
// 动态添加可访问路由表
next
({
...
to
,
replace
:
true
});
// hack方法 确保addRoutes已完成
});
})
.
catch
((
err
)
=>
{
store
.
dispatch
(
"LogOut"
).
then
(()
=>
{
Message
.
error
(
err
);
next
({
path
:
"/"
});
});
});
}
else
{
next
()
next
();
// // 判断各种浏览器,找到正确的方法
// function launchFullscreen(element) {
// if (element.requestFullscreen) {
// element.requestFullscreen();
// } else if (element.mozRequestFullScreen) {
// element.mozRequestFullScreen();
// } else if (element.webkitRequestFullscreen) {
// element.webkitRequestFullscreen();
// } else if (element.msRequestFullscreen) {
// element.msRequestFullscreen();
// }
// }
// launchFullscreen(document.documentElement)
}
}
}
else
{
// 没有token
if
(
whiteList
.
indexOf
(
to
.
path
)
!==
-
1
)
{
// 在免登录白名单,直接进入
next
()
next
()
;
}
else
{
next
(
`/login?redirect=
${
to
.
fullPath
}
`
)
// 否则全部重定向到登录页
NProgress
.
done
()
next
(
`/login?redirect=
${
to
.
fullPath
}
`
)
;
// 否则全部重定向到登录页
NProgress
.
done
()
;
}
}
})
})
;
router
.
afterEach
(()
=>
{
NProgress
.
done
()
})
NProgress
.
done
()
;
})
;
gassafetyprogress-web/src/store/modules/permission.js
View file @
2f652115
...
...
@@ -39,6 +39,8 @@ const permission = {
getRouters
().
then
(
res
=>
{
const
sdata
=
JSON
.
parse
(
JSON
.
stringify
(
res
.
data
))
const
rdata
=
JSON
.
parse
(
JSON
.
stringify
(
res
.
data
))
const
sidebarRoutes
=
filterAsyncRouter
(
sdata
)
const
rewriteRoutes
=
filterAsyncRouter
(
rdata
,
false
,
true
)
rewriteRoutes
.
push
({
path
:
'*'
,
redirect
:
'/404'
,
hidden
:
true
})
...
...
gassafetyprogress-web/src/utils/mapClass/yjmap.js
View file @
2f652115
...
...
@@ -735,7 +735,7 @@ export class EditorMap {
}
}
setZoomAndCenter
(
longitude
,
latitude
){
this
.
map
.
setZoomAndCenter
(
14
,
[
longitude
,
latitude
]);
this
.
map
.
setZoomAndCenter
(
14
,
[
longitude
*
1
+
0.02
,
latitude
]);
}
// 普通调用方法
// 设备报警
...
...
gassafetyprogress-web/src/views/emergency/index.vue
View file @
2f652115
...
...
@@ -938,7 +938,7 @@ export default {
}
.rightbar
{
width
:
470px
;
height
:
9
2
%
;
height
:
9
3
%
;
position
:
fixed
;
top
:
50px
;
right
:
0
;
...
...
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