Commit c3be29a1 authored by GuanHua's avatar GuanHua

delete: 删除多余store

parent 487edb8f
import {action, computed, observable, runInAction, autorun} from 'mobx'
import { IGlobalSelectModule } from '@/module/globalSelectModule'
import { getAllCountrys, getAllCurrencys, getAllLanguages, getAllShops } from '@/services/global'
import { getAsyncSelectList } from '@/utils'
class GlobalSelectStore implements IGlobalSelectModule {
@observable public allCountrys: GlobalAPI.CountryItem[] = []
@observable public allCurrencys: GlobalAPI.CurrencyItem[] = []
@observable public allLanguages: GlobalAPI.LanguageItem[] = []
@observable public allShops: GlobalAPI.ShopItem[] = []
@action.bound
async initData() {
const [countryResult, currentyResult, languageResult, shopResult] = await getAsyncSelectList([
getAllCountrys(),
getAllCurrencys(),
getAllLanguages(),
getAllShops()
])
runInAction('reset all GlobalSelect', () => {
this.allCountrys = countryResult || []
this.allCurrencys = currentyResult || []
this.allLanguages = languageResult || []
this.allShops = shopResult || []
})
}
}
export default GlobalSelectStore
\ No newline at end of file
import TestStore from './test'
import React from 'react';
import { Provider } from 'mobx-react'
import GlobalSelectStore from './globalSelect';
import SiteStore from './site'
import MemberStore from './member'
import UserStore from './user'
......@@ -34,7 +33,6 @@ export interface IStore {
export const store = {
UserStore: new UserStore,
testStore: new TestStore,
globalStore: new GlobalSelectStore,
SiteStore: new SiteStore,
MemberStore: new MemberStore,
indexStore: new GlobalStore,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment