fix fetch error
This commit is contained in:
parent
b5843cc086
commit
85641755a3
@ -1,6 +1,7 @@
|
||||
import Vue from 'vue'
|
||||
import Vuex from 'vuex'
|
||||
import fetch from '@/utils/fetch'
|
||||
import { Message } from 'element-ui'
|
||||
Vue.use(Vuex)
|
||||
|
||||
const state = {
|
||||
@ -17,8 +18,9 @@ const actions = {
|
||||
async fetchServerInfo({ commit }) {
|
||||
const res = await fetch('serverinfo')
|
||||
if (!res.ok) {
|
||||
this.$message.warning('Get server info from frps failed!')
|
||||
Message.warning('Get server info from frps failed!')
|
||||
commit('SET_SERVER_INFO', null)
|
||||
return
|
||||
}
|
||||
|
||||
commit('SET_SERVER_INFO', (await res.json()) || null)
|
||||
|
Loading…
Reference in New Issue
Block a user