芝麻web文件管理V1.00
编辑当前文件:/home/paymbalq/study.tamela.org/js/about.5de7d7eb.js
"use strict";(self["webpackChunktamila"]=self["webpackChunktamila"]||[]).push([[594],{549:function(e,s,o){o.r(s),o.d(s,{default:function(){return A}});var t=o(6768),r=o(4232),a=o(5130);const i=e=>((0,t.Qi)("data-v-7f70f529"),e=e(),(0,t.jt)(),e),n={style:{width:"100vw",height:"100vh",position:"fixed",top:"0",left:"0","z-index":"99"}},l={class:"login-logo"},u=["src"],c=["src"],d={class:"container"},p={class:"user signinBx"},h={class:"imgBx"},m=["src"],f={class:"formBx"},w={action:"",onsubmit:"return false;",autocomplete:"off"},g=i((()=>(0,t.Lk)("h2",null,"Sign In",-1))),k={key:0},L=i((()=>(0,t.Lk)("p",{class:"signup"},[(0,t.eW)(" Don't have an account ? "),(0,t.Lk)("a",{href:"mailto:officialtamela@gmail.com"},"Chat with us.")],-1))),_={class:"user signupBx"},$={class:"formBx"},y={action:"",onsubmit:"return false;",autocomplete:"off",ref:"signForm"},I=i((()=>(0,t.Lk)("h2",null,"Create an account",-1))),P={class:"signup"},R={class:"imgBx"},T=["src"];function v(e,s,i,v,C,O){return(0,t.uX)(),(0,t.CE)("main",null,[(0,t.Lk)("section",n,[(0,t.Lk)("div",l,[e.$store.state.isDark?((0,t.uX)(),(0,t.CE)("img",{key:0,src:o(844),alt:""},null,8,u)):((0,t.uX)(),(0,t.CE)("img",{key:1,src:o(5843),alt:""},null,8,c))]),(0,t.Lk)("div",d,[(0,t.Lk)("div",p,[(0,t.Lk)("div",h,[(0,t.Lk)("img",{src:o(296),alt:"",style:{}},null,8,m)]),(0,t.Lk)("div",f,[(0,t.Lk)("form",w,[g,C.login_error?((0,t.uX)(),(0,t.CE)("h3",k,(0,r.v_)(C.login_error),1)):(0,t.Q3)("",!0),(0,t.bo)((0,t.Lk)("input",{type:"text",autocomplete:"off",placeholder:"Username","onUpdate:modelValue":s[0]||(s[0]=e=>C.username=e)},null,512),[[a.Jo,C.username]]),(0,t.bo)((0,t.Lk)("input",{type:"password",autocomplete:"off",placeholder:"Password","onUpdate:modelValue":s[1]||(s[1]=e=>C.password=e)},null,512),[[a.Jo,C.password]]),(0,t.Lk)("input",{type:"submit",value:"Login",onClick:s[2]||(s[2]=e=>{O.login()})}),L])])]),(0,t.Lk)("div",_,[(0,t.Lk)("div",$,[(0,t.Lk)("form",y,[I,(0,t.bo)((0,t.Lk)("input",{type:"text",autocomplete:"off",placeholder:"Username",min:"8",required:"","onUpdate:modelValue":s[3]||(s[3]=e=>C.username=e)},null,512),[[a.Jo,C.username]]),(0,t.bo)((0,t.Lk)("input",{type:"email",autocomplete:"off",placeholder:"Email Address",required:"","onUpdate:modelValue":s[4]||(s[4]=e=>C.email=e)},null,512),[[a.Jo,C.email]]),(0,t.bo)((0,t.Lk)("input",{type:"password",autocomplete:"off",placeholder:"Create Password",required:"",style:{border:"2px solid transparent"},class:(0,r.C4)({error:C.create_password&&!O.checkPasswordValid(C.create_password)}),"onUpdate:modelValue":s[5]||(s[5]=e=>C.create_password=e)},null,2),[[a.Jo,C.create_password]]),(0,t.bo)((0,t.Lk)("input",{type:"password",autocomplete:"off",placeholder:"Confirm Password",required:"",style:{border:"2px solid transparent"},class:(0,r.C4)({error:C.password2&&(!(C.create_password===C.password2)||!O.checkPasswordValid(C.create_password))}),"onUpdate:modelValue":s[6]||(s[6]=e=>C.password2=e)},null,2),[[a.Jo,C.password2]]),(0,t.Lk)("input",{type:"submit",autocomplete:"off",onClick:s[7]||(s[7]=e=>{O.signup()}),value:"Sign Up"}),(0,t.Lk)("p",P,[(0,t.eW)(" Already have an account ? "),(0,t.Lk)("a",{href:"#",onClick:s[8]||(s[8]=e=>{O.toggleForm()})},"Sign in.")])],512)]),(0,t.Lk)("div",R,[(0,t.Lk)("img",{src:o(296),alt:"",style:{"object-position":"12%"}},null,8,T)])])])])])}o(4114);var C=o(8355),O=o(4084),b={name:"LoginView",components:{},data(){return{login_error:"",username:"",email:"",password:"",create_password:"",password2:""}},mounted(){document.title="Tamela Dashboard | Login",this.$root.showLoader=!0,this.$root.is_thinking=!1,this.$root.ai_toggle=!1,this.$store.commit("resetStore"),document.querySelector(".page-wrapper").style.padding="0",this.$store.commit("setRefresh",null),this.$root.chatMessages=[{user:"model",message:"Hello, How can i be of assistance?"}],this.$root.isAuthenticated=!1,C.A.defaults.headers.common["Authorization"]="",this.$root.showLoader=!1},methods:{toggleForm(){this.username="",this.password,document.querySelector(".container").classList.toggle("active")},async login(){const e={username:this.username,password:this.password};this.username&&this.password?(this.$root.showLoader=!0,await C.A.post("api/token",e).then((e=>{const s=e.data.access,o=e.data.refresh;this.$store.commit("resetStore"),this.$store.commit("setRefresh",o),C.A.defaults.headers.common["Authorization"]="Bearer "+s,O.oR.success("Logged in Successfully",{autoClose:3e3,position:O.oR.POSITION.TOP_RIGHT}),this.$root.isAuthenticated=!0,C.A.get("accounts/userdata?user="+this.username).then((e=>{const s=e.data;if(s.status&&s.data){this.$store.commit("setUserdata",s.data);const e=s.data.usercat;console.log(e),this.$store.commit("setUsercat",e),"tamelaDoctor"===e?(this.$store.commit("setDoctorUid",this.username),this.$router.push(this.$route.query.to||"/doctor")):"admin"===e||"hospitaladmin"===e?this.$router.push(this.$route.query.to||"/"):"doctor"===e?this.$router.push(this.$route.query.to||"/models"):"data-uploader"===e?this.$router.push("/file-upload"):"ai-developer"===e?this.$router.push("/file-download"):(O.oR.error("Unauthorized user",{autoClose:3e3,position:O.oR.POSITION.TOP_RIGHT}),C.A.defaults.headers.common["Authorization"]="",this.$store.commit("resetStore"))}})).catch((e=>{console.error(e)}))})).catch((e=>{if(e.response){this.$root.showLoader=!1;for(const s in e.response.data){let o=[];o.push(`${e.response.data[s]}`),this.login_error=o[0]}O.oR.error(this.login_error,{autoClose:3e3,position:O.oR.POSITION.TOP_RIGHT})}}))):(this.login_error="Invalid username or password",O.oR.error("Username or Password cannot be left blank.",{autoClose:3e3,position:O.oR.POSITION.TOP_RIGHT}))},checkPasswordValid(e){return e.length>=8},async signup(){if(this.$refs.signForm.checkValidity())if(this.create_password===this.password2&&this.checkPasswordValid(this.create_password)){const e={username:this.username,email:this.email,password:this.create_password};this.$root.showLoader=!0,await C.A.post("accounts/user/create",e).then((e=>{const s=e.data;this.username="",this.password="",this.create_password="",this.password2="",this.$root.showLoader=!1,s.status?(O.oR.success("User Created Successfully",{autoClose:3e3,position:O.oR.POSITION.TOP_RIGHT}),this.toggleForm()):O.oR.error(s.message,{autoClose:3e3,position:O.oR.POSITION.TOP_RIGHT})})).catch((e=>{}))}else this.create_password!==this.password2?O.oR.error("Passwords must match!!",{autoClose:3e3,position:O.oR.POSITION.TOP_RIGHT}):O.oR.error("Password must be at least 8 digits long.",{autoClose:3e3,position:O.oR.POSITION.TOP_RIGHT});else this.$refs.signForm.reportValidity()}}},S=o(1241);const U=(0,S.A)(b,[["render",v],["__scopeId","data-v-7f70f529"]]);var A=U},296:function(e,s,o){e.exports=o.p+"img/10100802_4365975.8e4117bb.svg"}}]); //# sourceMappingURL=about.5de7d7eb.js.map