update user page style
This commit is contained in:
+3
-2
@@ -28,6 +28,7 @@ export interface InvitePosterOptions {
|
||||
code: string;
|
||||
storeName: string;
|
||||
roleName: string;
|
||||
inviterName: string;
|
||||
expireAt: number;
|
||||
}
|
||||
|
||||
@@ -216,7 +217,7 @@ function renderInvitePoster(options: InvitePosterOptions): HTMLCanvasElement {
|
||||
context.textAlign = "left";
|
||||
context.textBaseline = "middle";
|
||||
context.font = "700 80px Microsoft YaHei, sans-serif";
|
||||
context.fillText("邀请您加入", 64, 120);
|
||||
context.fillText(`${options.inviterName} 邀请您加入`, 64, 120);
|
||||
context.font = "700 110px Microsoft YaHei, sans-serif";
|
||||
context.fillText(options.storeName, 64, 280);
|
||||
context.font = "700 64px Microsoft YaHei, sans-serif";
|
||||
@@ -246,7 +247,7 @@ function renderInvitePoster(options: InvitePosterOptions): HTMLCanvasElement {
|
||||
context.fillText("糕店客户管理系统", 600, 1550);
|
||||
context.fillStyle = "#64748B";
|
||||
context.font = "400 40px Microsoft YaHei, sans-serif";
|
||||
context.fillText("客户档案 | 事件登记 | 积分激励 | 门店协同", 600, 1645);
|
||||
context.fillText("客户档案 | 事件登记 | 积分激励 | 门店协同 | AI 分析", 600, 1645);
|
||||
context.fillStyle = "#94A3B8";
|
||||
context.font = "400 40px Microsoft YaHei, sans-serif";
|
||||
context.fillText("本邀请仅限本人使用,请勿转发", 600, 1760);
|
||||
|
||||
+38
-6
@@ -34,14 +34,46 @@ export function getRoleDisplayName(role: ManagedUserRole | undefined, roleList:
|
||||
return typeof role === "string" ? role : role.name || role.code || "未配置角色";
|
||||
}
|
||||
|
||||
export function buildEffectiveRoleCodeSet(user: ManagedUser): Set<string> {
|
||||
export function buildEffectiveRoleCodeSet(user: ManagedUser, roleList: Role[] = []): Set<string> {
|
||||
const roleCodeSet = new Set<string>();
|
||||
for (const role of getManagedUserRoleList(user)) {
|
||||
if (typeof role !== "string") {
|
||||
roleCodeSet.add(buildRoleCode(role as Role));
|
||||
continue;
|
||||
const visitedRoleIds = new Set<string>();
|
||||
|
||||
function addRole(role: ManagedUserRole | Role): void {
|
||||
const roleId = typeof role === "string"
|
||||
? roleList.find(item => buildRoleCode(item) === role || item.code === role)?.id
|
||||
: role.id || roleList.find(item => buildRoleCode(item) === buildRoleCode(role as Role))?.id;
|
||||
if (roleId && visitedRoleIds.has(roleId)) {
|
||||
return;
|
||||
}
|
||||
roleCodeSet.add(role);
|
||||
if (roleId) {
|
||||
visitedRoleIds.add(roleId);
|
||||
}
|
||||
|
||||
if (typeof role === "string") {
|
||||
roleCodeSet.add(role);
|
||||
const separatorIndex = role.indexOf(":");
|
||||
if (-1 < separatorIndex) {
|
||||
roleCodeSet.add(role.slice(separatorIndex + 1));
|
||||
}
|
||||
} else {
|
||||
roleCodeSet.add(role.code);
|
||||
roleCodeSet.add(buildRoleCode(role as Role));
|
||||
}
|
||||
|
||||
const fullRole = roleId ? roleList.find(item => item.id === roleId) : undefined;
|
||||
for (const childRoleId of fullRole?.childRoleIdList || []) {
|
||||
const childRole = roleList.find(item => item.id === childRoleId);
|
||||
if (childRole) {
|
||||
addRole(childRole);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (const role of getManagedUserRoleList(user)) {
|
||||
addRole(role);
|
||||
}
|
||||
for (const roleCode of user.user?.roleList || []) {
|
||||
addRole(roleCode);
|
||||
}
|
||||
return roleCodeSet;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user