From b1902de33bb032a8b7f3a3ee82d9e7df68aada62 Mon Sep 17 00:00:00 2001 From: gongfuxiang Date: Sat, 18 Mar 2023 23:47:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E8=AE=BF=E9=97=AE=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E9=A1=B5=E9=9D=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 58 +++++++++++++------------------- manifest.json | 2 +- pages/index/index.css | 12 +++---- pages/login/login.vue | 78 +++++++++++++++++++++++++------------------ 4 files changed, 76 insertions(+), 74 deletions(-) diff --git a/App.vue b/App.vue index b01923cb..cf5ba873 100644 --- a/App.vue +++ b/App.vue @@ -59,9 +59,9 @@ // 请求地址 request_url: 'http://shopxo.com/', // 静态资源地址(如系统根目录不在public目录下面请在静态地址后面加public目录、如:https://d1.shopxo.vip/public/) - static_url: 'https://d1.shopxo.vip/', + static_url: 'http://shopxo.com/', // 系统类型(默认default、如额外独立小程序、可与程序分身插件实现不同主体小程序及支付独立) - system_type: 'default', + system_type: 'default-2', // 基础信息 application_title: 'ShopXO', application_describe: '企业级B2C开源电商系统!', @@ -385,26 +385,22 @@ if (res.data.code == 0) { var data = res.data.data; var client_type = this.application_client_type(); - if ((data.is_user_exist || 0) == 1 || client_type == 'weixin') { - uni.setStorage({ - key: self.data.cache_user_info_key, - data: data, - success: res => { - if (typeof object === 'object' && (method || null) != null) { - object[method](); - } - }, - fail: () => { - self.showToast('用户信息缓存失败'); - } - }); + if ((data.is_user_exist || 0) == 1 || client_type == 'weixin') { + uni.setStorageSync(self.data.cache_user_info_key, data); + if (typeof object === 'object' && (method || null) != null) { + object[method](); + } } else { - uni.setStorage({ - key: self.data.cache_user_login_key, - data: data - }); - if(is_to_auth) { - self.login_to_auth(); + uni.setStorageSync(self.data.cache_user_login_key, data); + if(is_to_auth) { + var pages = getCurrentPages(); + if(pages[pages.length-1]['route'] == 'pages/login/login') { + if (typeof object === 'object' && (method || null) != null) { + object[method](); + } + } else { + self.login_to_auth(); + } } } } else { @@ -477,19 +473,11 @@ dataType: 'json', success: res => { uni.hideLoading(); - if (res.data.code == 0) { - uni.setStorage({ - key: self.data.cache_user_info_key, - data: res.data.data, - success: res => { - if (typeof object === 'object' && (method || null) != null) { - object[method](); - } - }, - fail: () => { - self.showToast('用户信息缓存失败'); - } - }); + if (res.data.code == 0) { + uni.setStorageSync(self.data.cache_user_info_key, res.data.data); + if (typeof object === 'object' && (method || null) != null) { + object[method](); + } } else { self.showToast(res.data.msg); } @@ -1639,7 +1627,7 @@ * 小程序初始化 */ onLaunch(params) {}, - + /** * 小程序页面显示 */ diff --git a/manifest.json b/manifest.json index 0ef56a5f..41428c1d 100644 --- a/manifest.json +++ b/manifest.json @@ -82,7 +82,7 @@ }, "mp-toutiao" : { "usingComponents" : true, - "appid" : "", + "appid" : "ttfb628ddf6458b04f", "setting" : { "urlCheck" : false } diff --git a/pages/index/index.css b/pages/index/index.css index c0375fb8..b5668ac9 100644 --- a/pages/index/index.css +++ b/pages/index/index.css @@ -8,10 +8,7 @@ /* #ifdef H5 */ min-height: calc(var(--status-bar-height) + 160rpx); /* #endif */ - padding-top: calc(var(--status-bar-height) + 8px); - /* #ifdef MP-TOUTIAO */ - padding-top: 0 !important; - /* #endif */ + padding-top: calc(var(--status-bar-height) + 8px); } .home-top-nav-logo { text-align: left; @@ -59,7 +56,10 @@ * 搜索 */ .search-fixed-seat { - padding-top: 70rpx; + padding-top: 70rpx; + /* #ifdef MP-TOUTIAO */ + padding-top: 60rpx; + /* #endif */ } .search-content-fixed { position: fixed !important; @@ -70,7 +70,7 @@ background-repeat: no-repeat; background-size: 100% auto; padding-top: 25px; - /* #ifdef H5 || MP-TOUTIAO || APP */ + /* #ifdef H5 || APP */ padding-top: 15rpx !important; padding-bottom: 15rpx !important; /* #endif */ diff --git a/pages/login/login.vue b/pages/login/login.vue index 38729d0b..8e2928c1 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -1,7 +1,7 @@