From 43962f17f6e8a4f4fe0152a025dda840f4fdbb83 Mon Sep 17 00:00:00 2001 From: sa0ChunLuyu Date: Tue, 15 Aug 2023 22:25:52 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E5=85=AC=E4=BC=97=E5=8F=B7=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E5=AE=8C=E6=88=90=E3=80=82=202.=20=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E8=B0=83=E6=95=B4=E6=88=90=20True=20False=20?= =?UTF-8?q?=20=E4=B8=8D=E5=86=8D=E8=BF=94=E5=9B=9E=E5=85=B7=E4=BD=93?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E4=BF=A1=E6=81=AF=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/WeChatController.php | 2 +- uniapp/components/dev/dev.vue | 12 ++++- uniapp/pages.json | 2 +- uniapp/pages/gzh/login/login.vue | 57 +++++++++++++++++++++-- uniapp/pages/main/index/index.vue | 8 ++-- uniapp/pages/main/my/my.vue | 8 ++-- 6 files changed, 74 insertions(+), 15 deletions(-) diff --git a/app/Http/Controllers/WeChatController.php b/app/Http/Controllers/WeChatController.php index 3fd043d..40440bc 100644 --- a/app/Http/Controllers/WeChatController.php +++ b/app/Http/Controllers/WeChatController.php @@ -54,7 +54,7 @@ class WeChatController extends Controller $login = $this->mp_login($we_chat, $code); break; } - return $login; + return ['login' => !!$login]; } public function login_test(Request $request) diff --git a/uniapp/components/dev/dev.vue b/uniapp/components/dev/dev.vue index 157396b..78d0767 100644 --- a/uniapp/components/dev/dev.vue +++ b/uniapp/components/dev/dev.vue @@ -92,7 +92,7 @@ @@ -139,7 +139,12 @@ .dev_box_wrapper { position: fixed; + /* #ifdef MP-WEIXIN */ + bottom: 10rpx; + /* #endif */ + /* #ifdef H5 */ top: 10rpx; + /* #endif */ left: 10rpx; width: 80rpx; height: 80rpx; @@ -152,7 +157,12 @@ .dev_magic_button_wrapper { position: fixed; + /* #ifdef MP-WEIXIN */ + bottom: 0; + /* #endif */ + /* #ifdef H5 */ top: 0; + /* #endif */ left: 0; width: 30rpx; height: 30rpx; diff --git a/uniapp/pages.json b/uniapp/pages.json index 318207b..0794097 100644 --- a/uniapp/pages.json +++ b/uniapp/pages.json @@ -3,7 +3,7 @@ "path": "pages/main/index/index", "style": { "navigationBarTitleText": "鹿和开发模板", - "navigationStyle": "custom" + "navigationStyle": "custom" } }, { "path": "pages/main/my/my", diff --git a/uniapp/pages/gzh/login/login.vue b/uniapp/pages/gzh/login/login.vue index 623c416..0460488 100644 --- a/uniapp/pages/gzh/login/login.vue +++ b/uniapp/pages/gzh/login/login.vue @@ -8,18 +8,67 @@ ref } from 'vue' import { + WeChatLoginTestAction, + GzhConfig, $response } from '@/api' import { onShow } from '@dcloudio/uni-app' + + const $props = defineProps({ + code: { + type: String, + default: '' + } + }); + + const user_code = ref('') + const WeChatLoginTest = async () => { + const response = await WeChatLoginTestAction({ + code: $props.code, + app_id: GzhConfig.id + }) + $response(response, () => { + user_code.value = JSON.stringify(response.data.info, null, 4) + }) + } + + const copyContent = () => { + uni.setClipboardData({ + data: user_code.value + }) + } + + const toHome = () => { + uni.switchTab({ + url: '/pages/main/index/index' + }) + } + + onShow(() => { + WeChatLoginTest() + })