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
c8146d7f
Commit
c8146d7f
authored
2 years ago
by
崔佳豪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: GetUserInfo/GetEmqtConfig接口升级
parent
20cde650
Pipeline
#59091
passed with stages
Changes
10
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
67 additions
and
99 deletions
+67
-99
base.js
src/api/service/base.js
+3
-16
notification.js
src/api/service/notification.js
+1
-1
reducer.js
src/containers/App/store/reducer.js
+33
-0
AvatarDropdown.js
...youts/AppLayout/components/GlobalHeader/AvatarDropdown.js
+1
-18
index.js
src/layouts/AppLayout/notifier/api/service/index.js
+1
-1
notice.js
src/layouts/AppLayout/notifier/notice.js
+4
-4
Site.js
src/layouts/Site.js
+1
-1
index.js
src/pages/bootpage/panda/index.js
+1
-1
index.js
src/pages/cloud/introduction/newproducts/index.js
+9
-2
login.js
src/pages/user/login/login.js
+13
-55
No files found.
src/api/service/base.js
View file @
c8146d7f
...
...
@@ -19,8 +19,7 @@ export const API = {
GENERATE_TOKEN_CHANGE
:
'/cityinterface/rest/services.svc/generatetokenquick'
,
GET_WEB_SITE_CONFIG
:
'/PandaOMS/OMS/WebSite/GetWebSiteConfig'
,
// GET_WEB_SITE_CONFIG: '/CityInterface/rest/services.svc/GetWebSiteConfig',
GET_USER_INFO
:
'/CityInterface/rest/services.svc/getUserInfo'
,
GET_GATEWAY_USER_INFO
:
'/PandaCore/GCK/Basis/GetUserInfo'
,
GET_USER_INFO
:
'PandaCore/GCK/Basis/GetUserInfo'
,
GET_OA
:
'/CityInterface/rest/services/OA.svc/getLoginInfo'
,
GET_LOGS
:
'/CityInterface/rest/services/portal.svc/OMMonitor/SaveLoginInfo'
,
GET_CITY
:
...
...
@@ -36,7 +35,6 @@ export const API = {
IOT_CHANGE_PASSWORD
:
'CityInterface/rest/services/OMS.svc/U_UpdatePasswordQuickGCK'
,
FILE_DOWNLOAD
:
'/cityinterface/rest/services/filedownload.svc/download'
,
GET_VERSION
:
'/CityInterface/rest/services/OMs.svc/U_GetVersion'
,
UPDATE_AVATAR
:
'/CityInterface/rest/services/OMs.svc/U_EditUser'
,
UPLOAD_FILE_URL
:
'/cityinterface/rest/services/filedownload.svc/uploadfile/个人信息/{path}/{filename}'
,
...
...
@@ -90,10 +88,7 @@ const services = {
},
getUserInfo
:
{
url
:
()
=>
window
.
globalConfig
&&
window
.
globalConfig
.
hasGateWay
?
API
.
GET_GATEWAY_USER_INFO
:
API
.
GET_USER_INFO
,
url
:
API
.
GET_USER_INFO
,
method
:
constants
.
REQUEST_METHOD_GET
,
type
:
constants
.
REQUEST_HTTP
,
},
...
...
@@ -143,11 +138,6 @@ const services = {
method
:
constants
.
REQUEST_METHOD_GET
,
type
:
constants
.
REQUEST_HTTP
,
},
getVersion
:
{
url
:
API
.
GET_VERSION
,
method
:
constants
.
REQUEST_METHOD_GET
,
type
:
constants
.
REQUEST_HTTP
,
},
updateAvatar
:
{
url
:
API
.
UPDATE_AVATAR
,
method
:
constants
.
REQUEST_METHOD_GET
,
...
...
@@ -228,10 +218,7 @@ export const searchAutoCity = keywords => {
};
export
const
getUserInfo
=
params
=>
{
const
url
=
window
.
globalConfig
&&
window
.
globalConfig
.
hasGateWay
?
API
.
GET_GATEWAY_USER_INFO
:
API
.
GET_USER_INFO
;
const
url
=
API
.
GET_USER_INFO
;
return
request
({
url
,
method
:
constants
.
REQUEST_METHOD_GET
,
...
...
This diff is collapsed.
Click to expand it.
src/api/service/notification.js
View file @
c8146d7f
...
...
@@ -4,7 +4,7 @@ const API = {
GET_INFORMATION
:
'/PandaCore/GCK/Message/GetInformationInfo'
,
GET_MQTT_SITE_CODE
:
'/
CityInterface/rest/services/CountyProduct.svc/SCADAOper/getMqttSitecode
'
,
'/
PandaOMS/OMS/HostManager/GetEmqtConfig
'
,
GET_ALL_INFORMATION_INFO
:
'/PandaCore/GCK/Message/GetAllInformationInfo'
,
POST_INFORMATION_STATUS
:
...
...
This diff is collapsed.
Click to expand it.
src/containers/App/store/reducer.js
View file @
c8146d7f
...
...
@@ -93,6 +93,39 @@ const appReducer = (state = initialState, action) => {
action
.
data
&&
action
.
data
.
hasOwnProperty
(
'messageVoice'
)
&&
(
window
.
globalConfig
.
messageVoice
=
action
.
data
.
messageVoice
)
action
.
data
&&
action
.
data
.
hasOwnProperty
(
'topMenu'
)
&&
(
window
.
globalConfig
.
topMenu
=
action
.
data
.
topMenu
)
window
.
globalConfig
.
transformUserInfo
=
(
data
)
=>
{
return
{
City
:
data
.
city
,
DDid
:
data
.
dDid
,
Email
:
data
.
email
,
EnterprisesType
:
data
.
enterprisesType
,
GisState
:
data
.
gisState
,
Groups
:
data
.
groups
,
IP
:
data
.
ip
,
IsManager
:
data
.
isManager
,
LocalSite
:
data
.
localSite
,
Mark
:
data
.
mark
,
OID
:
data
.
oid
,
Phone
:
data
.
phone
,
Port
:
data
.
port
,
UserImge
:
data
.
userImge
,
// UserLevel: data. // 老接口有,新接口没有
// UserType: // 老接口有,新接口没有
WXid
:
data
.
wXid
,
WxImage
:
data
.
wxImage
,
WxName
:
data
.
wxName
,
cloudStationOID
:
data
.
cloudStationOID
,
depart
:
data
.
depart
,
// 嵌套里面一层的大小写也不一样
exportCAD
:
data
.
exportCAD
,
// 嵌套里面一层的大小写也不一样
extraInfo
:
data
.
extraInfo
,
fullName
:
data
.
fullName
,
loginName
:
data
.
loginName
,
roles
:
data
.
roles
,
// 嵌套里面一层的大小写也不一样
site
:
data
.
site
,
token
:
data
.
token
,
tokenexp
:
data
.
tokenexp
,
}
},
// eslint-disable-next-line no-undef
createStoreage
.
set
(
'globalConfig'
,
window
.
globalConfig
);
...
...
This diff is collapsed.
Click to expand it.
src/layouts/AppLayout/components/GlobalHeader/AvatarDropdown.js
View file @
c8146d7f
...
...
@@ -40,7 +40,6 @@ class AvatarDropdown extends React.Component {
visible
:
false
,
popVisible
:
false
,
path
:
null
,
version
:
null
,
action
:
API
.
UPLOAD_FILE_URL
,
};
}
...
...
@@ -166,22 +165,6 @@ class AvatarDropdown extends React.Component {
console
.
log
(
data
);
}
componentDidMount
()
{
appService
.
getVersion
({
ignoreSite
:
true
,
})
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
setState
({
version
:
res
.
message
,
});
}
})
.
catch
((
error
)
=>
{
message
.
error
(
useIntl
().
formatMessage
({
id
:
'component.getVersion.errorMessage'
}));
});
}
customRequest
=
({
action
,
...
...
@@ -252,7 +235,7 @@ class AvatarDropdown extends React.Component {
userID
:
props
.
config
.
get
(
'userInfo.OID'
),
loginName
:
props
.
config
.
get
(
'userInfo.loginName'
),
userName
:
props
.
config
.
get
(
'userInfo.fullName'
),
_version
:
self
.
state
.
version
,
_version
:
'9999'
,
mark
:
props
.
config
.
get
(
'userInfo.Mark'
),
phone
:
props
.
config
.
get
(
'userInfo.Phone'
),
email
:
props
.
config
.
get
(
'userInfo.Email'
),
...
...
This diff is collapsed.
Click to expand it.
src/layouts/AppLayout/notifier/api/service/index.js
View file @
c8146d7f
...
...
@@ -2,7 +2,7 @@ import { request } from '@wisdom-utils/utils';
import
*
as
constants
from
'@wisdom-utils/components/lib/AppLayout/helpers/constants'
;
const
API
=
{
GET_INFORMATION
:
'/PandaCore/GCK/Message/GetInformationInfo'
,
GET_MQTT_SITE_CODE
:
'/
CityInterface/rest/services/CountyProduct.svc/SCADAOper/getMqttSitecode
'
,
GET_MQTT_SITE_CODE
:
'/
PandaOMS/OMS/HostManager/GetEmqtConfig
'
,
POST_INFORMATION_STATUS
:
'/PandaCore/GCK/Message/PostInformationStatus'
,
POST_ADD_OPTIONS
:
'/CityInterface/rest/services/WisdomUnion.svc/CustomerManage/AddOption'
,
};
...
...
This diff is collapsed.
Click to expand it.
src/layouts/AppLayout/notifier/notice.js
View file @
c8146d7f
...
...
@@ -226,16 +226,16 @@ class Notifier {
async
getMqttSiteCode
()
{
const
self
=
this
;
return
api
.
getMqttSiteCode
({
'request.preventCache'
:
Date
.
now
()
}).
then
(
res
=>
{
if
(
res
&&
res
.
say
.
statusCode
===
ERR_OK
)
{
if
(
res
&&
res
.
code
===
0
)
{
let
mqttConfig
=
{
mqtt_mess
:
{},
mqtt_path
:
self
.
_siteConfig
.
mqtt_path
,
nginxStart
:
self
.
_siteConfig
.
NginxStart
,
mqtt_IsSSL
:
true
,
};
if
(
Array
.
isArray
(
res
.
getMe
)
&&
res
.
getMe
.
length
>
0
)
{
if
(
res
.
getMe
[
0
])
{
const
data
=
res
.
getMe
[
0
];
if
(
Array
.
isArray
(
res
.
data
)
&&
res
.
data
.
length
>
0
)
{
if
(
res
.
data
[
0
])
{
const
data
=
res
.
data
[
0
];
mqttConfig
.
mqtt_IsSSL
=
self
.
_siteConfig
.
IsSSL
=
data
.
IsSSL
?
data
.
IsSSL
:
false
;
mqttConfig
.
mqtt_mess
.
site_code
=
self
.
_siteConfig
.
site_code
=
data
.
SiteCode
||
self
.
_siteConfig
.
site_code
;
mqttConfig
.
mqtt_mess
.
TcpIP
=
self
.
_siteConfig
.
TcpIP
=
data
.
TcpIP
;
...
...
This diff is collapsed.
Click to expand it.
src/layouts/Site.js
View file @
c8146d7f
...
...
@@ -406,7 +406,7 @@ class Site {
ignoreSite
:
true
,
})
.
then
(
res
=>
{
if
(
res
&&
!
res
.
errMsg
)
{
if
(
res
&&
res
.
code
===
0
)
{
this
.
writeCookie
(
token
,
site
,
onChangeVisible
,
actionRef
);
}
else
{
message
.
warning
(
'企业切换失败,请联系管理员排查问题!'
);
...
...
This diff is collapsed.
Click to expand it.
src/pages/bootpage/panda/index.js
View file @
c8146d7f
...
...
@@ -181,7 +181,7 @@ const BootPage = props => {
ignoreSite
:
true
,
})
.
then
(
res
=>
{
const
roles
=
res
&&
!
res
.
errMsg
?
res
.
roles
:
null
;
const
roles
=
res
?.
data
?.
roles
??
[]
;
const
_hasRole
=
roles
&&
Array
.
isArray
(
roles
)
&&
roles
.
filter
(
r
=>
r
.
name
==
'客户运维管理员'
).
length
;
setHasRole
(
!!
_hasRole
);
});
...
...
This diff is collapsed.
Click to expand it.
src/pages/cloud/introduction/newproducts/index.js
View file @
c8146d7f
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
{
Carousel
,
Spin
,
notification
}
from
'antd'
;
import
{
Carousel
,
Spin
,
notification
,
message
}
from
'antd'
;
import
{
useDocumentTitle
}
from
'@ant-design/pro-utils'
;
import
{
connect
}
from
'react-redux'
;
import
{
chunk
}
from
'lodash'
;
...
...
@@ -74,12 +74,16 @@ const NewProducts = props => {
ignoreSite
:
true
,
})
.
then
(
res
=>
{
if
(
res
.
code
!==
0
)
{
setLoading
(
false
);
message
.
error
(
'获取用户信息失败'
);
}
// 重置一些环境配置
const
config
=
{
...
props
.
global
};
config
.
uiwidgets
=
[];
config
.
widgets
=
[];
config
.
allWidgets
=
[];
config
.
userInfo
=
res
;
config
.
userInfo
=
window
?.
globalConfig
?.
transformUserInfo
?.(
res
.
data
)
??
res
.
data
;
props
.
updateConfig
&&
props
.
updateConfig
(
config
);
// 默认有个上次记住的登入企业,存在印象。这里把cookie和localStorage中的都重新设置一下
...
...
@@ -95,6 +99,9 @@ const NewProducts = props => {
const
loginAction
=
new
LoginAction
({...
props
,
global
:
config
});
// props.instance && props.instance.updateConfig(config);
loginAction
&&
loginAction
.
getUserInfoAndConfig
(
''
,
true
,
'熊猫新产品'
);
}).
catch
(
err
=>
{
setLoading
(
false
);
message
.
error
(
'获取用户信息失败'
);
});
};
...
...
This diff is collapsed.
Click to expand it.
src/pages/user/login/login.js
View file @
c8146d7f
...
...
@@ -113,32 +113,8 @@ class Login {
'request.preventCache'
:
Date
.
now
(),
ignoreSite
:
true
,
}).
then
(
response
=>
{
if
(
response
&&
!
response
.
errMsg
)
{
self
.
globalConfig
.
userInfo
=
{};
if
(
response
.
hasOwnProperty
(
'data'
))
{
self
.
globalConfig
.
userInfo
=
{
// ... self.globalConfig.userInfo,
...
response
.
data
,
OID
:
response
.
data
.
OID
||
response
.
data
.
oid
,
}
}
else
{
if
(
response
.
Groups
&&
response
.
Groups
instanceof
Array
&&
response
.
Groups
.
length
)
{
self
.
globalConfig
.
userInfo
.
Groups
=
response
.
Groups
;
}
self
.
globalConfig
.
userInfo
=
Object
.
assign
(
{
OID
:
response
.
OID
||
response
.
oid
,
},
response
,
self
.
globalConfig
.
userInfo
,
);
}
if
(
response
&&
response
.
code
===
0
)
{
self
.
globalConfig
.
userInfo
=
window
?.
globalConfig
?.
transformUserInfo
?.(
response
.
data
)
??
{};
self
.
updateConfig
&&
self
.
updateConfig
(
self
.
globalConfig
);
self
.
getUserInfoAndConfig
();
...
...
@@ -249,17 +225,17 @@ class Login {
}),
])
.
then
(
results
=>
{
const
res
=
results
[
0
]
??
{};
if
(
res
&&
res
.
say
.
statusCode
===
'0000'
)
{
const
res
=
results
[
0
]
||
{};
if
(
res
&&
res
.
code
===
0
)
{
const
mqttConfig
=
{
mqtt_mess
:
{},
mqtt_path
:
DEFAULT_MQTT_PATH
,
nginxStart
:
false
,
mqtt_IsSSL
:
true
,
};
if
(
Array
.
isArray
(
res
.
getMe
)
&&
res
.
getMe
.
length
>
0
)
{
if
(
res
.
getMe
[
0
])
{
const
data
=
res
.
getMe
[
0
];
if
(
Array
.
isArray
(
res
.
data
)
&&
res
.
data
.
length
>
0
)
{
if
(
res
.
data
[
0
])
{
const
data
=
res
.
data
[
0
];
mqttConfig
.
mqtt_IsSSL
=
data
.
IsSSL
?
data
.
IsSSL
:
false
;
mqttConfig
.
mqtt_mess
.
site_code
=
data
.
SiteCode
||
self
.
globalConfig
.
userInfo
.
site
;
...
...
@@ -754,17 +730,9 @@ class Login {
// eslint-disable-next-line no-shadow
.
then
(
response
=>
{
try
{
if
(
response
&&
!
response
.
errMsg
)
{
self
.
globalConfig
.
userInfo
=
Object
.
assign
({
OID
:
response
.
OID
||
response
.
oid
,
},
response
);
if
(
response
.
hasOwnProperty
(
'data'
))
{
self
.
globalConfig
.
userInfo
=
{
// ... self.globalConfig.userInfo,
...
response
.
data
,
OID
:
response
.
data
.
OID
||
response
.
data
.
oid
,
};
}
if
(
response
&&
response
.
code
===
0
)
{
self
.
globalConfig
.
userInfo
=
window
?.
globalConfig
?.
transformUserInfo
?.(
response
.
data
)
??
{};
const
date
=
new
Date
();
date
.
setTime
(
date
.
getTime
()
+
24
*
60
*
60
*
1000
);
// date = date.toGMTString();
...
...
@@ -878,19 +846,9 @@ class Login {
)
.
then
(
response
=>
{
try
{
if
(
response
&&
!
response
.
errMsg
)
{
self
.
globalConfig
.
userInfo
=
Object
.
assign
(
{
OID
:
response
.
OID
||
response
.
oid
},
response
,
// self.globalConfig.userInfo,
);
if
(
response
.
hasOwnProperty
(
'data'
))
{
self
.
globalConfig
.
userInfo
=
{
// ... self.globalConfig.userInfo,
...
response
.
data
,
OID
:
response
.
data
.
OID
||
response
.
data
.
oid
,
}
}
if
(
response
&&
response
.
code
===
0
)
{
self
.
globalConfig
.
userInfo
=
window
?.
globalConfig
?.
transformUserInfo
?.(
response
.
data
)
??
{};
const
date
=
new
Date
();
date
.
setTime
(
date
.
getTime
()
+
24
*
60
*
60
*
1000
);
// date = date.toGMTString();
...
...
This diff is collapsed.
Click to expand it.
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