master
parent
687172a352
commit
5d72cc4ccb
@ -0,0 +1,10 @@
|
||||
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function getSysInfo(params) {
|
||||
return request({
|
||||
url: '/api/admin/activity-info',
|
||||
method: 'get',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
import {
|
||||
getSysInfo
|
||||
} from '@/api/login'
|
||||
|
||||
const getDefaultState = () => {
|
||||
return {
|
||||
sysInfo:{}
|
||||
}
|
||||
}
|
||||
|
||||
const state = getDefaultState()
|
||||
|
||||
const mutations = {
|
||||
RESET_STATE: (state) => {
|
||||
Object.assign(state, getDefaultState())
|
||||
},
|
||||
SET_SYSINFO: (state, sysInfo) => {
|
||||
console.log(sysInfo)
|
||||
state.sysInfo = sysInfo
|
||||
}
|
||||
}
|
||||
|
||||
const actions = {
|
||||
getSysInfo({
|
||||
commit
|
||||
},domain) {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
getSysInfo({
|
||||
domain: domain.trim()
|
||||
}).then(response => { console.log(domain)
|
||||
console.log(response)
|
||||
commit('SET_SYSINFO', response)
|
||||
resolve(response)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state,
|
||||
mutations,
|
||||
actions
|
||||
}
|
||||
Loading…
Reference in new issue