"use strict";const e=require("../../common/vendor.js");require("../../common/libraries/request.js"),require("../../common/store/useWatermarkStore.js");const o=require("../../common/store/useWeAppAuthStore.js");require("../../common/store/useWorkStore.js");const a=require("../../common/libraries/apiLoading.js"),r=require("../../common/libraries/naviHelper.js"),s=require("./model.js"),i=require("../../gen/Apis.js"),t=require("../../common/libraries/upload.js"),l=o.useWeAppAuthStore(),n=o=>{a.getApiLoading(i.Apis.Login.Auth.ChangeAvatar,o).then(a=>{l.data.user={...l.data.user,...o},s.useModel.formData.value={...l.data.user,...o},e.index.showToast({icon:"success",title:"编辑成功！",duration:2e3}),console.log(a)})},u={init(){var e;s.useModel.formData.value=(null==(e=null==l?void 0:l.data)?void 0:e.user)||{}},handleChooseAvatar:async e=>{var o,a;if(null==(o=null==e?void 0:e.detail)?void 0:o.avatarUrl){let o=await t.avatarUpload(null==(a=null==e?void 0:e.detail)?void 0:a.avatarUrl);n({avatar:o}),console.log(o,"filePath")}console.log(e,"eeeee")},handleConfirm(e){n({name:e}),console.log(e,"eeeee")},handleLogout(){a.getApiLoading(i.Apis.Login.Auth.Logout,{}).then(e=>{l.data={user:void 0},r.showToastBack("退出成功！",1,!0),console.log(e)})}};exports.method=u;
