diff --git a/babel.config.js b/babel.config.js index e9ed33b..43e33d4 100644 --- a/babel.config.js +++ b/babel.config.js @@ -7,5 +7,5 @@ module.exports = { presets: [ '@vue/cli-plugin-babel/preset' ], - plugins: [...build] + plugins: [] } diff --git a/src/api/index.ts b/src/api/index.ts index 69c94b0..ba392bd 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -1187,4 +1187,18 @@ export async function setusername(src: string){ export async function logoutapi() { await get("logout"); -} \ No newline at end of file +} + +export async function authLogin(id:number, type: number, img: string = "") { + const res = await post("authLogin",{ + uid: id, + type: 1, + login_type: type, + img: img + }) + if(res.code == 0){ + return res.data + }else{ + message.error(res.msg); + } +} diff --git a/src/views/login/Login.vue b/src/views/login/Login.vue index 09356ad..30b9cc8 100644 --- a/src/views/login/Login.vue +++ b/src/views/login/Login.vue @@ -120,7 +120,7 @@ import { computed, defineComponent, onMounted, reactive, ref } from "vue"; import LoginTab from "@/components/login/LoginTab.vue"; import NavTop from "@/components/NavTop.vue" -import { checksmscode, checkuser, getquhaolist, getwebvideolist, loginpass, sendsms } from '@/api'; +import { authLogin, checksmscode, checkuser, getquhaolist, getwebvideolist, loginpass, sendsms } from '@/api'; import { message } from 'ant-design-vue'; import router from '@/router'; import { useI18n } from '@/utils/i18n'; @@ -271,6 +271,7 @@ export default defineComponent({ window.FB.login(function(response: any){ console.log(response, 121212) // handle the response + authLogin(response.authResponse.userID, index) }); }