上传头像
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const components_request = require("../../components/request.js");
|
||||
const components_postFile = require("../../components/postFile.js");
|
||||
const components_generateFileName = require("../../components/generateFileName.js");
|
||||
const _sfc_main = {
|
||||
inject: ["$global"],
|
||||
data() {
|
||||
@@ -46,39 +48,47 @@ const _sfc_main = {
|
||||
provider: "weixin",
|
||||
onlyAuthorize: true
|
||||
});
|
||||
common_vendor.index.__f__("log", "at pages/UserInformation/UserInformation.vue:67", "code", code);
|
||||
common_vendor.index.__f__("log", "at pages/UserInformation/UserInformation.vue:68", "code", this.name);
|
||||
common_vendor.index.__f__("log", "at pages/UserInformation/UserInformation.vue:69", "code", this.userinfo);
|
||||
common_vendor.index.__f__("log", "at pages/UserInformation/UserInformation.vue:70", "code", this.id);
|
||||
common_vendor.index.__f__("log", "at pages/UserInformation/UserInformation.vue:71", "code", this.userSig);
|
||||
const res = await components_request.request({
|
||||
url: "user/inputUserInfo",
|
||||
method: "POST",
|
||||
data: {
|
||||
id: this.id,
|
||||
headerIcon: this.userinfo,
|
||||
nickName: this.name,
|
||||
code,
|
||||
usersig: this.userSig
|
||||
},
|
||||
userInfo: false
|
||||
components_postFile.uploadFile({
|
||||
path: this.userinfo,
|
||||
name: components_generateFileName.generateFileName()
|
||||
}).then((res) => {
|
||||
this.userinfo = res;
|
||||
}).catch((err) => {
|
||||
common_vendor.index.__f__("log", "at pages/UserInformation/UserInformation.vue:76", err);
|
||||
});
|
||||
common_vendor.index.__f__("log", "at pages/UserInformation/UserInformation.vue:84", "res", res);
|
||||
if (res.code === 200) {
|
||||
common_vendor.index.showToast({
|
||||
title: "登录成功",
|
||||
icon: "success"
|
||||
});
|
||||
common_vendor.index.__f__("log", "at pages/UserInformation/UserInformation.vue:90", "登录成功", res.data);
|
||||
common_vendor.index.setStorageSync("userinfo", res.data.info);
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.reLaunch({
|
||||
url: this.$global.lastPage || "/pages/Home/Home"
|
||||
// 默认页
|
||||
if (this.userinfo) {
|
||||
const res = await components_request.request({
|
||||
url: "user/inputUserInfo",
|
||||
method: "POST",
|
||||
data: {
|
||||
id: this.id,
|
||||
headerIcon: this.userinfo,
|
||||
nickName: this.name,
|
||||
code,
|
||||
usersig: this.userSig.userSig
|
||||
},
|
||||
userInfo: false
|
||||
});
|
||||
if (res.code === 200) {
|
||||
common_vendor.index.showToast({
|
||||
title: "登录成功",
|
||||
icon: "success"
|
||||
});
|
||||
common_vendor.index.setStorageSync("userinfo", res.data.info);
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.reLaunch({
|
||||
url: this.$global.lastPage || "/pages/Home/Home"
|
||||
// 默认页
|
||||
});
|
||||
} else {
|
||||
common_vendor.index.showToast({
|
||||
title: "登录失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
} else {
|
||||
common_vendor.index.showToast({
|
||||
title: "登录失败",
|
||||
title: "上传失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user