From 7e4fa7d43d84b4faea0fca20ed6dc5e20637aa0e Mon Sep 17 00:00:00 2001
From: wupengfei <834520024@qq.com>
Date: 星期一, 20 十月 2025 16:36:01 +0800
Subject: [PATCH] fix: bug
---
apps/cMiniApp/src/subpackages/login/authorization/authorization.vue | 60 +++++++++++++++++++++++++++++++-----------------------------
1 files changed, 31 insertions(+), 29 deletions(-)
diff --git a/apps/cMiniApp/src/subpackages/login/authorization/authorization.vue b/apps/cMiniApp/src/subpackages/login/authorization/authorization.vue
index 8968b1a..e83d1d0 100644
--- a/apps/cMiniApp/src/subpackages/login/authorization/authorization.vue
+++ b/apps/cMiniApp/src/subpackages/login/authorization/authorization.vue
@@ -25,7 +25,8 @@
v-model="state.policyChecked"
policyBtnText="鑻ユ墜鏈哄彿鏈敞鍐岋紝灏嗕负鎮ㄧ洿鎺ユ敞鍐岃处鍙凤紝娉ㄥ唽鍗充负鍚屾剰"
/>
- <div class="other-login-channel-wrapper" v-if="!isLoginByWeb">
+ <!-- <div class="other-login-channel-wrapper" v-if="!isLoginByWeb"> -->
+ <div class="other-login-channel-wrapper" v-if="NODE_ENV === 'development'">
<nut-divider>鍏朵粬鐧诲綍鏂瑰紡</nut-divider>
<div class="other-login-channel-list">
<div class="other-login-channel-list-item" @click="goLoginByForm()">
@@ -57,11 +58,12 @@
import { CommonEventFunction, ButtonProps } from '@tarojs/components';
import Taro from '@tarojs/taro';
import { useLoginedJump } from '@/hooks';
-import * as accountServices from '@12333/services/api/Account';
import IconCaptcha from '@/assets/login/icon-btn-captcha.png';
import IconPassword from '@/assets/login/icon-btn-password.png';
import { LoginFormTabs } from '../constants';
-import { WxMiniAppEnum } from '@12333/constants';
+import * as authServices from '@12333/services/apiV2/auth';
+import { NODE_ENV } from '@/constants';
+console.log('NODE_ENV: ', NODE_ENV);
defineOptions({
name: 'authorization',
@@ -90,8 +92,8 @@
RouterPath.authorization.includes(launchOptions.path) && launchOptions.scene === 1047 && uuid
);
-const wxIndentityRes = ref<API.WxMiniAppIndentityInfo>();
-const wxMiniAppUserLoginRes = ref<API.IdentityModelTokenCacheItem>();
+const wxIndentityRes = ref<API.LoginCommandCallback>();
+const wxMiniAppUserLoginRes = ref<API.LoginCommandCallback>();
const isAccount = ref(false);
@@ -99,21 +101,21 @@
try {
let loginRes = await Taro.login();
if (isLoginByWeb.value) {
- const wxIndentity = await accountServices.getWxIndentity({
- code: loginRes.code,
- wxMiniApp: WxMiniAppEnum.C绔皬绋嬪簭,
- });
- wxIndentityRes.value = wxIndentity;
- if (wxIndentityRes.value.userName) {
- isAccount.value = true;
- }
+ // const wxIndentity = await authServices.wxmpLogin({
+ // code: loginRes.code,
+ // type: AppLocalConfig.userType,
+ // });
+ // wxIndentityRes.value = wxIndentity;
+ // if (wxIndentityRes.value.isBindPhoneNumber) {
+ // isAccount.value = true;
+ // }
} else {
- const params: API.APIwxMiniAppUserLoginParams = {
+ const params: API.WxmpLoginCommand = {
code: loginRes.code,
- wxMiniApp: WxMiniAppEnum.C绔皬绋嬪簭,
+ type: AppLocalConfig.userType,
};
- wxMiniAppUserLoginRes.value = await accountServices.wxMiniAppUserLogin(params);
- if (wxMiniAppUserLoginRes.value.accessToken) {
+ wxMiniAppUserLoginRes.value = await authServices.wxmpLogin(params);
+ if (wxMiniAppUserLoginRes.value?.isBindPhoneNumber) {
isAccount.value = true;
}
}
@@ -126,14 +128,14 @@
console.log('errMsg: ', errMsg, isLoginByWeb.value);
if (errMsg === 'getPhoneNumber:ok') {
if (isLoginByWeb.value) {
- let res = await userStore.wxMiniAppPhoneAuthLoginFromScan(
- ev.detail,
- wxIndentityRes.value,
- uuid
- );
- if (res) {
- handleLoginSuccess();
- }
+ // let res = await userStore.wxMiniAppPhoneAuthLoginFromScan(
+ // ev.detail,
+ // wxIndentityRes.value,
+ // uuid
+ // );
+ // if (res) {
+ // handleLoginSuccess();
+ // }
} else {
let res = await userStore.getTokenByPhone(ev.detail, wxMiniAppUserLoginRes.value);
if (res) {
@@ -153,10 +155,10 @@
if (state.policyChecked) {
if (isLoginByWeb.value) {
console.log('uuid: ', uuid);
- let res = await userStore.wxMiniAppUserLoginFromScan(wxIndentityRes.value, uuid);
- if (res) {
- handleLoginSuccess();
- }
+ // let res = await userStore.wxMiniAppUserLoginFromScan(wxIndentityRes.value, uuid);
+ // if (res) {
+ // handleLoginSuccess();
+ // }
} else {
userStore.loginSuccess(wxMiniAppUserLoginRes.value);
handleLoginSuccess();
--
Gitblit v1.9.1