UNPKG

press-pix

Version:
59 lines (56 loc) 1.17 kB
export function getBasicInfo(uid) { let baseInfo: Partial<{ date: string; author: string; branch: string; commitInfo: { date: string; hash: string; author: string; message: string; } }> = {}; try { // @ts-ignore baseInfo = __PROJECT_VERSION_INFO__ || {}; } catch (e) { baseInfo = {}; } const list = [ { label: '当前用户 UID', value: uid, }, { label: '版本发布时间', value: baseInfo.date, }, // { // label: '版本发布作者(Git)', // value: baseInfo.author, // }, { label: '版本发布分支', value: baseInfo.branch, }, { label: '最后提交时间', value: baseInfo?.commitInfo?.date, }, { label: '最后提交 Hash', value: baseInfo?.commitInfo?.hash, }, // { // label: '最后提交作者', // value: baseInfo?.commitInfo?.author, // }, // { // label: '最后提交信息', // value: baseInfo?.commitInfo?.message, // }, ].map(item => ({ label: `${item.label}${item.value || ''}`, })); return list; }