From c05136f0849e5c463db81c43386ada9db3bd1340 Mon Sep 17 00:00:00 2001 From: liutong <836164388@qq.com> Date: Fri, 21 Mar 2025 10:51:51 +0800 Subject: [PATCH] =?UTF-8?q?refactor(coach/market):=E9=87=8D=E6=9E=84?= =?UTF-8?q?=E9=80=80=E5=87=BA=E7=99=BB=E5=BD=95=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除原有的冗余代码 - 使用 $util.loginOut() 方法统一处理登录退出逻辑 - 提高代码复用性和可维护性 --- pages/coach/my/set_up.vue | 9 ++------- pages/market/my/set_up.vue | 9 ++------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/pages/coach/my/set_up.vue b/pages/coach/my/set_up.vue index 6132536..69519e9 100644 --- a/pages/coach/my/set_up.vue +++ b/pages/coach/my/set_up.vue @@ -22,13 +22,8 @@ }, methods: { //退出登陆 - logOut(){ - //清空用户缓存数据 - uni.removeStorageSync('userInfo'); - //跳转登陆页面 - uni.navigateTo({ - url: '/pages/student/login/login' - }) + loginOut(){ + this.$util.loginOut() }, privacy_agreement(type){ diff --git a/pages/market/my/set_up.vue b/pages/market/my/set_up.vue index 1849ad5..1b860c6 100644 --- a/pages/market/my/set_up.vue +++ b/pages/market/my/set_up.vue @@ -22,13 +22,8 @@ }, methods: { //退出登陆 - logOut(){ - //清空用户缓存数据 - uni.removeStorageSync('userInfo'); - //跳转登陆页面 - uni.navigateTo({ - url: '/pages/student/login/login' - }) + loginOut(){ + this.$util.loginOut() }, privacy_agreement(type){