From 764bf6dd5591ef8654f80500d0a4a2400a23e75b Mon Sep 17 00:00:00 2001 From: kuaifan Date: Fri, 22 Nov 2024 17:23:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=80=80=E5=87=BA?= =?UTF-8?q?=E8=BF=98=E8=83=BD=E6=94=B6=E5=88=B0=E6=8E=A8=E9=80=81=E7=9A=84?= =?UTF-8?q?=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Api/UsersController.php | 10 +++++++ resources/assets/js/App.vue | 31 +++++++++++++------- resources/mobile | 2 +- 3 files changed, 31 insertions(+), 12 deletions(-) diff --git a/app/Http/Controllers/Api/UsersController.php b/app/Http/Controllers/Api/UsersController.php index 6f7ce0008..e177bb912 100755 --- a/app/Http/Controllers/Api/UsersController.php +++ b/app/Http/Controllers/Api/UsersController.php @@ -1115,6 +1115,9 @@ class UsersController extends AbstractController * @apiGroup users * @apiName umeng__alias * + * @apiParam {String} action + * - update: 更新(默认) + * - remove: 删除 * @apiParam {String} alias 别名 * * @apiSuccess {Number} ret 返回状态码(1正确、0错误) @@ -1130,6 +1133,13 @@ class UsersController extends AbstractController 'alias.between:2,20' => '别名的长度在2-20个字符', ]); // + if ($data['action'] === 'remove') { + if ($data['alias']) { + UmengAlias::whereAlias($data['alias'])->delete(); + } + return Base::retSuccess('删除成功'); + } + // if (!in_array(Base::platform(), ['ios', 'android'])) { return Base::retError('设备类型错误'); } diff --git a/resources/assets/js/App.vue b/resources/assets/js/App.vue index 5f7ec480c..618335585 100755 --- a/resources/assets/js/App.vue +++ b/resources/assets/js/App.vue @@ -122,20 +122,29 @@ export default { handler() { this.$store.dispatch("websocketConnection"); // - if (this.userId > 0 && this.$isEEUiApp) { - $A.eeuiAppSendMessage({ - action: 'initApp', - apiUrl: $A.apiUrl(''), - userid: this.userId, - token: this.userToken, - userAgent: window.navigator.userAgent, - }); - setTimeout(_ => { + if (this.$isEEUiApp) { + this.umengAliasTimer && clearTimeout(this.umengAliasTimer) + if (this.userId > 0) { $A.eeuiAppSendMessage({ - action: 'setUmengAlias', + action: 'initApp', + apiUrl: $A.apiUrl(''), + userid: this.userId, + token: this.userToken, + userAgent: window.navigator.userAgent, + }); + this.umengAliasTimer = setTimeout(_ => { + this.umengAliasTimer = null; + $A.eeuiAppSendMessage({ + action: 'setUmengAlias', + url: $A.apiUrl('users/umeng/alias') + }); + }, 6000) + } else { + $A.eeuiAppSendMessage({ + action: 'delUmengAlias', url: $A.apiUrl('users/umeng/alias') }); - }, 6000) + } } }, immediate: true diff --git a/resources/mobile b/resources/mobile index 25571a072..8533b26fe 160000 --- a/resources/mobile +++ b/resources/mobile @@ -1 +1 @@ -Subproject commit 25571a072613453c181edb6a642fad8a3a053b12 +Subproject commit 8533b26fe64824a3c714757aa7631f1da4413304