소스 검색

微信登录暂时不搞

lifanagju_citu 7 달 전
부모
커밋
283a6f1af1
2개의 변경된 파일37개의 추가작업 그리고 4개의 파일을 삭제
  1. 8 0
      src/api/common/index.js
  2. 29 4
      src/views/login/index.vue

+ 8 - 0
src/api/common/index.js

@@ -338,3 +338,11 @@ export const getBusinessLicenseOCR = async (url) => {
     url: '/app-api/menduner/system/recruit/enterprise/business/ocr?url=' + url
   })
 }
+
+// 社交授权的跳转
+export const socialAuthRedirect = async (params) => {
+  return await request.get({
+    url: '/app-api/menduner/system/auth/social-auth-redirect',
+    params
+  })
+}

+ 29 - 4
src/views/login/index.vue

@@ -7,10 +7,10 @@
       </div> -->
       <div class="login-content-box my-10">
         <div class="login-tab">
-          <v-tabs v-model="tab" align-tabs="center" color="primary" class="mb-10">
+          <v-tabs v-model="tab" align-tabs="center" color="primary" class="mb-10" @update:modelValue="tabChange">
             <v-tab :value="1">验证码</v-tab>
             <v-tab :value="2">账号</v-tab>
-            <!-- <v-tab :value="3">二维码</v-tab> -->
+            <!-- <v-tab :value="3">微信</v-tab> -->
           </v-tabs>
           <v-window v-model="tab">
               <!-- 验证码登录 -->
@@ -22,10 +22,13 @@
               <passwordFrom ref="passRef" @handleEnter="handleLogin"></passwordFrom>
             </v-window-item>
             <!-- <v-window-item :value="3">
-              <div class="d-flex align-center flex-column">
+              <div v-if="showQrCode" class="d-flex align-center flex-column">
                 <span class="text-decoration-underline">微信扫描二维码进行登录</span>
                 <v-img src="https://minio.citupro.com/dev/menduner/login-qrCode.png" width="150" height="150"></v-img>
               </div>
+              <div v-else style="height: 150px; line-height: 150px; text-align: center;">
+                加载中 . . .
+              </div>
             </v-window-item> -->
           </v-window>
         </div>
@@ -54,7 +57,10 @@ import phoneFrom from '@/components/VerificationCode'
 import { useUserStore } from '@/store/user'
 import { useRouter } from 'vue-router'
 import { useI18n } from '@/hooks/web/useI18n'
-import { getEnterpriseRegisterApply } from '@/api/common'
+import {
+  getEnterpriseRegisterApply,
+  // socialAuthRedirect,
+} from '@/api/common'
 import Snackbar from '@/plugins/snackbar'
 import Confirm from '@/plugins/confirm'
 import navBar from '@/layout/personal/navBar.vue'
@@ -120,6 +126,25 @@ const handleLogin = async () => {
     loginLoading.value = false
   }
 }
+
+
+// const getSocialAuthRedirect = async () => {
+//   const params = {
+//     type: '34',
+//     redirectUri: 'https://www.baidu.com'
+//   }
+//   const res = await socialAuthRedirect(params)
+//   const otherUrl = res?.url
+//   if (otherUrl) window.open(otherUrl)
+// }
+
+// const showQrCode = ref(false)
+// const tabChange = (val) => {
+//   if (val === 3) {
+//     getSocialAuthRedirect()
+//   }
+// }
+
 </script>
 
 <style lang="scss" scoped>