Browse Source

change login params

leon 2 năm trước cách đây
mục cha
commit
4165238194
2 tập tin đã thay đổi với 15 bổ sung14 xóa
  1. 10 9
      src/pages/ChooseAuth.tsx
  2. 5 5
      src/services/user.tsx

+ 10 - 9
src/pages/ChooseAuth.tsx

@@ -43,17 +43,18 @@ export default function Page() {
     })
 
     async function login() {
-        try {
-            const { encryptedData, iv } = await Taro.getUserProfile({
-                desc: '获取用户信息',
-            });
+        dispatch(wxLogin(code) as any);
+        // try {
+        //     const { encryptedData, iv } = await Taro.getUserProfile({
+        //         desc: '获取用户信息',
+        //     });
 
-            dispatch(wxLogin(code, encryptedData, iv) as any);
+        //     dispatch(wxLogin(code, encryptedData, iv) as any);
 
-            // 在这里处理用户信息
-        } catch (error) {
-            console.log('获取用户信息失败:', error);
-        }
+        //     // 在这里处理用户信息
+        // } catch (error) {
+        //     console.log('获取用户信息失败:', error);
+        // }
     }
 
     function createAccount() {

+ 5 - 5
src/services/user.tsx

@@ -24,7 +24,7 @@ export const login = (username: string, password: string) => (dispatch: any) =>
     })
 }
 
-export const wxLogin = (code: string, encryptedData: string, iv: string) => (dispatch: any)=> {
+export const wxLogin = (code: string/*, encryptedData: string, iv: string*/) => (dispatch: any)=> {
     request({
         url: API_OAUTH_LOGIN, method: 'POST',
         data: {
@@ -33,10 +33,10 @@ export const wxLogin = (code: string, encryptedData: string, iv: string) => (dis
             app_version: '1',
             client_version: '1',
             client_type: 'WX_MP',
-            extra: {
-                encryptedData: encryptedData,
-                iv: iv
-            }
+            // extra: {
+            //     encryptedData: encryptedData,
+            //     iv: iv
+            // }
         }
     }).then(res => {
         dispatch(loginSuccess(res));