批量更新
This commit is contained in:
1 parent
fa281363fb
commit
c5ed596008
47 files changed
+5385
-1199
No files matched your search
@@ -327,6 +327,14 @@ const previewList = computed(() =>
|
||||
imageList.value.map(img => resolveUrl(img.url))
|
||||
);
|
||||
|
||||
// ---------- 绑定提醒的状态回显与反馈 ----------
|
||||
// 注意:这两个 ref 必须声明在下方 watch 之前。
|
||||
// watch 带 immediate:true,会在 setup 执行到该处时立即回调 loadReminderInfo(),
|
||||
// 而 loadReminderInfo 同步写入 reminderInfo / reminderLoading,
|
||||
// 若此时它们尚未初始化,会抛出 "Cannot access 'x' before initialization"(暂时性死区)。
|
||||
const reminderInfo = ref(null);
|
||||
const reminderLoading = ref(false);
|
||||
|
||||
// ---------- 备注:创建 / 修改 / 完成后都可编辑 ----------
|
||||
const remarkText = ref("");
|
||||
const remarkSaving = ref(false);
|
||||
@@ -374,10 +382,7 @@ async function saveRemark() {
|
||||
}
|
||||
}
|
||||
|
||||
// ---------- 绑定提醒的状态回显与反馈 ----------
|
||||
const reminderInfo = ref(null);
|
||||
const reminderLoading = ref(false);
|
||||
|
||||
// ---------- 提醒渠道文案映射 ----------
|
||||
const channelTextMap = {
|
||||
SMS: "短信",
|
||||
EMAIL: "邮件",
|
||||
|
||||
@@ -16,10 +16,39 @@
|
||||
|
||||
<script setup>
|
||||
import { onMounted, ref } from "vue";
|
||||
import { handleAuthorizeCallback, redirectToAuthorize } from "@/utils/authClient";
|
||||
import {
|
||||
handleAuthorizeCallback,
|
||||
redirectToAuthorize,
|
||||
fetchUserInfo,
|
||||
} from "@/utils/authClient";
|
||||
|
||||
const error = ref("");
|
||||
|
||||
/**
|
||||
* 写入本地用户信息。
|
||||
* 关键:id 必须用 legacy_uid(老表 yz_system_tenant_user.uid),
|
||||
* 因为菜单、权限等现有业务接口都以它识别用户。
|
||||
*/
|
||||
async function saveUserInfo() {
|
||||
try {
|
||||
const info = await fetchUserInfo();
|
||||
const userInfo = {
|
||||
id: info.id || info.sub || "",
|
||||
account: info.account || info.mobile || "",
|
||||
name: info.name || info.nickname || "",
|
||||
group_id: info.group_id || "",
|
||||
tid: info.tid || "",
|
||||
tenant_name: (info.tenants || []).map((t) => t.tenant_name).join("、"),
|
||||
avatar: info.avatar || "",
|
||||
type: "backend",
|
||||
};
|
||||
localStorage.setItem("userInfo", JSON.stringify(userInfo));
|
||||
} catch (e) {
|
||||
// 用户信息拉取失败不阻断登录,只记录;业务接口可能提示重新登录
|
||||
console.error("获取用户信息失败:", e);
|
||||
}
|
||||
}
|
||||
|
||||
async function finish() {
|
||||
// hash 路由:参数位于 location.hash 之后,这里统一从 URL 中取出
|
||||
const raw = window.location.href;
|
||||
@@ -28,6 +57,7 @@ async function finish() {
|
||||
|
||||
try {
|
||||
await handleAuthorizeCallback(query);
|
||||
await saveUserInfo();
|
||||
// 登录成功:清掉 URL 上的 code/state,进入首页
|
||||
window.location.href = "#/home";
|
||||
window.location.reload();
|
||||
|
||||
Reference in new issue
Block a user