Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivWeb
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
ReactWeb5
CivWeb
Commits
f581cd49
Commit
f581cd49
authored
Nov 13, 2020
by
叶飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: message
parent
3084af57
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
265 additions
and
116 deletions
+265
-116
.eslintrc.js
.eslintrc.js
+2
-1
apiConfig.js
src/api/apiConfig.js
+2
-1
baseService.js
src/api/baseService.js
+17
-8
app.js
src/app.js
+2
-5
index.js
src/components/Authorized/index.js
+1
-2
AvatarDropdown.js
src/components/GlobalHeader/AvatarDropdown.js
+1
-0
NoticeIconView.js
src/components/GlobalHeader/NoticeIconView.js
+16
-18
index copy.js
src/components/Notifier/index copy.js
+0
-0
index.js
src/components/Notifier/index.js
+0
-0
mock.json
src/components/Notifier/mock.json
+176
-0
mqttws31.js
src/components/Notifier/mqttws31.js
+0
-0
index.dev.js
src/components/SlideVerify/dist/index.dev.js
+0
-1
index.js
src/components/SlideVerify/index.js
+0
-1
Categories.js
src/components/SliderPanel/Categories.js
+0
-1
index.js
src/containers/App/index.js
+5
-10
BasicLayout.js
src/layouts/BasicLayout.js
+25
-25
Site.js
src/layouts/Site.js
+0
-3
UserLayout.less
src/layouts/UserLayout.less
+4
-1
Site.dev.js
src/layouts/dist/Site.dev.js
+0
-3
micro.js
src/micro.js
+3
-1
index.js
src/pages/bootpage/index.js
+11
-22
login.dev.js
src/pages/user/login/dist/login.dev.js
+0
-5
login.js
src/pages/user/login/login.js
+0
-4
utils.dev.js
src/utils/dist/utils.dev.js
+0
-2
utils.js
src/utils/utils.js
+0
-2
No files found.
.eslintrc.js
View file @
f581cd49
...
@@ -67,7 +67,7 @@ module.exports = {
...
@@ -67,7 +67,7 @@ module.exports = {
'newline-per-chained-call'
:
0
,
'newline-per-chained-call'
:
0
,
'no-confusing-arrow'
:
0
,
'no-confusing-arrow'
:
0
,
'no-console'
:
1
,
'no-console'
:
1
,
'no-unused-vars'
:
2
,
'no-unused-vars'
:
0
,
'no-use-before-define'
:
0
,
'no-use-before-define'
:
0
,
'prefer-template'
:
2
,
'prefer-template'
:
2
,
'react/jsx-wrap-multilines'
:
0
,
'react/jsx-wrap-multilines'
:
0
,
...
@@ -96,6 +96,7 @@ module.exports = {
...
@@ -96,6 +96,7 @@ module.exports = {
'redux-saga/no-yield-in-race'
:
2
,
'redux-saga/no-yield-in-race'
:
2
,
'redux-saga/yield-effects'
:
2
,
'redux-saga/yield-effects'
:
2
,
'require-yield'
:
0
,
'require-yield'
:
0
,
},
},
settings
:
{
settings
:
{
'import/resolver'
:
{
'import/resolver'
:
{
...
...
src/api/apiConfig.js
View file @
f581cd49
...
@@ -23,7 +23,8 @@ class HttpRequest {
...
@@ -23,7 +23,8 @@ class HttpRequest {
// }
// }
// ------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------
if
(
!
config
.
ignoreSite
&&
this
.
getSite
())
{
if
(
!
config
.
ignoreSite
&&
this
.
getSite
())
{
config
.
headers
[
'civ-site'
]
=
this
.
getSite
();
// config.headers['civ-site'] = this.getSite();
config
.
headers
[
'civ-site'
]
=
"192_168_19_105_site_c8de50fc"
;
}
}
this
.
removePending
(
config
);
//在一个ajax发送前执行一下取消操作
this
.
removePending
(
config
);
//在一个ajax发送前执行一下取消操作
config
.
cancelToken
=
new
cancelToken
(
c
=>
{
config
.
cancelToken
=
new
cancelToken
(
c
=>
{
...
...
src/api/baseService.js
View file @
f581cd49
...
@@ -8,11 +8,12 @@ const API = {
...
@@ -8,11 +8,12 @@ const API = {
GET_USER_INFO
:
'/CityInterface/rest/services.svc/getUserInfo'
,
GET_USER_INFO
:
'/CityInterface/rest/services.svc/getUserInfo'
,
GET_OA
:
'/CityInterface/rest/services/OA.svc/getLoginInfo'
,
GET_OA
:
'/CityInterface/rest/services/OA.svc/getLoginInfo'
,
GET_LOGS
:
'/CityInterface/rest/services/portal.svc/OMMonitor/SaveLoginInfo'
,
GET_LOGS
:
'/CityInterface/rest/services/portal.svc/OMMonitor/SaveLoginInfo'
,
GET_INFORMATION
:
GET_INFORMATION
:
'/CityInterface/rest/services/CountyProduct.svc/SCADAOper/GetInformationInfo'
,
'/CityInterface/rest/services/CountyProduct.svc/SCADAOper/GetInformationInfo
'
,
GET_MQTT_SITE_CODE
:
'/CityInterface/rest/services/CountyProduct.svc/SCADAOper/getMqttSitecode
'
,
GET_CITY
:
'https://pv.sohu.com/cityjson?ie=utf-8'
,
GET_CITY
:
'https://pv.sohu.com/cityjson?ie=utf-8'
,
GET_ALL_GROUPS_INFO_FORUSER
:
'CityInterface/rest/Services/Portal.svc/AuthorityManage/GetAllGroupsInfoForUser'
,
GET_ALL_GROUPS_INFO_FORUSER
:
GET_WEATHER
:
'/CityInterface/rest/services/CountyProduct.svc/GetWeather'
'CityInterface/rest/Services/Portal.svc/AuthorityManage/GetAllGroupsInfoForUser'
,
GET_WEATHER
:
'/CityInterface/rest/services/CountyProduct.svc/GetWeather'
,
};
};
export
default
vm
=>
{
export
default
vm
=>
{
vm
.
getConfig
=
(
vm
.
getConfig
=
(
...
@@ -37,11 +38,19 @@ export default vm => {
...
@@ -37,11 +38,19 @@ export default vm => {
vm
.
getInformationInfo
=
(
data
=
{})
=>
vm
.
getInformationInfo
=
(
data
=
{})
=>
vm
.
get
(
API
.
GET_INFORMATION
,
data
).
then
(
res
=>
Promise
.
resolve
(
res
));
vm
.
get
(
API
.
GET_INFORMATION
,
data
).
then
(
res
=>
Promise
.
resolve
(
res
));
vm
.
getCity
=
()
=>
vm
.
get
(
API
.
GET_CITY
).
then
(
res
=>
Promise
.
resolve
(
res
))
vm
.
getMqttSiteCode
=
(
data
=
{})
=>
vm
.
get
(
API
.
GET_MQTT_SITE_CODE
,
data
).
then
(
res
=>
Promise
.
resolve
(
res
));
vm
.
ge
nerateTokenQuick
=
(
data
=
{})
=>
vm
.
get
(
API
.
GENERATE_TOKEN_CHANGE
,
data
).
then
(
res
=>
Promise
.
resolve
(
res
))
vm
.
ge
tCity
=
()
=>
vm
.
get
(
API
.
GET_CITY
).
then
(
res
=>
Promise
.
resolve
(
res
));
vm
.
getAllGroupsInfoForUser
=
(
data
=
{},
config
)
=>
vm
.
get
(
API
.
GET_ALL_GROUPS_INFO_FORUSER
,
data
,
config
).
then
(
res
=>
Promise
.
resolve
(
res
))
vm
.
generateTokenQuick
=
(
data
=
{})
=>
vm
.
get
(
API
.
GENERATE_TOKEN_CHANGE
,
data
).
then
(
res
=>
Promise
.
resolve
(
res
));
vm
.
getWeather
=
(
data
=
{})
=>
vm
.
get
(
API
.
GET_WEATHER
,
data
).
then
(
res
=>
Promise
.
resolve
(
res
))
vm
.
getAllGroupsInfoForUser
=
(
data
=
{},
config
)
=>
vm
.
get
(
API
.
GET_ALL_GROUPS_INFO_FORUSER
,
data
,
config
)
.
then
(
res
=>
Promise
.
resolve
(
res
));
vm
.
getWeather
=
(
data
=
{})
=>
vm
.
get
(
API
.
GET_WEATHER
,
data
).
then
(
res
=>
Promise
.
resolve
(
res
));
};
};
src/app.js
View file @
f581cd49
...
@@ -12,10 +12,7 @@ import ReactDOM from 'react-dom';
...
@@ -12,10 +12,7 @@ import ReactDOM from 'react-dom';
import
{
ConnectedRouter
}
from
'connected-react-router/immutable'
;
import
{
ConnectedRouter
}
from
'connected-react-router/immutable'
;
import
Immutable
from
'immutable'
;
import
Immutable
from
'immutable'
;
import
{
import
{
params
,
Storeage
}
from
'kit_utils'
;
params
,
Storeage
,
}
from
'kit_utils'
;
import
{
Provider
}
from
'react-redux'
;
import
{
Provider
}
from
'react-redux'
;
import
Http
from
'./api'
;
import
Http
from
'./api'
;
...
@@ -29,7 +26,6 @@ window.createStoreage = new Storeage('PANDA_STORE');
...
@@ -29,7 +26,6 @@ window.createStoreage = new Storeage('PANDA_STORE');
window
.
Http
=
Http
;
window
.
Http
=
Http
;
const
initialState
=
Immutable
.
Map
();
const
initialState
=
Immutable
.
Map
();
const
store
=
configureStore
(
initialState
,
history
);
const
store
=
configureStore
(
initialState
,
history
);
const
MOUNT_NODE
=
document
.
getElementById
(
'app'
);
const
MOUNT_NODE
=
document
.
getElementById
(
'app'
);
const
render
=
()
=>
{
const
render
=
()
=>
{
ReactDOM
.
render
(
ReactDOM
.
render
(
...
@@ -80,6 +76,7 @@ const initGlobalConfig = () => {
...
@@ -80,6 +76,7 @@ const initGlobalConfig = () => {
initMicroApps
();
initMicroApps
();
}
}
};
};
window
.
share
&&
window
.
share
&&
window
.
share
.
event
&&
window
.
share
.
event
&&
window
.
share
.
event
.
on
(
'triggerMicro'
,
()
=>
{
window
.
share
.
event
.
on
(
'triggerMicro'
,
()
=>
{
...
...
src/components/Authorized/index.js
View file @
f581cd49
...
@@ -8,4 +8,4 @@ Authorized.check = check;
...
@@ -8,4 +8,4 @@ Authorized.check = check;
const
RenderAuthorize
=
renderAuthorize
(
Authorized
);
const
RenderAuthorize
=
renderAuthorize
(
Authorized
);
export
default
RenderAuthorize
;
export
default
RenderAuthorize
;
\ No newline at end of file
src/components/GlobalHeader/AvatarDropdown.js
View file @
f581cd49
...
@@ -44,6 +44,7 @@ class AvatarDropdown extends React.Component {
...
@@ -44,6 +44,7 @@ class AvatarDropdown extends React.Component {
'Serati Ma'
,
'Serati Ma'
,
},
},
}
=
this
.
props
;
}
=
this
.
props
;
const
menuHeaderDropdown
=
(
const
menuHeaderDropdown
=
(
<
div
className
=
{
styles
.
userInfo
}
>
<
div
className
=
{
styles
.
userInfo
}
>
<
div
className
=
{
styles
.
header
}
>
<
div
className
=
{
styles
.
header
}
>
...
...
src/components/GlobalHeader/NoticeIconView.js
View file @
f581cd49
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
{
import
{
message
,
Tag
,
notification
}
from
'antd'
;
message
,
Tag
,
}
from
'antd'
;
import
moment
from
'moment'
;
import
moment
from
'moment'
;
import
{
connect
}
from
'react-redux'
;
import
{
connect
}
from
'react-redux'
;
import
NoticeIcon
from
'../NoticeIcon'
;
import
NoticeIcon
from
'../NoticeIcon'
;
import
styles
from
'./index.less'
;
import
styles
from
'./index.less'
;
import
Notifier
,
{
NEW_MESSAGE
}
from
'../Notifier'
;
class
NoticeIconView
extends
Component
{
class
NoticeIconView
extends
Component
{
state
=
{
state
=
{
count
:
0
,
count
:
0
,
noticeData
:
[],
noticeData
:
[],
};
};
componentDidMount
()
{
async
componentDidMount
()
{
// Http.getInformationInfo({
let
notifier
=
new
Notifier
(
this
.
props
.
global
.
userInfo
);
// userID: this.props.global.userInfo.OID,
notifier
.
subscribe
(
"NEW_MESSAGE"
,
this
.
onNewMessage
.
bind
(
this
));
// pageIndex: 1,
notifier
.
start
();
// pageSize: 10,
// 'request.preventCache': Date.now(),
// }).then(res => {
// this.setState({
// count: res.totalRcdNum,
// noticeData: res.getMe,
// });
// });
}
}
onNewMessage
=
messages
=>
{
debugger
;
this
.
setState
({
count
:
messages
.
totalCount
,
noticeData
:
messages
.
messages
})
};
/* eslint-disable no-unused-vars */
/* eslint-disable no-unused-vars */
changeReadState
=
clickedItem
=>
{};
changeReadState
=
clickedItem
=>
{};
/* eslint-disable no-unused-vars */
/* eslint-disable no-unused-vars */
handleNoticeClear
=
(
title
,
key
)
=>
{};
handleNoticeClear
=
(
title
,
key
)
=>
{};
getNoticeData
=
()
=>
{
getNoticeData
=
()
=>
{
...
@@ -86,7 +84,7 @@ class NoticeIconView extends Component {
...
@@ -86,7 +84,7 @@ class NoticeIconView extends Component {
return
(
return
(
<
NoticeIcon
<
NoticeIcon
className
=
{
styles
.
action
}
className
=
{
styles
.
action
}
count
=
{
this
.
state
.
count
}
count
=
{
this
.
state
.
count
>
99
?
99
:
this
.
state
.
count
}
onItemClick
=
{
item
=>
{
onItemClick
=
{
item
=>
{
this
.
changeReadState
(
item
);
this
.
changeReadState
(
item
);
}}
}}
...
...
src/components/Notifier/index copy.js
0 → 100644
View file @
f581cd49
This diff is collapsed.
Click to expand it.
src/components/Notifier/index.js
0 → 100644
View file @
f581cd49
This diff is collapsed.
Click to expand it.
src/components/Notifier/mock.json
0 → 100644
View file @
f581cd49
{
"currentPageIndex"
:
1
,
"getMe"
:
[
{
"CreateTime"
:
"2020/7/29 0:00:00"
,
"HisCreateTime"
:
"2020/7/29 9:44:00"
,
"HisID"
:
3676
,
"ID"
:
4341
,
"InfoContent"
:
"【阈值报警】8-B-AE1
\\
n累计电量过高
\\
n报警实时值:3130.5"
,
"InfoDist"
:
"平台弹框,公众号推送"
,
"InfoLevel"
:
"1"
,
"InfoType"
:
"SCADA报警"
,
"IsRead"
:
""
,
"MessType"
:
"通用报警"
,
"Tousers"
:
"5"
,
"UserID"
:
5
,
"app_config"
:
""
,
"app_path"
:
""
,
"web_config"
:
""
,
"web_path"
:
"product/scada/AlertMonitoring/AlertMonitoring"
},
{
"CreateTime"
:
"2020/7/29 0:00:00"
,
"HisCreateTime"
:
"2020/7/29 9:44:00"
,
"HisID"
:
3677
,
"ID"
:
4342
,
"InfoContent"
:
"【阈值报警】8-B-AE1
\\
n累计电量过高
\\
n报警实时值:3130.5"
,
"InfoDist"
:
"平台弹框,公众号推送"
,
"InfoLevel"
:
"1"
,
"InfoType"
:
"SCADA报警"
,
"IsRead"
:
""
,
"MessType"
:
"通用报警"
,
"Tousers"
:
"5"
,
"UserID"
:
5
,
"app_config"
:
""
,
"app_path"
:
""
,
"web_config"
:
""
,
"web_path"
:
"product/scada/AlertMonitoring/AlertMonitoring"
},
{
"CreateTime"
:
"2020/7/29 0:00:00"
,
"HisCreateTime"
:
"2020/7/29 9:44:00"
,
"HisID"
:
3678
,
"ID"
:
4343
,
"InfoContent"
:
"【阈值报警】8-B-AE1
\\
n累计电量过高
\\
n报警实时值:3130.5"
,
"InfoDist"
:
"平台弹框,公众号推送"
,
"InfoLevel"
:
"1"
,
"InfoType"
:
"SCADA报警"
,
"IsRead"
:
""
,
"MessType"
:
"通用报警"
,
"Tousers"
:
"5"
,
"UserID"
:
5
,
"app_config"
:
""
,
"app_path"
:
""
,
"web_config"
:
""
,
"web_path"
:
"product/scada/AlertMonitoring/AlertMonitoring"
},
{
"CreateTime"
:
"2020/7/29 0:00:00"
,
"HisCreateTime"
:
"2020/7/29 9:44:00"
,
"HisID"
:
3679
,
"ID"
:
4344
,
"InfoContent"
:
"【阈值报警】8-B-AE1
\\
n累计电量过高
\\
n报警实时值:3130.5"
,
"InfoDist"
:
"平台弹框,公众号推送"
,
"InfoLevel"
:
"1"
,
"InfoType"
:
"SCADA报警"
,
"IsRead"
:
""
,
"MessType"
:
"通用报警"
,
"Tousers"
:
"5"
,
"UserID"
:
5
,
"app_config"
:
""
,
"app_path"
:
""
,
"web_config"
:
""
,
"web_path"
:
"product/scada/AlertMonitoring/AlertMonitoring"
},
{
"CreateTime"
:
"2020/7/29 0:00:00"
,
"HisCreateTime"
:
"2020/7/29 9:44:00"
,
"HisID"
:
3680
,
"ID"
:
4345
,
"InfoContent"
:
"【阈值报警】8-B-AE1
\\
n累计电量过高
\\
n报警实时值:3130.5"
,
"InfoDist"
:
"平台弹框,公众号推送"
,
"InfoLevel"
:
"1"
,
"InfoType"
:
"SCADA报警"
,
"IsRead"
:
""
,
"MessType"
:
"通用报警"
,
"Tousers"
:
"5"
,
"UserID"
:
5
,
"app_config"
:
""
,
"app_path"
:
""
,
"web_config"
:
""
,
"web_path"
:
"product/scada/AlertMonitoring/AlertMonitoring"
},
{
"CreateTime"
:
"2020/7/29 0:00:00"
,
"HisCreateTime"
:
"2020/7/29 9:44:00"
,
"HisID"
:
3681
,
"ID"
:
4346
,
"InfoContent"
:
"【阈值报警】8-B-AE1
\\
n累计电量过高
\\
n报警实时值:3130.5"
,
"InfoDist"
:
"平台弹框,公众号推送"
,
"InfoLevel"
:
"1"
,
"InfoType"
:
"SCADA报警"
,
"IsRead"
:
""
,
"MessType"
:
"通用报警"
,
"Tousers"
:
"5"
,
"UserID"
:
5
,
"app_config"
:
""
,
"app_path"
:
""
,
"web_config"
:
""
,
"web_path"
:
"product/scada/AlertMonitoring/AlertMonitoring"
},
{
"CreateTime"
:
"2020/7/29 0:00:00"
,
"HisCreateTime"
:
"2020/7/29 9:44:00"
,
"HisID"
:
3682
,
"ID"
:
4347
,
"InfoContent"
:
"【阈值报警】8-B-AE1
\\
n累计电量过高
\\
n报警实时值:3130.5"
,
"InfoDist"
:
"平台弹框,公众号推送"
,
"InfoLevel"
:
"1"
,
"InfoType"
:
"SCADA报警"
,
"IsRead"
:
""
,
"MessType"
:
"通用报警"
,
"Tousers"
:
"5"
,
"UserID"
:
5
,
"app_config"
:
""
,
"app_path"
:
""
,
"web_config"
:
""
,
"web_path"
:
"product/scada/AlertMonitoring/AlertMonitoring"
},
{
"CreateTime"
:
"2020/7/29 0:00:00"
,
"HisCreateTime"
:
"2020/7/29 9:44:00"
,
"HisID"
:
3683
,
"ID"
:
4348
,
"InfoContent"
:
"【阈值报警】8-B-AE1
\\
n累计电量过高
\\
n报警实时值:3130.5"
,
"InfoDist"
:
"平台弹框,公众号推送"
,
"InfoLevel"
:
"1"
,
"InfoType"
:
"SCADA报警"
,
"IsRead"
:
""
,
"MessType"
:
"通用报警"
,
"Tousers"
:
"5"
,
"UserID"
:
5
,
"app_config"
:
""
,
"app_path"
:
""
,
"web_config"
:
""
,
"web_path"
:
"product/scada/AlertMonitoring/AlertMonitoring"
},
{
"CreateTime"
:
"2020/7/29 0:00:00"
,
"HisCreateTime"
:
"2020/7/29 9:44:00"
,
"HisID"
:
3684
,
"ID"
:
4349
,
"InfoContent"
:
"【阈值报警】8-B-AE1
\\
n累计电量过高
\\
n报警实时值:3130.5"
,
"InfoDist"
:
"平台弹框,公众号推送"
,
"InfoLevel"
:
"1"
,
"InfoType"
:
"SCADA报警"
,
"IsRead"
:
""
,
"MessType"
:
"通用报警"
,
"Tousers"
:
"5"
,
"UserID"
:
5
,
"app_config"
:
""
,
"app_path"
:
""
,
"web_config"
:
""
,
"web_path"
:
"product/scada/AlertMonitoring/AlertMonitoring"
}
],
"say"
:
{
"errMsg"
:
""
,
"info"
:
""
,
"statusCode"
:
"0000"
},
"totalRcdNum"
:
22
}
src/components/Notifier/mqttws31.js
0 → 100644
View file @
f581cd49
This diff is collapsed.
Click to expand it.
src/components/SlideVerify/dist/index.dev.js
View file @
f581cd49
...
@@ -27,7 +27,6 @@ function () {
...
@@ -27,7 +27,6 @@ function () {
_createClass
(
SlideVerify
,
[{
_createClass
(
SlideVerify
,
[{
key
:
"init"
,
key
:
"init"
,
value
:
function
init
()
{
value
:
function
init
()
{
debugger
;
this
.
initDOM
();
this
.
initDOM
();
this
.
initImg
();
this
.
initImg
();
this
.
bindEvents
();
this
.
bindEvents
();
...
...
src/components/SlideVerify/index.js
View file @
f581cd49
...
@@ -5,7 +5,6 @@ import styles from './index.less';
...
@@ -5,7 +5,6 @@ import styles from './index.less';
class
SlideVerify
{
class
SlideVerify
{
init
()
{
init
()
{
debugger
this
.
initDOM
()
this
.
initDOM
()
this
.
initImg
()
this
.
initImg
()
this
.
bindEvents
()
this
.
bindEvents
()
...
...
src/components/SliderPanel/Categories.js
View file @
f581cd49
...
@@ -7,7 +7,6 @@ import styles from './index.less';
...
@@ -7,7 +7,6 @@ import styles from './index.less';
const
Categories
=
(
props
)
=>
{
const
Categories
=
(
props
)
=>
{
const
[
currentIndex
,
setCurrentIndex
]
=
useState
(
0
)
const
[
currentIndex
,
setCurrentIndex
]
=
useState
(
0
)
const
selectCategories
=
(
event
,
index
)
=>
{
const
selectCategories
=
(
event
,
index
)
=>
{
debugger
event
.
preventDefault
();
event
.
preventDefault
();
event
.
stopPropagation
();
event
.
stopPropagation
();
event
.
nativeEvent
.
stopImmediatePropagation
()
event
.
nativeEvent
.
stopImmediatePropagation
()
...
...
src/containers/App/index.js
View file @
f581cd49
...
@@ -3,10 +3,7 @@ import React from 'react';
...
@@ -3,10 +3,7 @@ import React from 'react';
import
{
Helmet
}
from
'react-helmet'
;
import
{
Helmet
}
from
'react-helmet'
;
import
{
connect
}
from
'react-redux'
;
import
{
connect
}
from
'react-redux'
;
import
{
renderRoutes
}
from
'react-router-config'
;
import
{
renderRoutes
}
from
'react-router-config'
;
import
{
import
{
BrowserRouter
as
Router
,
Switch
}
from
'react-router-dom'
;
BrowserRouter
as
Router
,
Switch
,
}
from
'react-router-dom'
;
import
{
dyRoutes
}
from
'../../routes/config'
;
import
{
dyRoutes
}
from
'../../routes/config'
;
...
@@ -34,12 +31,10 @@ function App(props) {
...
@@ -34,12 +31,10 @@ function App(props) {
);
);
}
}
const
mapStateToProps
=
state
=>
{
const
mapStateToProps
=
state
=>
({
return
{
global
:
state
.
getIn
([
'global'
,
'globalConfig'
]),
global
:
state
.
getIn
([
'global'
,
'globalConfig'
]),
menu
:
state
.
getIn
([
'global'
,
'menu'
]),
menu
:
state
.
getIn
([
'global'
,
'menu'
]),
});
};
};
export
default
connect
(
export
default
connect
(
mapStateToProps
,
mapStateToProps
,
null
,
null
,
...
...
src/layouts/BasicLayout.js
View file @
f581cd49
import
React
,
{
import
React
,
{
useEffect
,
useRef
,
useState
}
from
'react'
;
useEffect
,
useRef
,
useState
,
}
from
'react'
;
import
{
Popover
}
from
'antd'
;
import
{
Popover
}
from
'antd'
;
import
{
connect
}
from
'react-redux'
;
import
{
connect
}
from
'react-redux'
;
import
{
import
{
matchRoutes
,
renderRoutes
}
from
'react-router-config'
;
matchRoutes
,
renderRoutes
,
}
from
'react-router-config'
;
import
{
useHistory
}
from
'react-router-dom'
;
import
{
useHistory
}
from
'react-router-dom'
;
import
{
MenuFoldOutlined
}
from
'@ant-design/icons'
;
import
{
MenuFoldOutlined
}
from
'@ant-design/icons'
;
...
@@ -62,26 +55,30 @@ const menuExtraRender = currentRoutes => {
...
@@ -62,26 +55,30 @@ const menuExtraRender = currentRoutes => {
toggleSystem
,
toggleSystem
,
onClose
:
()
=>
setToggleSystem
(
!
toggleSystem
),
onClose
:
()
=>
setToggleSystem
(
!
toggleSystem
),
};
};
return
;
};
};
const
renderTitle
=
(
title
,
action
)
=>
{
const
renderTitle
=
(
title
,
action
)
=>
{
console
.
log
(
styles
);
const
getCityStationsForUser
=
action
&&
action
.
getCityStationsForUser
();
const
getCityStationsForUser
=
action
&&
action
.
getCityStationsForUser
();
console
.
log
(
getCityStationsForUser
)
console
.
log
(
getCityStationsForUser
)
;
return
(
return
(
<>
<>
<
span
className
=
{
styles
[
'header-title'
]}
>
<
span
className
=
{
styles
[
'header-title'
]}
>
{
title
}
<
/span
>
{
title
}
<
/span
>
<
div
className
=
{
styles
.
cityContent
}
>
<
div
className
=
{
styles
.
cityContent
}
>
<
Popover
placement
=
"bottom"
>
<
Popover
placement
=
"bottom"
>
<
span
className
=
{
styles
.
siteName
}
>
<
span
className
=
{
styles
.
siteName
}
>
<
img
src
=
"https://panda-water.cn/web4/assets/images/depart.svg"
/>
<
img
src
=
"https://panda-water.cn/web4/assets/images/depart.svg"
alt
=
"city"
/>
<
span
>
GCK
演示
<
/span
>
<
span
>
GCK
演示
<
/span
>
<
/span
>
<
/span
>
<
/Popover
>
<
/Popover
>
<
span
className
=
{
styles
.
weatcher
}
>
<
span
className
=
{
styles
.
weather
}
>
<
img
src
=
"https://panda-water.cn/web4/assets/images/weather2/0.svg"
/>
<
img
src
=
"https://panda-water.cn/web4/assets/images/weather2/0.svg"
alt
=
"weather"
/>
<
span
>
晴
-
1
℃
/
17
℃
<
/span
>
<
span
>
晴
-
1
℃
/
17
℃
<
/span
>
<
/span
>
<
/span
>
<
/div
>
<
/div
>
...
@@ -90,9 +87,13 @@ const renderTitle = (title, action) => {
...
@@ -90,9 +87,13 @@ const renderTitle = (title, action) => {
};
};
const
BasicLayout
=
props
=>
{
const
BasicLayout
=
props
=>
{
/* eslint-disable no-unused-vars */
/* eslint-disable no-unused-vars */
const
{
children
,
settings
,
location
=
{
const
{
pathname
:
'/'
,
children
,
},}
=
props
settings
,
location
=
{
pathname
:
'/'
,
},
}
=
props
;
const
basename
=
getBaseName
();
const
basename
=
getBaseName
();
const
history
=
useHistory
();
const
history
=
useHistory
();
const
[
pathname
,
setPathname
]
=
useState
(
props
.
location
.
pathname
);
const
[
pathname
,
setPathname
]
=
useState
(
props
.
location
.
pathname
);
...
@@ -108,8 +109,8 @@ const BasicLayout = props => {
...
@@ -108,8 +109,8 @@ const BasicLayout = props => {
};
};
const
[
siteAction
,
setSiteAction
]
=
useState
(()
=>
{
const
[
siteAction
,
setSiteAction
]
=
useState
(()
=>
{
return
new
Site
(
props
)
return
new
Site
(
props
)
;
})
})
;
matchRoutes
(
props
.
route
.
routes
,
props
.
location
.
pathname
);
matchRoutes
(
props
.
route
.
routes
,
props
.
location
.
pathname
);
const
extraRender
=
menuExtraRender
(
currentRoutes
);
const
extraRender
=
menuExtraRender
(
currentRoutes
);
...
@@ -139,7 +140,7 @@ const BasicLayout = props => {
...
@@ -139,7 +140,7 @@ const BasicLayout = props => {
},
300
);
},
300
);
//
//
};
};
return
(
return
(
<
SecurityLayout
>
<
SecurityLayout
>
<
ProLayout
<
ProLayout
...
@@ -147,7 +148,6 @@ const BasicLayout = props => {
...
@@ -147,7 +148,6 @@ const BasicLayout = props => {
siderWidth
=
"145px"
siderWidth
=
"145px"
title
=
""
title
=
""
fixSiderbar
=
{
true
}
fixSiderbar
=
{
true
}
onMenuHeaderClick
=
{
event
=>
handleLogo
(
event
)}
onMenuHeaderClick
=
{
event
=>
handleLogo
(
event
)}
onCollapse
=
{
collapse
=>
handleMenuCollapse
(
collapse
)}
onCollapse
=
{
collapse
=>
handleMenuCollapse
(
collapse
)}
menuExtraRender
=
{
extraRender
.
render
}
menuExtraRender
=
{
extraRender
.
render
}
...
@@ -230,7 +230,7 @@ const BasicLayout = props => {
...
@@ -230,7 +230,7 @@ const BasicLayout = props => {
onSelect
=
{
selectKeys
=>
handleSelectedKey
(
selectKeys
)}
onSelect
=
{
selectKeys
=>
handleSelectedKey
(
selectKeys
)}
/
>
/
>
<
div
id
=
"micro-container"
className
=
"subapp-container"
ref
=
{
microApp
}
/
>
<
div
id
=
"micro-container"
className
=
"subapp-container"
ref
=
{
microApp
}
/
>
<
SettingDrawer
<
SettingDrawer
settings
=
{
props
.
settings
}
settings
=
{
props
.
settings
}
onSettingChange
=
{
config
=>
updateSettings
(
config
)}
onSettingChange
=
{
config
=>
updateSettings
(
config
)}
...
...
src/layouts/Site.js
View file @
f581cd49
...
@@ -31,7 +31,6 @@ class Site {
...
@@ -31,7 +31,6 @@ class Site {
}
}
getCityStationsForUser
()
{
getCityStationsForUser
()
{
debugger
const
loginName
=
this
.
globalConfig
.
userInfo
.
loginName
;
const
loginName
=
this
.
globalConfig
.
userInfo
.
loginName
;
const
self
=
this
;
const
self
=
this
;
Http
.
getAllGroupsInfoForUser
({
Http
.
getAllGroupsInfoForUser
({
...
@@ -40,7 +39,6 @@ class Site {
...
@@ -40,7 +39,6 @@ class Site {
},
{
},
{
ignoreSite
:
true
ignoreSite
:
true
}).
then
(
res
=>
{
}).
then
(
res
=>
{
debugger
if
(
res
&&
res
.
say
.
errMsg
===
''
&&
res
.
say
.
statusCode
===
ERR_OK
)
{
if
(
res
&&
res
.
say
.
errMsg
===
''
&&
res
.
say
.
statusCode
===
ERR_OK
)
{
const
result
=
res
.
getMe
;
const
result
=
res
.
getMe
;
let
city
=
self
.
weatherCity
;
let
city
=
self
.
weatherCity
;
...
@@ -64,7 +62,6 @@ class Site {
...
@@ -64,7 +62,6 @@ class Site {
let
allStation
=
[];
let
allStation
=
[];
let
projectStation
=
[];
let
projectStation
=
[];
debugger
if
(
self
.
globalConfig
.
Industry
)
{
if
(
self
.
globalConfig
.
Industry
)
{
allStation
=
result
.
filter
((
item
)
=>
{
allStation
=
result
.
filter
((
item
)
=>
{
...
...
src/layouts/UserLayout.less
View file @
f581cd49
...
@@ -84,7 +84,9 @@
...
@@ -84,7 +84,9 @@
// padding-left: 80px;
// padding-left: 80px;
letter-spacing: 2px;
letter-spacing: 2px;
}
}
.cityContent {
.cityContent {
.siteName {
.siteName {
padding-right: 5px;
padding-right: 5px;
display: inline;
display: inline;
...
@@ -108,7 +110,8 @@
...
@@ -108,7 +110,8 @@
margin: 0!important;
margin: 0!important;
}
}
}
}
.weatcher {
.weather {
border-left: 1px solid rgb(170, 170, 170);
border-left: 1px solid rgb(170, 170, 170);
text-shadow: none;
text-shadow: none;
color: #777;
color: #777;
...
...
src/layouts/dist/Site.dev.js
View file @
f581cd49
...
@@ -60,7 +60,6 @@ function () {
...
@@ -60,7 +60,6 @@ function () {
value
:
function
getCityStationsForUser
()
{
value
:
function
getCityStationsForUser
()
{
var
_this2
=
this
;
var
_this2
=
this
;
debugger
;
var
loginName
=
this
.
globalConfig
.
userInfo
.
loginName
;
var
loginName
=
this
.
globalConfig
.
userInfo
.
loginName
;
var
self
=
this
;
var
self
=
this
;
Http
.
getAllGroupsInfoForUser
({
Http
.
getAllGroupsInfoForUser
({
...
@@ -69,7 +68,6 @@ function () {
...
@@ -69,7 +68,6 @@ function () {
},
{
},
{
ignoreSite
:
true
ignoreSite
:
true
}).
then
(
function
(
res
)
{
}).
then
(
function
(
res
)
{
debugger
;
if
(
res
&&
res
.
say
.
errMsg
===
''
&&
res
.
say
.
statusCode
===
ERR_OK
)
{
if
(
res
&&
res
.
say
.
errMsg
===
''
&&
res
.
say
.
statusCode
===
ERR_OK
)
{
var
result
=
res
.
getMe
;
var
result
=
res
.
getMe
;
...
@@ -97,7 +95,6 @@ function () {
...
@@ -97,7 +95,6 @@ function () {
var
allStation
=
[];
var
allStation
=
[];
var
projectStation
=
[];
var
projectStation
=
[];
debugger
;
if
(
self
.
globalConfig
.
Industry
)
{
if
(
self
.
globalConfig
.
Industry
)
{
allStation
=
result
.
filter
(
function
(
item
)
{
allStation
=
result
.
filter
(
function
(
item
)
{
...
...
src/micro.js
View file @
f581cd49
...
@@ -112,7 +112,9 @@ export const initMicroApps = loader => {
...
@@ -112,7 +112,9 @@ export const initMicroApps = loader => {
url
.
indexOf
(
'map.baidu.com'
)
!==
-
1
||
url
.
indexOf
(
'map.baidu.com'
)
!==
-
1
||
url
.
indexOf
(
'pv.sohu.com'
)
!==
-
1
||
url
.
indexOf
(
'pv.sohu.com'
)
!==
-
1
||
url
.
indexOf
(
'mt0.google.cn'
)
!==
-
1
||
url
.
indexOf
(
'mt0.google.cn'
)
!==
-
1
||
url
.
indexOf
(
'mt1.google.cn'
)
!==
-
1
url
.
indexOf
(
'mt1.google.cn'
)
!==
-
1
// url.indexOf('mt2.google.cn') !== -1 ||
// url.indexOf('mt3.google.cn') !== -1
);
);
},
},
});
});
...
...
src/pages/bootpage/index.js
View file @
f581cd49
import
React
,
{
import
React
,
{
useCallback
,
useState
}
from
'react'
;
useCallback
,
useState
,
}
from
'react'
;
import
{
import
{
Space
,
Spin
}
from
'antd'
;
Space
,
Spin
,
}
from
'antd'
;
import
classNames
from
'classnames'
;
import
classNames
from
'classnames'
;
import
{
connect
}
from
'react-redux'
;
import
{
connect
}
from
'react-redux'
;
...
@@ -40,16 +34,16 @@ const BootPage = props => {
...
@@ -40,16 +34,16 @@ const BootPage = props => {
const
[
loadding
,
setLoadding
]
=
useState
(
false
);
const
[
loadding
,
setLoadding
]
=
useState
(
false
);
const
handlePage
=
useCallback
((
event
,
type
)
=>
{
const
handlePage
=
useCallback
((
event
,
type
)
=>
{
event
.
persist
();
event
.
persist
();
setLoadding
(
true
)
setLoadding
(
true
)
;
const
config
=
props
.
global
;
const
config
=
props
.
global
;
let
loginAction
=
new
LoginAction
(
props
);
let
loginAction
=
new
LoginAction
(
props
);
console
.
log
(
loginAction
)
console
.
log
(
loginAction
)
;
config
.
uiwidgets
=
[];
config
.
uiwidgets
=
[];
config
.
widgets
=
[];
config
.
widgets
=
[];
config
.
allWidgets
=
[];
config
.
allWidgets
=
[];
props
.
instance
&&
props
.
instance
.
updateConfig
(
config
);
props
.
instance
&&
props
.
instance
.
updateConfig
(
config
);
// props.instance && props.instance.getUserInfoAndConfig('', true, type);
// props.instance && props.instance.getUserInfoAndConfig('', true, type);
loginAction
.
getUserInfoAndConfig
(
''
,
true
,
type
)
loginAction
.
getUserInfoAndConfig
(
''
,
true
,
type
)
;
loginAction
.
events
.
on
(
'toggleIndustry'
,
event
=>
{
loginAction
.
events
.
on
(
'toggleIndustry'
,
event
=>
{
setLoadding
(
false
);
setLoadding
(
false
);
...
@@ -63,9 +57,7 @@ const BootPage = props => {
...
@@ -63,9 +57,7 @@ const BootPage = props => {
<
div
className
=
{
styles
.
bootPage
}
>
<
div
className
=
{
styles
.
bootPage
}
>
<
div
className
=
{
styles
.
bootPageMain
}
>
<
div
className
=
{
styles
.
bootPageMain
}
>
<
header
className
=
{
styles
.
bootPageHead
}
>
<
header
className
=
{
styles
.
bootPageHead
}
>
<
img
<
img
src
=
"https://panda-water.cn/web4/assets/images/bootPage/熊猫图标.png"
/>
src
=
{
`https://panda-water.cn/web4/assets/images/bootPage/熊猫图标.png`
}
/
>
<
div
className
=
{
styles
.
bootPageTitle
}
>
<
div
className
=
{
styles
.
bootPageTitle
}
>
<
span
className
=
{
styles
.
bootPageZh
}
>
<
span
className
=
{
styles
.
bootPageZh
}
>
熊猫智慧城市监控管理解决方案
熊猫智慧城市监控管理解决方案
...
@@ -95,20 +87,17 @@ const BootPage = props => {
...
@@ -95,20 +87,17 @@ const BootPage = props => {
<
/ul
>
<
/ul
>
<
/section
>
<
/section
>
<
Space
className
=
{
styles
.
abs
}
>
<
Space
className
=
{
styles
.
abs
}
>
<
Spin
spinning
=
{
loadding
}
size
=
"large"
/>
<
Spin
spinning
=
{
loadding
}
size
=
"large"
/>
<
/Space
>
<
/Space
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/SecurityLayout
>
<
/SecurityLayout
>
);
);
};
};
const
mapStateToProps
=
state
=>
{
const
mapStateToProps
=
state
=>
({
return
{
global
:
state
.
getIn
([
'global'
,
'globalConfig'
]),
global
:
state
.
getIn
([
'global'
,
'globalConfig'
]),
instance
:
state
.
getIn
([
'global'
,
'instance'
]),
instance
:
state
.
getIn
([
'global'
,
'instance'
]),
});
};
};
const
mapDispatchToProps
=
dispatch
=>
{
const
mapDispatchToProps
=
dispatch
=>
{
return
{
return
{
updateConfig
(
config
)
{
updateConfig
(
config
)
{
...
...
src/pages/user/login/dist/login.dev.js
View file @
f581cd49
...
@@ -122,7 +122,6 @@ function () {
...
@@ -122,7 +122,6 @@ function () {
token
:
token
,
token
:
token
,
'request.preventCache'
:
Date
.
now
()
'request.preventCache'
:
Date
.
now
()
}).
then
(
function
(
response
)
{
}).
then
(
function
(
response
)
{
debugger
;
if
(
response
&&
response
.
length
>
0
)
{
if
(
response
&&
response
.
length
>
0
)
{
_this4
.
globalConfig
=
Object
.
assign
(
_this4
.
globalConfig
,
response
.
shift
(),
{
_this4
.
globalConfig
=
Object
.
assign
(
_this4
.
globalConfig
,
response
.
shift
(),
{
...
@@ -154,7 +153,6 @@ function () {
...
@@ -154,7 +153,6 @@ function () {
token
:
token
,
token
:
token
,
'request.preventCache'
:
Date
.
now
()
'request.preventCache'
:
Date
.
now
()
}).
then
(
function
(
response
)
{
}).
then
(
function
(
response
)
{
debugger
;
if
(
response
&&
response
.
length
>
0
)
{
if
(
response
&&
response
.
length
>
0
)
{
var
mainConf
=
response
.
shift
();
var
mainConf
=
response
.
shift
();
...
@@ -275,7 +273,6 @@ function () {
...
@@ -275,7 +273,6 @@ function () {
},
{
},
{
key
:
"goLogin"
,
key
:
"goLogin"
,
value
:
function
goLogin
()
{
value
:
function
goLogin
()
{
debugger
;
if
(
this
.
globalConfig
.
style
===
'ios'
&&
this
.
globalConfig
.
loginTemplate
===
'IOSCloud.html'
)
{
if
(
this
.
globalConfig
.
style
===
'ios'
&&
this
.
globalConfig
.
loginTemplate
===
'IOSCloud.html'
)
{
window
.
location
.
href
=
window
.
location
.
origin
+
'/#login'
;
window
.
location
.
href
=
window
.
location
.
origin
+
'/#login'
;
...
@@ -571,8 +568,6 @@ function () {
...
@@ -571,8 +568,6 @@ function () {
value
:
function
loginHandler
(
user
,
pwd
,
userPhone
,
isRememberPWD
,
ref
)
{
value
:
function
loginHandler
(
user
,
pwd
,
userPhone
,
isRememberPWD
,
ref
)
{
var
_this9
=
this
;
var
_this9
=
this
;
debugger
;
if
(
user
&&
pwd
)
{
if
(
user
&&
pwd
)
{
if
(
this
.
loginFailed
&&
this
.
captchaObj
)
{
if
(
this
.
loginFailed
&&
this
.
captchaObj
)
{
this
.
captchaObj
.
verify
();
this
.
captchaObj
.
verify
();
...
...
src/pages/user/login/login.js
View file @
f581cd49
...
@@ -110,7 +110,6 @@ class Login {
...
@@ -110,7 +110,6 @@ class Login {
'request.preventCache'
:
Date
.
now
(),
'request.preventCache'
:
Date
.
now
(),
})
})
.
then
(
response
=>
{
.
then
(
response
=>
{
debugger
;
if
(
response
&&
response
.
length
>
0
)
{
if
(
response
&&
response
.
length
>
0
)
{
this
.
globalConfig
=
Object
.
assign
(
this
.
globalConfig
=
Object
.
assign
(
this
.
globalConfig
,
this
.
globalConfig
,
...
@@ -148,7 +147,6 @@ class Login {
...
@@ -148,7 +147,6 @@ class Login {
token
:
token
,
token
:
token
,
'request.preventCache'
:
Date
.
now
(),
'request.preventCache'
:
Date
.
now
(),
}).
then
(
response
=>
{
}).
then
(
response
=>
{
debugger
;
if
(
response
&&
response
.
length
>
0
)
{
if
(
response
&&
response
.
length
>
0
)
{
var
mainConf
=
response
.
shift
();
var
mainConf
=
response
.
shift
();
if
(
mainConf
.
homepage
)
if
(
mainConf
.
homepage
)
...
@@ -273,7 +271,6 @@ class Login {
...
@@ -273,7 +271,6 @@ class Login {
}
}
goLogin
()
{
goLogin
()
{
debugger
;
if
(
if
(
this
.
globalConfig
.
style
===
'ios'
&&
this
.
globalConfig
.
style
===
'ios'
&&
this
.
globalConfig
.
loginTemplate
===
'IOSCloud.html'
this
.
globalConfig
.
loginTemplate
===
'IOSCloud.html'
...
@@ -550,7 +547,6 @@ class Login {
...
@@ -550,7 +547,6 @@ class Login {
}
}
loginHandler
(
user
,
pwd
,
userPhone
,
isRememberPWD
,
ref
)
{
loginHandler
(
user
,
pwd
,
userPhone
,
isRememberPWD
,
ref
)
{
debugger
if
(
user
&&
pwd
)
{
if
(
user
&&
pwd
)
{
if
(
this
.
loginFailed
&&
this
.
captchaObj
)
{
if
(
this
.
loginFailed
&&
this
.
captchaObj
)
{
this
.
captchaObj
.
verify
()
this
.
captchaObj
.
verify
()
...
...
src/utils/dist/utils.dev.js
View file @
f581cd49
...
@@ -33,7 +33,6 @@ var getPageQuery = function getPageQuery() {
...
@@ -33,7 +33,6 @@ var getPageQuery = function getPageQuery() {
exports
.
getPageQuery
=
getPageQuery
;
exports
.
getPageQuery
=
getPageQuery
;
var
getAuthorityFromRouter
=
function
getAuthorityFromRouter
(
router
,
pathname
)
{
var
getAuthorityFromRouter
=
function
getAuthorityFromRouter
(
router
,
pathname
)
{
debugger
;
var
authority
=
router
.
find
(
function
(
_ref
)
{
var
authority
=
router
.
find
(
function
(
_ref
)
{
var
routes
=
_ref
.
routes
,
var
routes
=
_ref
.
routes
,
_ref$path
=
_ref
.
path
,
_ref$path
=
_ref
.
path
,
...
@@ -49,7 +48,6 @@ var getAuthorityFromRouter = function getAuthorityFromRouter(router, pathname) {
...
@@ -49,7 +48,6 @@ var getAuthorityFromRouter = function getAuthorityFromRouter(router, pathname) {
exports
.
getAuthorityFromRouter
=
getAuthorityFromRouter
;
exports
.
getAuthorityFromRouter
=
getAuthorityFromRouter
;
var
getRouteAuthority
=
function
getRouteAuthority
(
path
,
routeData
)
{
var
getRouteAuthority
=
function
getRouteAuthority
(
path
,
routeData
)
{
debugger
;
var
authorities
;
var
authorities
;
routeData
.
forEach
(
function
(
route
)
{
routeData
.
forEach
(
function
(
route
)
{
if
((
0
,
_pathToRegexp
[
"default"
])(
""
.
concat
(
route
.
path
,
"/(.*)"
)).
test
(
""
.
concat
(
path
,
"/"
)))
{
if
((
0
,
_pathToRegexp
[
"default"
])(
""
.
concat
(
route
.
path
,
"/(.*)"
)).
test
(
""
.
concat
(
path
,
"/"
)))
{
...
...
src/utils/utils.js
View file @
f581cd49
...
@@ -11,7 +11,6 @@ export const isUrl = path => reg.test(path);
...
@@ -11,7 +11,6 @@ export const isUrl = path => reg.test(path);
export
const
getPageQuery
=
()
=>
parse
(
window
.
location
.
href
.
split
(
'?'
)[
1
]);
export
const
getPageQuery
=
()
=>
parse
(
window
.
location
.
href
.
split
(
'?'
)[
1
]);
export
const
getAuthorityFromRouter
=
(
router
,
pathname
)
=>
{
export
const
getAuthorityFromRouter
=
(
router
,
pathname
)
=>
{
debugger
;
const
authority
=
router
.
find
(
const
authority
=
router
.
find
(
({
routes
,
path
=
'/'
,
target
=
'_self'
})
=>
({
routes
,
path
=
'/'
,
target
=
'_self'
})
=>
(
path
&&
target
!==
'_blank'
&&
pathRegexp
(
path
).
exec
(
pathname
))
||
(
path
&&
target
!==
'_blank'
&&
pathRegexp
(
path
).
exec
(
pathname
))
||
...
@@ -22,7 +21,6 @@ export const getAuthorityFromRouter = (router, pathname) => {
...
@@ -22,7 +21,6 @@ export const getAuthorityFromRouter = (router, pathname) => {
};
};
export
const
getRouteAuthority
=
(
path
,
routeData
)
=>
{
export
const
getRouteAuthority
=
(
path
,
routeData
)
=>
{
debugger
;
let
authorities
;
let
authorities
;
routeData
.
forEach
(
route
=>
{
routeData
.
forEach
(
route
=>
{
if
(
pathRegexp
(
`
${
route
.
path
}
/(.*)`
).
test
(
`
${
path
}
/`
))
{
if
(
pathRegexp
(
`
${
route
.
path
}
/(.*)`
).
test
(
`
${
path
}
/`
))
{
...
...
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