From 6e42586dcc03e87a7434be358901331defbbf8d3 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Fri, 25 Jun 2021 19:26:49 +0800 Subject: [PATCH] no message --- resources/assets/js/store/actions.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/resources/assets/js/store/actions.js b/resources/assets/js/store/actions.js index 9095406c..fda1a383 100644 --- a/resources/assets/js/store/actions.js +++ b/resources/assets/js/store/actions.js @@ -1087,16 +1087,16 @@ export default { * @param dispatch */ getDialogs({state, dispatch}) { - return new Promise(function (resolve, reject) { - dispatch("call", { - url: 'dialog/lists', - }).then(result => { - dispatch("saveDialog", result.data.data); - resolve(result); - }).catch(e => { - console.error(e); - reject(e); - }); + if (state.userId === 0) { + state.dialogs = []; + return; + } + dispatch("call", { + url: 'dialog/lists', + }).then(result => { + dispatch("saveDialog", result.data.data); + }).catch(e => { + console.error(e); }); },