import Cookie from 'js-cookie'
import action from '../pvStatisticalService'

export default async function({token, onFinished} = {token: ''}) {
  token && Cookie.set('token', token, { expires: 10 });
  await action()
  onFinished && onFinished()
  return this
}