2 lines
6.5 KiB
JavaScript
2 lines
6.5 KiB
JavaScript
|
import{_ as e,u as t,s,z as a,G as l,q as o,o as n,c as i,w as c,j as d,g as u,i as r,t as m,h as f,K as h,f as g,d as p,F as _,r as w,k as C,N as b,A as x}from"./index-22d2df30.js";const k=t(s);const I=e({data:()=>({userInfo:k.userInfo,globalConfig:k.globalConfig,modelName:"",code:"",account:"",newCode:"",password:"",originalPassword:"",repass:"",loading:!1,editPass:!1}),onShow(){},methods:{logout(){let e=a("client_id");this.$api.LoginApi.logout({client_id:e}).then((e=>{0==e.code&&k.logout()}))},editAcc(){if(!this.userInfo.is_auth)return l({title:"请先认证账户!",icon:"none"}),!1;this.modelName="show",this.editPass=!1},openWeb(e){o({url:"/pages/mine/webview?src=https://im.raingad.com"})},save(){if(""==this.code&&this.userInfo.is_auth)return l({title:"请输入验证码",icon:"none"}),!1;if(this.editPass){if(""==this.password||this.password.length<6||this.password.length>16)return l({title:"请输入6-16个字符串的密码",icon:"none"}),!1;if(this.password!=this.repass)return l({title:"两次密码不一致",icon:"none"}),!1;let e={password:this.password,code:this.code,originalPassword:this.originalPassword};this.$api.msgApi.editPassword(e).then((e=>{0==e.code&&(this.modelName="",this.password="",this.repass="",l({title:e.msg,icon:"none"}))}))}else{if(""==this.account)return l({title:"请输入新的账号",icon:"none"}),!1;if(""==this.newCode)return l({title:"请输入新账号的验证码",icon:"none"}),!1;let e={account:this.account,code:this.code,newCode:this.newCode};this.$api.msgApi.editAccount(e).then((e=>{0==e.code&&(this.modelName="",this.account="",this.code="",this.newCode="",l({title:"修改成功,请重新登陆",icon:"none"}))}))}},sendCode(e){let t=e?this.userInfo.account:this.account,s=this.editPass?3:4;if(""==t)return l({title:"请输入新的账号",icon:"none"}),!1;this.loading=!0,this.$api.LoginApi.sendCode({account:t,type:s}).then((e=>{l({title:e.msg,icon:"none"}),this.loading=!1}))}}},[["render",function(e,t,s,a,l,o){const k=w("cu-custom"),I=C,V=d,y=b,P=x;return n(),i(V,null,{default:c((()=>[u(k,{bgColor:"bg-gradual-green",isBack:!0},{backText:c((()=>[])),content:c((()=>[r("账号安全")])),_:1}),u(V,{class:"cu-list menu mt-10"},{default:c((()=>[u(V,{class:"cu-item",onClick:o.editAcc},{default:c((()=>[u(V,{class:"content"},{default:c((()=>[u(I,{class:"cuIcon-settings text-grey"}),u(I,null,{default:c((()=>[r("我的账号")])),_:1})])),_:1}),u(V,{class:"action"},{default:c((()=>[u(I,null,{default:c((()=>[r(m(l.userInfo.account),1)])),_:1}),u(I,{class:"text-grey cuIcon-right"})])),_:1})])),_:1},8,["onClick"]),u(V,{class:"cu-item",onClick:t[0]||(t[0]=e=>{l.modelName="show",l.editPass=!0})},{default:c((()=>[u(V,{class:"content"},{default:c((()=>[u(I,{class:"cuIcon-lock text-green"}),u(I,null,{default:c((()=>[r("修改密码")])),_:1})])),_:1}),u(V,{class:"action"},{default:c((()=>[u(I,{class:"text-grey cuIcon-right"})])),_:1})])),_:1}),l.userInfo.is_auth?f("",!0):(n(),i(V,{key:0,class:"cu-item",onClick:t[1]||(t[1]=e=>{l.modelName="show",l.editPass=!1})},{default:c((()=>[u(V,{class:"content padding-tb-sm"},{default:c((()=>[u(V,null,{default:c((()=>[u(I,{class:"cuIcon-vip text-orange ml-5"}),r(),u(I,{class:"ml-10"},{default:c((()=>[r("认证账户")])),_:1})])),_:1}),u(V,{class:"text-gray text-sm"},{default:c((()=>[u(I,{class:"cuIcon-infofill ml-5 mr-10"}),r(" 验证账户的真实性,绑定后请使用新账户来登录!")])),_:1})])),_:1}),u(V,{class:"action"},{default:c((()=>[u(I,{class:"text-grey cuIcon-right"})])),_:1})])),_:1}))])),_:1}),u(V,{class:g(["cu-modal bottom-modal","show"==l.modelName?"show":""]),onClick:t[12]||(t[12]=e=>l.modelName="")},{default:c((()=>[u(V,{class:"cu-dialog",onClick:t[11]||(t[11]=h((()=>{}),["stop"]))},{default:c((()=>[u(V,{class:"cu-bar bg-white"},{default:c((()=>[u(V,{class:"action text-gray",onClick:t[2]||(t[2]=e=>l.modelName="")},{default:c((()=>[r("取消")])),_:1}),u(V,{class:"action text-green",onClick:o.save},{default:c((()=>[r("保存")])),_:1},8,["onClick"])])),_:1}),u(V,{class:"manage-content mb-20"},{default:c((()=>[u(V,{class:"cu-list menu
|