Browse Source

Merge pull request #597 from colinin/5.2.1

serialization issues need to be addressed
pull/645/head
yx lin 4 years ago
committed by GitHub
parent
commit
f2b33b3358
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 36
      apps/vue/src/layouts/default/header/components/notify/useNotifications.ts

36
apps/vue/src/layouts/default/header/components/notify/useNotifications.ts

@ -43,35 +43,39 @@ export function useNotifications() {
function onNotifyReceived(notificationInfo: NotificationInfo, notifer?: boolean) {
const { data } = notificationInfo;
let title = data.extraProperties.title;
let message = data.extraProperties.message;
let description = data.extraProperties.description;
if (!data.extraProperties) {
return;
}
if (data.extraProperties.L === true) {
// TODO: 后端统一序列化格式
const { L } = useLocalization(
data.extraProperties.title.ResourceName,
data.extraProperties.message.ResourceName,
data.extraProperties.description?.ResourceName ?? "AbpUi");
data.extraProperties.title = L(
data.extraProperties.title.Name,
data.extraProperties.title.Values,
data.extraProperties.title.resourceName ?? data.extraProperties.title.ResourceName,
data.extraProperties.message.resourceName ?? data.extraProperties.message.ResourceName,
data.extraProperties.description?.resourceName ?? data.extraProperties.description?.ResourceName ?? "AbpUi");
title = L(
data.extraProperties.title.name ?? data.extraProperties.title.Name,
data.extraProperties.title.values ?? data.extraProperties.title.Values,
);
data.extraProperties.message = L(
data.extraProperties.message.Name,
data.extraProperties.message.Values,
message = L(
data.extraProperties.message.name ?? data.extraProperties.message.Name,
data.extraProperties.message.values ?? data.extraProperties.message.Values,
);
if (data.extraProperties.description) {
data.extraProperties.description = L(
data.extraProperties.description.Name,
data.extraProperties.description.Values,
if (description) {
description = L(
data.extraProperties.description.name ?? data.extraProperties.description.Name,
data.extraProperties.description.values ?? data.extraProperties.description.Values,
);
}
}
const notifier: ListItem = {
id: notificationInfo.id,
avatar: data.extraProperties.avatar,
title: data.extraProperties.title,
description: data.extraProperties.message,
extra: data.extraProperties.description,
title: title,
description: message,
extra: description,
datetime: formatToDateTime(notificationInfo.creationTime, 'YYYY-MM-DD HH:mm:ss'),
type: String(notificationInfo.type),
};

Loading…
Cancel
Save