fix: 积分明细用户列兼容联表返回对象形态(vk limit:1 返回对象非数组)
This commit is contained in:
@@ -37,7 +37,9 @@ export default {
|
||||
align: "left",
|
||||
width: 200,
|
||||
formatter: (val, row) => {
|
||||
const user = row.userInfo && row.userInfo[0] ? row.userInfo[0] : null;
|
||||
// vk 联表 limit:1 返回对象而非数组,两种形态兼容
|
||||
const raw = row.userInfo;
|
||||
const user = Array.isArray(raw) ? (raw[0] || null) : (raw || null);
|
||||
const mobile = user && user.mobile ? user.mobile : "-";
|
||||
if (user) {
|
||||
const name = user.nickname || user.username || "未设置昵称";
|
||||
|
||||
Reference in New Issue
Block a user