import { Component } from '@angular/core'; import { CommonModule } from '@angular/common'; import { RouterModule, RouterOutlet } from '@angular/router'; import { WxworkAuth } from "fmode-ng/core"; @Component({ selector: 'app-admin-layout', standalone: true, imports: [CommonModule, RouterModule, RouterOutlet], templateUrl: './admin-layout.html', styleUrl: './admin-layout.scss' }) export class AdminLayout { sidebarOpen = true; currentUser = { name: '超级管理员', avatar: "data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='100%25' height='100%25' fill='%23CCFFCC'/%3E%3Ctext x='50%25' y='50%25' font-family='Arial' font-size='13.333333333333334' font-weight='bold' text-anchor='middle' fill='%23555555' dy='0.3em'%3EADMIN%3C/text%3E%3C/svg%3E" }; currentDate = new Date(); constructor(){ this.loadProfile() } async loadProfile(){ let cid = localStorage.getItem("company"); if(cid){ let wwAuth = new WxworkAuth({cid:cid}) let profile = await wwAuth.currentProfile(); this.currentUser = { name: profile?.get("name") || profile?.get("mobile"), avatar: profile?.get("avatar") } } } toggleSidebar() { this.sidebarOpen = !this.sidebarOpen; } }