Files
tehran_taj/apps/admin-panel/dist/assets/auth-BB1QmSNz.js
T
mahmoodandClaude Sonnet 5.5 5ddb225813 fix(ui): act-as strip no longer covers headers; customer type and slider permission
- apps: the fixed «در حال مشاهده به‌عنوان» strip (38px) sat over the fixed page
  headers, which still sat at top: 0 (the old 30px body padding was shorter than
  the strip too). The strip's height is now one variable, --aab-h, that the
  fixed headers (PageBar, home, dashboard, toasts) use as their top.
- admin: the customer form offers only «مغازه دار اپلیکیشن» to anyone but the
  super admin; bankers and walk-in shopkeepers are listed by super-admin-only
  endpoints, so ordinary admins lost the customers they created under them.
- admin: the mobile slider rid (custom.config.statics.slider) was only under the
  «سفارشی» branch, which the permission screen hides outside level 104. Same rid,
  now listed under «مدیریت ثابت ها». Display only: the slider routes are still
  gated by config.statics.

Rebuilds admin-panel, user-app and user-app-v2 dist.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-26 11:16:23 +03:30

2 lines
1.1 KiB
JavaScript

import{Y as u,y as l,a0 as c,a1 as s,a2 as a,u as n}from"./index-D8Sl1lAu.js";const g=u("auth",{state:()=>({userPermission:[]}),getters:{token:()=>localStorage.getItem(s),user:()=>{const e=localStorage.getItem(a);if(!e)return null;try{return JSON.parse(e)}catch{return null}},isLoggedIn(){return!!this.token}},actions:{async login(e){const{data:t}=await l.post("admin-login",e),o=n();o.getRoles((t.roles??[]).map(i=>i.rid)),o.setSuperAdmin(t.is_super_admin);const r={...t};return delete r.roles,delete r.ut,this.inject(r),t.iamBootstrapUrl&&window.location.assign(t.iamBootstrapUrl),r},inject(e){localStorage.setItem(s,e.api_token),localStorage.setItem("login","true"),localStorage.setItem(a,JSON.stringify(e))},async logout(){let e=null;try{const{data:o}=await l.get("admin/auth/sso/logout-url",{params:{return_url:c("auth/login")}});e=(o==null?void 0:o.logout_url)??null}catch{e=null}localStorage.removeItem(s),localStorage.removeItem(a),localStorage.removeItem("login"),sessionStorage.removeItem("gb_admin_iam_sso_checked");const t=n();return t.deleteRoles(),t.deleteUserInfo(),e?(window.location.assign(e),!0):!1}}});export{g as u};