头像字段修改

master
blak-kong 2 years ago
parent 08f243e8a3
commit 12cdcc6bb6

@ -86,7 +86,7 @@ class UserInfo extends Component<any, any> {
provinceId: "", // 省份
cityId: "", // 市
areaId: "", // 县区
file: null,
headimg: null,
},
// maxDate: new Date().getTime(),
// minDate: new Date("1949-10-01").getTime(),
@ -164,7 +164,7 @@ class UserInfo extends Component<any, any> {
formData.append("areaId", form.areaId);
formData.append("birthday", userInfo.birthday);
formData.append("nickname", userInfo.nickname);
formData.appendFile("file", userInfo.headimg, "avatar.png");
formData.appendFile("headimg", userInfo.headimg, "headimg.png");
let data = formData.getData();
let res = await UpdateUser(data);
console.log("UpdateUser", res);

@ -78,7 +78,7 @@ class UserInfoDetail extends Component<any, any> {
city: this.props.userInfo.city, // 市
areaId: this.props.userInfo.areaId, // 县区
area: this.props.userInfo.area, // 县区
file: null,
headimg: null,
},
pickerCityValue: [],
// maxDate: new Date().getTime(),
@ -189,7 +189,7 @@ class UserInfoDetail extends Component<any, any> {
console.log("userInfo.headimg", userInfo.headimg);
console.log("indexOf", userInfo.headimg.indexOf("//tmp/"));
if (userInfo.headimg.indexOf("//tmp/") > -1) {
formData.appendFile("file", userInfo.headimg, "avatar.png");
formData.appendFile("headimg", userInfo.headimg, "headimg.png");
}
}
let data = formData.getData();

@ -5,8 +5,8 @@ import { createSlice } from "@reduxjs/toolkit";
const globalReducer = createSlice({
name: "global", // store的名字
initialState: {
// domain: "http://110.41.134.131:8080", // 请求地址
domain: "http://192.168.10.147:8080", // 请求地址
domain: "http://110.41.134.131:8080", // 请求地址
// domain: "http://192.168.10.147:8080", // 请求地址
token: "",
},
reducers: {

Loading…
Cancel
Save