PageSourceSearch

https://youloge.com/assets/Apikey-BfCe0KQt.js

js youloge.com collected 2026-10-08 11:36:12 UTC 5,619 bytes, 1 lines download raw bytes

1import{_ as U,u as A}from"./useDialog-CjFhdOWC.js";import{u as F,a as h,b as P,_ as T}from"./index-BtW9bNxY.js";import{b as E,k as L,G as M,p as n,q as e,S as w,s as v,F as g,B as y,C as a,X as S,u as Y,d as q,R as C,o as l,U as r,v as V,y as D}from"./vue-C9z22npz.js";const z={class:"max-w-screen-md mx-auto p-4 border-solid border-1 rounded border-gray-300"},G={class:"flex justify-between items-center mb-4 border-b-solid border-b-1 border-gray-300 p-b-2"},X={class:"flex items-center gap-2"},H={class:"font-medium flex justify-between items-center"},J={class:"text-sm text-dark-50 flex justify-between items-center"},K={class:"flex items-center"},O={class:"max-w-30 truncate"},Q={class:"cursor-pointer"},W={class:"font-bold"},Z={class:"flex gap-1 my-2"},ee=["onClick"],te={class:"font-bold"},se={class:"flex gap-1 my-2"},oe=["onClick"],ce={__name:"Apikey",props:["params"],emits:["jump"],setup(ie,{emit:ne}){const o=E({err:0,msg:"",applyVisible:!1,activeTime:{},activeRole:{},apikeyConfig:{status:!1,times:[],roles:[]},list:[],cursor:{limlt:10,next_cursor:""}}),{err:le,msg:re,cursor:I,list:$,applyVisible:c,apikeyConfig:_,activeRole:m,activeTime:p}=L(o),b=(d=!1)=>{d&&(o.list=[],o.cursor.next_cursor="");let t=F(),{next_cursor:i,limit:f}=o.cursor;h("apikey/list",{cursor:i,limit:f}).then(({data:u,...x})=>{o.cursor=x,u.forEach(s=>{o.list.findIndex(N=>N.uuid==s.uuid)==-1&&o.list.push(s)})}).catch(u=>{P().error(u.message)}).finally(()=>{t.close()})},j=()=>{let{status:d}=o.apikeyConfig;d||h("config/apikey").then(t=>{o.apikeyConfig.status=!0,o.apikeyConfig.times=t.times.map(i=>(i.actived=!1,i)),o.apikeyConfig.roles=t.roles.map(i=>(i.actived=!1,i)),console.log(o.apikeyConfig.times)})},R=()=>{o.applyVisible=!0},B=()=>{A({title:"提交确认",content:"密钥会发送邮箱,仅发送一次"}).then(d=>{o.applyVisible=!1,console.log("ok")}).catch(()=>{})};return M(()=>{b(),j()}),(d,t)=>{const i=T,f=U,u=C("ripple"),x=C("copy");return l(),n("div",z,[e("div",G,[e("div",X,[t[3]||(t[3]=e("div",null,"开发密钥",-1)),e("div",{onClick:t[0]||(t[0]=s=>b(!0)),class:"i-tdesign-loading hover:animate-spin"})]),w((l(),n("button",{onClick:R,class:"bg-blue-600 rounded-sm px-2 py-1 border-none text-white ml-2 cursor-pointer"},[v(i,{name:"mdi-light:plus"}),t[4]||(t[4]=e("span",null,"申请新密钥",-1))])),[[u]])]),e("div",null,[(l(!0),n(g,null,y(a($),s=>(l(),n("div",{key:s.id,class:"mb-2 hover:bg-gray-100 hover:rounded-lg p-2"},[e("div",H,[e("div",null,"UUID:"+r(s.uuid)+" - 权限:"+r(s.role),1),e("div",null,[e("span",null,"IP:"+r(s.bind),1),t[5]||(t[5]=e("span",{class:""},null,-1))])]),e("div",J,[e("div",K,[e("div",O,r(s.apikey),1),w((l(),n("div",Q,[v(i,{name:"mdi-light:clipboard-text"})])),[[x,s.apikey]])]),e("div",null,r(s.created)+" / "+r(s.expired),1)])]))),128)),a(I).next_cursor?(l(),n("div",{key:0,onClick:t[1]||(t[1]=s=>b())},"加载更多")):S("",!0)]),v(f,{visible:a(c),"onUpdate:visible":t[2]||(t[2]=s=>q(c)?c.value=s:null),title:"申请密钥",cancel:!1,confirm:!1},{default:Y(()=>[e("div",null,[e("div",null,[e("div",null,[t[6]||(t[6]=V("选择角色: ")),e("span",W,r(a(m).name),1)]),e("div",Z,[(l(!0),n(g,null,y(a(_).roles,s=>(l(),n("div",{key:s.uuid,onClick:k=>m.value=s,class:D([[s.uuid==a(m).uuid?"bg-blue text-white":"border-blue-800 text-blue-500"],"flex-inline px-5 py-2 rounded-lg border border-solid font-medium transition-all duration-200 hover:outline-none"])},r(s.name),11,ee))),128))])]),e("div",null,[e("div",null,[t[7]||(t[7]=V("选择时长: ")),e("span",te,r(a(p).name),1)]),e("div",se,[(l(!0),n(g,null,y(a(_).times,s=>(l(),n("div",{key:s.uuid,onClick:k=>p.value=s,class:D([[s.uuid==a(p).uuid?"bg-blue text-white":"border-blue-800 text-blue-500"],"flex-inline px-5 py-2 rounded-lg border border-solid font-medium transition-all duration-200 hover:outline-none"])},r(s.name),11,oe))),128))])]),t[8]||(t[8]=e("div",null,[e("div",null,"绑定IP 调试IP可使用 0.0.0.0 "),e("div",{class:"my-2"},[e("div",{class:"flex items-center gap-1 md:gap-2 max-w-md w-full"},[e("input",{class:"w-16 md:w-20 h-10 px-3 rounded-md border border-gray-300 focus:border-blue-500 focus:ring-2 focus:ring-blue-200 focus:outline-none text-center text-sm md:text-base font-medium transition-all duration-200",type:"number",max:"255",min:"0",placeholder:"01"}),e("span",{class:"text-gray-500 text-lg"},"."),e("input",{class:"w-16 md:w-20 h-10 px-3 rounded-md border border-gray-300 focus:border-blue-500 focus:ring-2 focus:ring-blue-200 focus:outline-none text-center text-sm md:text-base font-medium transition-all duration-200",type:"number",max:"255",min:"0",placeholder:"02"}),e("span",{class:"text-gray-500 text-lg"},"."),e("input",{class:"w-16 md:w-20 h-10 px-3 rounded-md border border-gray-300 focus:border-blue-500 focus:ring-2 focus:ring-blue-200 focus:outline-none text-center text-sm md:text-base font-medium transition-all duration-200",type:"number",max:"255",min:"0",placeholder:"03"}),e("span",{class:"text-gray-500 text-lg"},"."),e("input",{class:"w-16 md:w-20 h-10 px-3 rounded-md border border-gray-300 focus:border-blue-500 focus:ring-2 focus:ring-blue-200 focus:outline-none text-center text-sm md:text-base font-medium transition-all duration-200",type:"number",max:"255",min:"0",placeholder:"04"})])])],-1)),t[9]||(t[9]=e("div",{class:"my-2"},"密钥会通过邮件发送邮箱,请注意查收",-1)),e("div",{class:"flex justify-end"},[e("div",{onClick:B,class:"flex-inline px-5 py-2 text-blue-500 bg-blue text-white rounded-lg border border-solid font-medium transition-all duration-200 hover:outline-non"}," 发起申请")])])]),_:1},8,["visible"])])}}};export{ce as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.