feat: 执行→已发生+默认工作台+tip改色
- 执行模块改名为已发生 - tip改为淡黄色+新文案(只记录已发生的确收/毛利/回款/成本/支出) - 登录后默认选择权限范围内第一个工作台 - applyUserTenants返回Promise,app.js先await再load - 去除总览工作台残留 - 版本号 v1.2.0.9
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// projects.js — 重点工作与台账(项目管理 + 任务管理)
|
||||
|
||||
function applyUserTenants() {
|
||||
fetch("/api/auth/me").then(r => r.json()).then(data => {
|
||||
return fetch("/api/auth/me").then(r => r.json()).then(data => {
|
||||
if (!data.logged_in) { window.location.href = "/login"; return; }
|
||||
const user = data.user;
|
||||
const avatar = document.querySelector("#userAvatar");
|
||||
@@ -15,6 +15,13 @@ function applyUserTenants() {
|
||||
});
|
||||
// 缓存可用工作台列表,供下拉菜单使用
|
||||
state.allowedTenants = data.tenants || [];
|
||||
// 如果当前工作台不在权限范围内,选择第一个
|
||||
if (state.allowedTenants.length > 0 && state.allowedTenants.indexOf(state.tenant) < 0) {
|
||||
state.tenant = state.allowedTenants[0];
|
||||
localStorage.setItem("opc-active-tenant", state.tenant);
|
||||
var label0 = state.tenant.replace("·无界", "");
|
||||
document.querySelector("#workspaceTitle").textContent = label0 + " OPC 工作台";
|
||||
}
|
||||
updateTenantLabel();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user