Commit a537a74c authored by nano's avatar nano

fix uc

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