PageSourceSearch

https://ttfr.ru/_nuxt/wjB-Cw_v.js

js ttfr.ru collected 2026-09-24 19:14:53 UTC 2,061 bytes, 1 lines download raw bytes

1import{ac as p,b$ as g,r as A,aF as _,q as i,ad as m,c0 as C,b7 as P,b8 as b,c1 as y,bs as k}from"./Ch_ZU2Rj.js";const n={LOGIN:"/account/login",LOGOUT:"/account/logout",GET_ACCOUNT_INFO:"/account/info",PASSWORD_RESTORE:"/account/password/forgot",PASSWORD_TOKEN_CHECK:"/account/password/token/check",PASSWORD_RESET:"/account/password/reset"};function N(){return a(n.GET_ACCOUNT_INFO,{method:"GET"})}function w(e){return a(n.LOGIN,{method:"POST",body:e})}function v(){return a(n.LOGOUT,{method:"POST"})}function U(e){return a(n.PASSWORD_RESTORE,{method:"POST",body:e})}function D(e){return a(n.PASSWORD_TOKEN_CHECK,{method:"POST",body:{token:e}})}function G(e,t){return a(n.PASSWORD_RESET,{method:"POST",body:{token:t,password:e}})}const d=p("authV2",()=>{const e=g("auth",{maxAge:604800,sameSite:"strict",path:"/"}),t=_(null),s=A(e.value);function l(o){s.value=o,e.value=o}const f=i(()=>!!s.value),h=i(()=>t.value?.roles??[]),S=i(()=>Object.values(m).reduce((u,c)=>({...u,[c]:h.value.includes(c)}),{}));function r(){t.value=null,l(null)}async function O(){try{const o=await N();t.value=o??null}catch(o){r(),console.error(o)}}async function R(o){const{user:u}=await w(o),{token:c,...E}=u;l(c),t.value=E}async function T(){try{await v()}catch(o){console.error(o)}r()}return{user:t,token:s,isAuthenticated:f,userRoles:h,hasRole:S,authenticate:R,logout:T,updateInfo:O,clearStore:r}}),a=C.create({baseURL:"https://ttfr.ru/api/fntr/",async onRequest({options:e}){const t=d(),s=new Headers(e.headers);s.set("Accept","application/json"),e.method==="GET"&&s.set("Content-Type","application/json;charset=UTF-8;"),t.token&&s.set("Authorization",`Bearer ${t.token}`),e.headers=s},async onResponse({response:e}){const t=d();e.status===401&&t.token&&t.clearStore()},async onRequestError({error:e}){console.log("Fetch error message:",e instanceof Error?e.message:String(e)),e||P(t=>{t.setExtra("error",e),b("FNTRFetchErrorMessage")})}}),L=y.__nuxt_factory(e=>{const t=k();return{...e,baseURL:t.public.BACKEND_BASE_URL,$fetch:a}});export{a,d as b,D as c,U as r,G as s,L as u};

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.