Commit e8786b52 authored by 邓晓峰's avatar 邓晓峰
parents 4457fd4a f394c07a
Pipeline #41777 passed with stages
in 4 minutes 11 seconds
......@@ -21,6 +21,7 @@ import { request } from '@wisdom-utils/utils';
import { appService } from '../../api';
// eslint-disable-next-line import/named
import { API } from '../../api/service/base';
import globalHeader from '../../locales/zh-CN/globalHeader';
import styles from './index.less';
// import i18n from '../../utils/share';
......@@ -111,7 +112,8 @@ class AvatarDropdown extends React.Component {
appService.changePassword(params)
.then(res => {
if (res.success) {
message.success(useIntl().formatMessage({id: 'component.account.password.update.success'}));
//message.success(useIntl().formatMessage({id: 'component.account.password.update.success'}));
message.success(globalHeader['component.account.password.update.success']);
setTimeout(() => {
this.setState({
visible: false,
......@@ -214,13 +216,15 @@ class AvatarDropdown extends React.Component {
})
}
formData.append("filedata", file);
request.post(action, formData, {
request(action, {
withCredentials,
headers: {
...headers,
Accept: '*/*',
'civ-site': ''
},
method: 'post',
data: formData,
ignoreSite: true,
onUploadProgress: ({ total, loaded }) => {
onProgress({ percent: Math.round((loaded / total) * 100).toFixed(2) }, file);
......@@ -273,7 +277,8 @@ class AvatarDropdown extends React.Component {
appService.updateAvatar(params).then(res => {
if(res.success) {
message.success(useIntl().formatMessage({id: 'component.avatar.update.success'}));
// message.success(useIntl().formatMessage({id: 'component.avatar.update.success'}));
message.success(globalHeader['component.avatar.update.success']);
self.setState({
currentUser: {
name: self.state.currentUser.name,
......@@ -303,7 +308,7 @@ class AvatarDropdown extends React.Component {
const menuHeaderDropdown = (
<div className={styles.userInfo}>
<div className={styles.header}>
<Upload className="avatar-uploader" {...uploadProps}>
<Upload className="avatar-uploader" {...uploadProps} maxCount={1} itemRender={()=>(<></>)}>
<div
className={styles.avatar}
style={{ backgroundImage: `url(${currentUser.avatar})` }}
......
......@@ -62,7 +62,7 @@ export const initGlobalConfig = () => {
const client = params.getParams('client')
appService
.queryConfig({
client: client,
client: client || 'city',
})
.then(res => {
if (res) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment