import { Module , ActionTree } from 'vuex' ; import { RootState } from '@/store' ; import { MyWindow } from '~/src/types/global' ; const win = ( window as any ) as MyWindow ; export type AuthorizeState = { } ; const state = ( ) : AuthorizeState => ( { } ) ; const actions = { submit : async ( _ , request ) : Promise < string > => { let req = { sns : request . sns } ; if ( request . code ) { req = Object . assign ( req , { code : request . code . trim ( ) } ) ; } const id = await win . ipcRenderer . invoke ( 'get-and-update-access-token' , req ) ; return id ; } } ; const Authorize = { namespaced : true , state : state , mutations : { } , actions : actions } ; export default Authorize ;