Commit 6b0792a4 authored by 李纪文's avatar 李纪文

feat: 修改个人信息修改问题

parent dc11cf7b
Pipeline #41723 skipped with stages
...@@ -21,6 +21,7 @@ import { request } from '@wisdom-utils/utils'; ...@@ -21,6 +21,7 @@ import { request } from '@wisdom-utils/utils';
import { appService } from '../../api'; import { appService } from '../../api';
// eslint-disable-next-line import/named // eslint-disable-next-line import/named
import { API } from '../../api/service/base'; import { API } from '../../api/service/base';
import globalHeader from '../../locales/zh-CN/globalHeader';
import styles from './index.less'; import styles from './index.less';
// import i18n from '../../utils/share'; // import i18n from '../../utils/share';
...@@ -111,7 +112,8 @@ class AvatarDropdown extends React.Component { ...@@ -111,7 +112,8 @@ class AvatarDropdown extends React.Component {
appService.changePassword(params) appService.changePassword(params)
.then(res => { .then(res => {
if (res.success) { 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(() => { setTimeout(() => {
this.setState({ this.setState({
visible: false, visible: false,
...@@ -214,13 +216,16 @@ class AvatarDropdown extends React.Component { ...@@ -214,13 +216,16 @@ class AvatarDropdown extends React.Component {
}) })
} }
formData.append("filedata", file); formData.append("filedata", file);
request.post(action, formData, { console.log(request)
request(action, {
withCredentials, withCredentials,
headers: { headers: {
...headers, ...headers,
Accept: '*/*', Accept: '*/*',
'civ-site': '' 'civ-site': ''
}, },
method: 'post',
data: formData,
ignoreSite: true, ignoreSite: true,
onUploadProgress: ({ total, loaded }) => { onUploadProgress: ({ total, loaded }) => {
onProgress({ percent: Math.round((loaded / total) * 100).toFixed(2) }, file); onProgress({ percent: Math.round((loaded / total) * 100).toFixed(2) }, file);
...@@ -273,7 +278,8 @@ class AvatarDropdown extends React.Component { ...@@ -273,7 +278,8 @@ class AvatarDropdown extends React.Component {
appService.updateAvatar(params).then(res => { appService.updateAvatar(params).then(res => {
if(res.success) { 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({ self.setState({
currentUser: { currentUser: {
name: self.state.currentUser.name, name: self.state.currentUser.name,
...@@ -303,7 +309,7 @@ class AvatarDropdown extends React.Component { ...@@ -303,7 +309,7 @@ class AvatarDropdown extends React.Component {
const menuHeaderDropdown = ( const menuHeaderDropdown = (
<div className={styles.userInfo}> <div className={styles.userInfo}>
<div className={styles.header}> <div className={styles.header}>
<Upload className="avatar-uploader" {...uploadProps}> <Upload className="avatar-uploader" {...uploadProps} maxCount={1} itemRender={()=>(<></>)}>
<div <div
className={styles.avatar} className={styles.avatar}
style={{ backgroundImage: `url(${currentUser.avatar})` }} style={{ backgroundImage: `url(${currentUser.avatar})` }}
......
...@@ -61,7 +61,7 @@ export const initGlobalConfig = () => { ...@@ -61,7 +61,7 @@ export const initGlobalConfig = () => {
const client = params.getParams('client') const client = params.getParams('client')
appService appService
.queryConfig({ .queryConfig({
client: client, client: client || 'city',
}) })
.then(res => { .then(res => {
if (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