import { defineComponent, ref, computed, reactive, mergeProps, useSSRContext } from 'vue'; import { ssrRenderAttrs, ssrRenderStyle, ssrIncludeBooleanAttr, ssrLooseContain, ssrLooseEqual, ssrRenderList, ssrRenderAttr, ssrInterpolate } from 'vue/server-renderer'; import { u as useApi } from './useApi-DMQewX5_.mjs'; import { u as useToast } from './useToast-CS21XT61.mjs'; import { u as useAuthStore } from './auth-QFkCoU1C.mjs'; import './server.mjs'; import '../nitro/nitro.mjs'; import 'node:http'; import 'node:https'; import 'node:events'; import 'node:buffer'; import 'node:fs'; import 'node:path'; import 'node:crypto'; import 'node:url'; import '../routes/renderer.mjs'; import 'vue-bundle-renderer/runtime'; import 'unhead/server'; import 'devalue'; import 'unhead/utils'; import 'pinia'; import 'perfect-debounce'; import './useLoading-D4zrSa2m.mjs'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "users", __ssrInlineRender: true, setup(__props) { useApi(); useToast(); const auth = useAuthStore(); const REGION_MAP = { cn: "中国", us: "美国", hw: "海外", ea: "东亚", sea: "东南亚", sa: "南亚", me: "中东", eu: "欧洲", ru: "俄罗斯", af: "非洲", sam: "南美", nam: "北美", oc: "大洋洲", br: "巴西", in: "印度" }; function regionLabel(r) { return REGION_MAP[r] || r || "默认"; } const apps = ref([]); const qApp = ref(""); const qRegion = ref(""); const qUid = ref(""); const user = ref(null); const emptyHint = ref("请输入查询条件后点击「搜索」"); ref(""); const lastUid = ref(""); const giftAllowed = computed(() => [1, 2, 3].includes(auth.identity)); ref(null); const gift = reactive({ vipday: 0, trademin: 0, meetmin: 0 }); const appNames = computed(() => { const names = []; apps.value.forEach((a) => { if (!names.includes(a.name)) names.push(a.name); }); return names; }); const regionItems = computed(() => apps.value.filter((a) => a.name === qApp.value)); function fmtTs(ts) { if (!ts) return "-"; return new Date(ts * 1e3).toLocaleString(); } function fmtBool(v) { return v ? "是" : "否"; } function fmtGender(g) { return g === 1 ? "男" : g === 2 ? "女" : "未知"; } function dispVal(v) { return v === void 0 || v === null || v === "" ? "-" : v; } const sections = [ { title: "基本信息", rows: [ ["uid", "UID"], ["name", "用户名"], ["account", "登录账号"], ["mail", "邮箱"], ["phone", "手机号"], ["gender", "性别", "gender"], ["language", "语言"], ["version", "版本"], ["channel", "渠道"], ["State", "状态"], ["country_code", "国家码"], ["continent_code", "大洲码"], ["servicetag", "服务区"], ["phonemodel", "手机型号"], ["phonemac", "设备ID"] ] }, { title: "第三方登录", rows: [ ["wxopenid", "微信 openid"], ["googleopenid", "Google openid"], ["facebookopenid", "Facebook openid"], ["appleopenid", "Apple openid"] ] }, { title: "会员与积分", rows: [ ["viplv", "VIP等级"], ["vipexptime", "VIP到期", "ts"], ["aichatintegral", "AI积分"], ["aichattotalintegral", "AI累计积分"], ["tradeintegral", "翻译积分"], ["tradetotalintegral", "翻译累计积分"], ["meetintegral", "会议积分"], ["meettotalintegral", "会议累计积分"], ["lastbindproductid", "最后绑定产品ID"], ["isactivatecode", "已领激活码", "bool"], ["isgiveaway", "首次绑定赠送", "bool"] ] }, { title: "时间", rows: [ ["createtime", "注册时间", "ts"], ["lastsgintime", "最后登录", "ts"], ["canceltime", "注销时间", "ts"] ] } ]; function cellValue(u, row) { const t = row[2]; const v = u[row[0]]; if (t === "ts") return fmtTs(v); if (t === "bool") return fmtBool(v); if (t === "gender") return fmtGender(v); return dispVal(v); } const avatarInitial = computed(() => { const u = user.value; if (!u) return "?"; return String(u.name || u.uid || "?").charAt(0).toUpperCase(); }); return (_ctx, _push, _parent, _attrs) => { _push(`

选择应用与区域后输入 UID,直接查询该部署业务库中的用户信息。

`); if (!user.value) { _push(`
${ssrInterpolate(emptyHint.value)}
`); } else { _push(`
`); if (user.value.avatar) { _push(``); } else { _push(`
${ssrInterpolate(avatarInitial.value)}
`); } _push(`
${ssrInterpolate(dispVal(user.value.name))}
${ssrInterpolate(dispVal(user.value.uid))}
VIP ${ssrInterpolate(user.value.viplv || 0)}`); if (giftAllowed.value) { _push(``); } else { _push(``); } _push(`
`); ssrRenderList(sections, (s) => { _push(`
${ssrInterpolate(s.title)}
`); ssrRenderList(s.rows, (r) => { _push(`
${ssrInterpolate(r[1])}${ssrInterpolate(cellValue(user.value, r))}
`); }); _push(`
`); }); _push(`
`); } _push(``); }; } }); const _sfc_setup = _sfc_main.setup; _sfc_main.setup = (props, ctx) => { const ssrContext = useSSRContext(); (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/users.vue"); return _sfc_setup ? _sfc_setup(props, ctx) : void 0; }; export { _sfc_main as default }; //# sourceMappingURL=users-Nuh0129J.mjs.map