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() + })