// import axios from '~plugins/axios'
//
// export const actions = {
//   // 登录选择企业
//   GetLoginStyle ({commit}, params = {}) {
//     commit('loginStyle/REQUEST_LOGIN_STYLE', params)
//     return axios.get(`/sso/login/page/style`, {params})
//       .then(response => {
//         console.log(response.data)
//         commit('loginStyle/GET_LOGIN_STYLE_SUCCESS', response.data)
//       }, err => {
//         commit('loginStyle/GET_LOGIN_STYLE_FAILURE', err)
//       })
//   }
// }

export const state = () => ({
  token: {
    data: ''
  },
  loginStyle: {
    fetching: false,
    data: {}
  },
  agreementUrl: {
    fetching: false,
    data: {}
  }
})

export const mutations = {
  GET_TOKEN (state, res) {
    state.token.data = res
  },
  REQUEST_LOGIN_STYLE (state) {
    state.loginStyle.fetching = true
  },
  REQUEST_LOGIN_STYLE_SUCCESS (state, result) {
    state.loginStyle.data = result
    state.loginStyle.fetching = false
  },
  REQUEST_LOGIN_STYLE_FAILURE (state) {
    state.loginStyle.fetching = false
  },
  REQUEST_AGREEMENT_URL (state) {
    state.agreementUrl.fetching = true
  },
  REQUEST_AGREEMENT_URL_SUCCESS (state, result) {
    state.agreementUrl.data = result
    state.agreementUrl.fetching = false
  },
  REQUEST_AGREEMENT_URL_FAILURE (state) {
    state.agreementUrl.fetching = false
  }
}
