This commit is contained in:
saplf
2019-09-08 13:03:43 +08:00
parent b004908af9
commit 5351afaae3
25 changed files with 263 additions and 14 deletions

View File

@@ -1,8 +1,10 @@
import { Model } from 'dva';
import { delay } from 'dva/saga';
import _ from 'lodash';
import { getLocale, setLocale } from 'umi-plugin-locale'
import { loadUser, storeUser, clearUser, clearMineList, clearCoins, clearDrawCoins } from '@/utils/storage';
import { User } from '@/types/common';
import { isApp, restart } from '@/utils/h5plus';
const initState = () => {
const user = loadUser();
@@ -55,7 +57,7 @@ const model: Model = {
},
*changeLang({ payload: lang }, { put }) {
setLocale(lang);
setLocale(lang, false);
yield put({ type: 'onUpdateState', payload: { lang } });
},
},