niucloud-admin/niucloud/public/admin/assets/personal-c8bef0fe.js
全栈小学生 26524c4bf5 update admin
2023-08-12 16:21:13 +08:00

2 lines
5.8 KiB
JavaScript

import{d as E,R as x,r as f,Q as U,e as I,f as P,y as a,x as s,g as _,u as e,B as w,A as N}from"./base-04829be5.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{_ as C}from"./index-c1ab0e3c.js";import{t}from"./index-043d021e.js";import{c as g}from"./index-faea7bd5.js";/* empty css */import{a as B,E as F}from"./index-6bd50bb5.js";import{E as k}from"./index-db9b8d96.js";import{E as R}from"./index-88566e4e.js";import{E as H}from"./index-eb678249.js";import{v as D}from"./directive-013f0a4e.js";import{E as S}from"./index-b649d1d3.js";import{_ as T}from"./_plugin-vue_export-helper-c27b6911.js";/* empty css */import"./index.vue_vue_type_style_index_0_lang-f0796d29.js";/* empty css */import"./attachment-9a932beb.js";import"./index-30df2c14.js";import"./index-7e933ae4.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css *//* empty css *//* empty css */import"./index-92283b18.js";import"./typescript-defaf979.js";import"./index-a2524300.js";import"./index-bdd39755.js";import"./index-94a82d50.js";import"./index-de053f2e.js";import"./focus-trap-be36cfe9.js";import"./index-bf8db610.js";import"./index-e9e16697.js";import"./error-78e43d3e.js";import"./index-1d455165.js";import"./index-b1557f8a.js";import"./index-9a9de0a3.js";import"./scroll-e5463626.js";import"./vnode-85ccdc7f.js";import"./event-9519ab40.js";import"./index-4edf2cad.js";import"./index.vue_vue_type_script_setup_true_lang-df8a984f.js";/* empty css */import"./sys-f9859bed.js";import"./storage-1a3ddb14.js";import"./index-d60f63e2.js";import"./aria-adfa05c5.js";import"./validator-6838b9a3.js";import"./index-760fce0d.js";import"./index-cbf0aee7.js";import"./index-c4af56cf.js";import"./index-ed22fe56.js";import"./debounce-f064e94e.js";import"./position-b298e95e.js";import"./index-91afef8c.js";import"./index-c3b3b83a.js";import"./index-d7f4b4bb.js";import"./isEqual-ba353d68.js";import"./_Uint8Array-99b916e9.js";import"./flatten-94587e2b.js";import"./index-1808e3f9.js";import"./index-02bf3820.js";import"./index-bf9de702.js";import"./strings-4ec3ae35.js";import"./index-b519934c.js";import"./common-111e3797.js";import"./common-2cf17469.js";import"./vue-router-fee568b2.js";import"./index-236cb599.js";import"./castArray-11aea762.js";import"./_initCloneObject-e5a1aa13.js";function q(u){return g.get("auth/get")}function A(u){return g.put("auth/edit",u,{showSuccessMessage:!0})}const L={class:"main-container attachment-container"},M={class:"form-tip"},Q={class:"fixed-footer-wrap"},$={class:"fixed-footer"},j=E({__name:"personal",setup(u){let o=x({head_img:"",real_name:"",original_password:"",password:"",password_copy:"",username:""});const c=f(),p=f(!0);(()=>{p.value=!0,q().then(d=>{p.value=!1;let r=d.data;o.head_img=r.head_img,o.real_name=r.real_name,o.original_password=r.original_password,o.password=r.password,o.password_copy=r.password,o.username=r.username}).catch(()=>{p.value=!1})})();const h=d=>{p.value||!d||d.validate(r=>{if(r){let m="";if(o.password&&!o.original_password&&(m=t("originalPasswordHint")),o.password&&o.original_password&&!o.password_copy&&(m=t("newPasswordHint")),o.password&&o.original_password&&o.password_copy&&o.password!=o.password_copy&&(m=t("doubleCipherHint")),m){S({type:"error",message:m});return}p.value=!0,A(o).then(i=>{p.value=!1}).catch(i=>{p.value=!1})}else return!1})};return(d,r)=>{const m=C,i=B,n=k,v=F,b=R,y=H,V=D;return U((I(),P("div",L,[a(b,{class:"box-card !border-none",shadow:"never"},{default:s(()=>[a(v,{model:e(o),"label-width":"90px",ref_key:"formRef",ref:c,rules:d.formRules,class:"page-form"},{default:s(()=>[a(i,{label:e(t)("headImg")},{default:s(()=>[a(m,{modelValue:e(o).head_img,"onUpdate:modelValue":r[0]||(r[0]=l=>e(o).head_img=l),limit:1},null,8,["modelValue"])]),_:1},8,["label"]),a(i,{label:e(t)("userName")},{default:s(()=>[a(n,{modelValue:e(o).username,"onUpdate:modelValue":r[1]||(r[1]=l=>e(o).username=l),clearable:"",class:"input-width",readonly:!0},null,8,["modelValue"])]),_:1},8,["label"]),a(i,{label:e(t)("realName")},{default:s(()=>[a(n,{modelValue:e(o).real_name,"onUpdate:modelValue":r[2]||(r[2]=l=>e(o).real_name=l),placeholder:e(t)("realNamePlaceholder"),clearable:"",class:"input-width"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),a(i,{label:e(t)("originalPassword")},{default:s(()=>[a(n,{modelValue:e(o).original_password,"onUpdate:modelValue":r[3]||(r[3]=l=>e(o).original_password=l),type:"password",placeholder:e(t)("originalPasswordPlaceholder"),clearable:"",class:"input-width"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),a(i,{label:e(t)("password")},{default:s(()=>[a(n,{modelValue:e(o).password,"onUpdate:modelValue":r[4]||(r[4]=l=>e(o).password=l),type:"password",placeholder:e(t)("passwordPlaceholder"),clearable:"",class:"input-width"},null,8,["modelValue","placeholder"]),_("div",M,w(e(t)("passwordTip")),1)]),_:1},8,["label"]),a(i,{label:e(t)("passwordCopy")},{default:s(()=>[a(n,{modelValue:e(o).password_copy,"onUpdate:modelValue":r[5]||(r[5]=l=>e(o).password_copy=l),type:"password",placeholder:e(t)("passwordPlaceholder"),clearable:"",class:"input-width"},null,8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["model","rules"])]),_:1}),_("div",Q,[_("div",$,[a(y,{type:"primary",onClick:r[6]||(r[6]=l=>h(c.value))},{default:s(()=>[N(w(e(t)("save")),1)]),_:1})])])])),[[V,p.value]])}}});const Ve=T(j,[["__scopeId","data-v-e350add2"]]);export{Ve as default};