|
@@ -6,6 +6,7 @@ import { getLocalToken, removeLocalToken, saveLocalToken } from "@/utils";
|
|
|
import type { AppNotification } from '@/interfaces';
|
|
|
import type { IUserProfile, IUserProfileCreate, IUserProfileUpdate, MainState, Video, VideoCreate } from '@/interfaces';
|
|
|
import i18n from '@/plugins/i18n'
|
|
|
+import { GoogleLogin } from "vue3-google-login";
|
|
|
|
|
|
const defaultState: MainState = {
|
|
|
isLoggedIn: null,
|
|
@@ -265,6 +266,16 @@ export const useMainStore = defineStore("MainStoreId", {
|
|
|
await mainStore.checkApiError(error);
|
|
|
}
|
|
|
},
|
|
|
+ async googleLogin(access_token:string) {
|
|
|
+ try{
|
|
|
+ const response = await api.googleLogin(access_token)
|
|
|
+ if (response) {
|
|
|
+ console.log(response)
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ await this.checkApiError(error)
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
|