Skip to content

Commit

Permalink
Fix transfer message
Browse files Browse the repository at this point in the history
  • Loading branch information
trazyn committed Jul 23, 2018
1 parent 52dd1da commit 22061a6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/js/stores/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async function resolveMessage(message) {
let parts = message.Content.split(':<br/>');
let location = helper.parseKV(message.OriContent);

location.image = `${axios.defaults.baseURL}${parts[(isChatRoom && !message.isme) ? 2 : 1]}`.replace(/\/+/g, '/');
location.image = `${axios.defaults.baseURL}${parts[1]}`.replace(/\/+/g, '/');
location.href = message.Url;

message.location = location;
Expand Down Expand Up @@ -80,12 +80,13 @@ async function resolveMessage(message) {
switch (message.AppMsgType) {
case 2000:
// Transfer
let { value } = helper.parseXml(message.Content, 'des');
let res = helper.parseXml(message.Content, 'des');
let value = (res.value || {}).des;

message.MsgType += 2000;
message.transfer = {
desc: value.des,
money: +value.match(/[\d.]+元/)[0].slice(0, -1),
desc: value,
money: +(value.match(/[\d.]+元/)[0].slice(0, -1)),
};
break;

Expand Down Expand Up @@ -136,6 +137,7 @@ async function resolveMessage(message) {
break;

case 10002:
// Recall message
let text = isChatRoom ? message.Content.split(':<br/>').slice(-1).pop() : message.Content;
let { value } = helper.parseXml(text, ['replacemsg', 'msgid']);

Expand Down

0 comments on commit 22061a6

Please sign in to comment.