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

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

parent dc11cf7b
Pipeline #41723 skipped with stages
......@@ -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,16 @@ class AvatarDropdown extends React.Component {
})
}
formData.append("filedata", file);
request.post(action, formData, {
console.log(request)
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 +278,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 +309,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})` }}
......
......@@ -61,7 +61,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