Auth-DB6oxZS-.js 3.8 KB

1
  1. import{_ as k}from"./logo-CxXS7KxG.js";import{_ as N}from"./login_group-DYqypnvV.js";import{_ as h,B as S}from"./index-gDIc8bwb.js";import{F as U,a as M}from"./index-hQPcagMW.js";/* empty css */import{T as R}from"./index-CAIzCETJ.js";/* empty css *//* empty css */import"./index-B-EN-g8l.js";import{j as p,r as j,B as y,c as V,a,v as s,u,w as r,F as z,N as A,p as P,o as v,q,s as D,t as E}from"./vue-vendor-C15EL-OS.js";import{u as b}from"./use-platform-information-By8xPspB.js";import{l as O,g as G}from"./login-DicHAV8w.js";import{c as H}from"./clipboard-qSm0LkN7.js";/* empty css */import"./index-BIw8pChk.js";import{I as J}from"./index-DZ6JXkT0.js";import{T as K}from"./index-okEh8OGo.js";import{M as g}from"./index-BQHVuQym.js";import"./index-B3z4cY-J.js";import"./responsive-observe-4ACH6YSC.js";import"./resize-observer-BjKOTb2B.js";import"./use-merge-state-Cwl1cZw4.js";const L={class:"form-title"},Q={style:{"margin-top":"30px"}},W={__name:"FormItem",setup(I){const m=A(),c=b(),_=p(),o=j({version:"",status:"",machine_id:"",licenseCode:""}),e=p(!1),i=l=>{e.value=!0,x(l.licenseCode)},x=async l=>{try{e.value=!0;const t=await O({licenseCode:l});t.code/1===200?(g.success("激活成功"),m.push({path:"/login"})):g.error(t.msg)}catch(t){console.log(t)}finally{e.value=!1}},C=()=>{H(o.machine_id),g.success("复制成功")};return y(()=>{Object.assign(o,c.auth),o.status_txt=o.status/1===1?"已激活":o.status/1===2?"已过期":"未激活",console.log(c.auth)}),(l,t)=>{const f=J,d=M,F=P("icon-copy"),T=K,$=R,w=S,B=U;return v(),V(z,null,[a("div",L,u(l.$t("auth.modelName")),1),s(B,{ref_key:"ref_form",ref:_,model:o,style:{width:"calc(100% - 60px)"},layout:"horizontal",onSubmitSuccess:i},{default:r(()=>[s(d,{field:"username",label:"版本类型"},{default:r(()=>[s(f,{modelValue:o.version,"onUpdate:modelValue":t[0]||(t[0]=n=>o.version=n),disabled:"",placeholder:l.$t("login.usernameTips")},null,8,["modelValue","placeholder"])]),_:1}),s(d,{field:"username",label:"激活状态"},{default:r(()=>[s(f,{modelValue:o.status_txt,"onUpdate:modelValue":t[1]||(t[1]=n=>o.status_txt=n),disabled:"",placeholder:l.$t("login.usernameTips")},null,8,["modelValue","placeholder"])]),_:1}),s(d,{field:"username",label:"请求码",class:"machine"},{default:r(()=>[s(f,{modelValue:o.machine_id,"onUpdate:modelValue":t[2]||(t[2]=n=>o.machine_id=n),disabled:"",placeholder:l.$t("login.usernameTips")},null,8,["modelValue","placeholder"]),s(T,{content:"复制"},{default:r(()=>[s(F,{class:"copy",onClick:C})]),_:1})]),_:1}),s(d,{field:"username",label:"授权密钥"},{default:r(()=>[s($,{modelValue:o.licenseCode,"onUpdate:modelValue":t[3]||(t[3]=n=>o.licenseCode=n),placeholder:"请输入授权码","auto-size":{minRows:2,maxRows:5}},null,8,["modelValue"])]),_:1}),a("div",Q,[l.form_type?D("",!0):(v(),q(w,{key:0,class:"submit-btn",type:"primary","html-type":"submit",loading:e.value},{default:r(()=>t[4]||(t[4]=[E(" 激活 ")])),_:1},8,["loading"]))])]),_:1},8,["model"])],64)}}},X=h(W,[["__scopeId","data-v-91b03ea3"]]),Y={class:"login"},Z={class:"login-logo"},oo={class:"logo-title"},to={class:"login-section"},eo={class:"intro"},so={class:"intro-title"},ao={class:"intro-title"},lo={class:"login-form"},no={__name:"Auth",setup(I){const m=b(),c=p(m.platform_name),_=p(m.platform_introduce),o=async()=>{try{const e=await G();console.log(e),e.code/1===200&&m.updatePlatformInformation(e.data.title,e.data.desc)}catch(e){console.log(e)}};return y(()=>{o()}),(e,i)=>(v(),V("div",Y,[a("div",Z,[i[0]||(i[0]=a("img",{class:"logo-img",src:k,alt:"logo"},null,-1)),a("div",oo,u(c.value),1)]),a("div",to,[a("div",eo,[a("div",so,u(c.value),1),a("div",ao,u(_.value),1),i[1]||(i[1]=a("img",{src:N,alt:""},null,-1))]),a("div",lo,[s(X)])])]))}},ko=h(no,[["__scopeId","data-v-17f92a65"]]);export{ko as default};