Commit a537a74c authored by nano's avatar nano

fix uc

parent 2f7b551a
......@@ -24,10 +24,6 @@ app.model(require('./models/upload'));
app.model(require('./models/auth'));
// app.model(require('./models/haha'));
// app.model(require("./models/login"));
app.model(require('./models/common'));
......@@ -42,6 +38,7 @@ app.router(require('./router'));
// 5. Start
const App = app.start();
ReactDOM.render(
<App/>,
document.getElementById('root'),
......
......@@ -27,15 +27,15 @@ export default {
subscriptions: {
setup({ dispatch }) {
let client;
const languageY = localStorage.getItem('locale') || navigator.language || (navigator.languages && navigator.languages[0]) || navigator.userLanguage;
const languageY = localStorage.getItem('locale') || navigator.language || (navigator.languages && navigator.languages[0]) || navigator.userLanguage || 'zh-CN';
const anguageWithoutRegionCode = languageY.toLowerCase().split(/[_-]+/)[0];
const language = anguageWithoutRegionCode === 'zh' ? 'zh-CN' : 'en-US';
const messages = i18n[language];
const { userAgent } = navigator;
if (userAgent.includes('Electron')) {
if (navigator.userAgent && navigator.userAgent.indexOf('Electron') > -1) {
client = 'electron';
}
......
import { message } from 'antd';
import { uploadImage } from '../services/upload';
window.onerror = (message, url, line,col, err ) => {
message.error(err.stack, 100)
}
export default {
namespace: 'upload',
......
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