Authored by yyq

fix praise login

@@ -125,16 +125,23 @@ export default { @@ -125,16 +125,23 @@ export default {
125 hide: left - inx > 1 || inx - right > 1 125 hide: left - inx > 1 || inx - right > 1
126 }; 126 };
127 }, 127 },
128 - praiseArticle(e) { 128 + async praiseArticle(e) {
129 if (e.timeStamp - this._preTimeStamp < dblclickDdelay) { 129 if (e.timeStamp - this._preTimeStamp < dblclickDdelay) {
130 - this.onAnimation = true;  
131 - this._lottieTimer && clearTimeout(this._lottieTimer);  
132 - this.$refs.lottie.play();  
133 - this._lottieTimer = setTimeout(() => {  
134 - this.$refs.lottie.stop();  
135 - this.onAnimation = false;  
136 - }, 1000);  
137 - this.$emit('on-praise'); 130 + const user = await this.$sdk.getUser();
  131 +
  132 + if (user && user.uid) {
  133 + this.onAnimation = true;
  134 + this._lottieTimer && clearTimeout(this._lottieTimer);
  135 + this.$refs.lottie.play();
  136 + this._lottieTimer = setTimeout(() => {
  137 + this.$refs.lottie.stop();
  138 + this.onAnimation = false;
  139 + }, 1000);
  140 +
  141 + this.$emit('on-praise');
  142 + } else {
  143 + this.$sdk.goLogin();
  144 + }
138 } 145 }
139 146
140 this._preTimeStamp = e.timeStamp; 147 this._preTimeStamp = e.timeStamp;