Commit 6d1987d7 authored by 邓晓峰's avatar 邓晓峰

fix: 修复切换数据库后登陆BUG

parent 90f06049
......@@ -33,11 +33,11 @@ module.exports = {
exclude: [],
},
proxy: proxy[REACT_APP_ENV || 'dev'],
openAPI: {
requestLibPath: "import { request } from '@wisdom-utils/utils'",
schemaPath: 'http://192.168.10.150:8777/Publish/OMS/swagger/v1/swagger.json',
mock: false,
},
// openAPI: {
// requestLibPath: "import { request } from '@wisdom-utils/utils'",
// schemaPath: 'http://192.168.10.150:8777/Publish/OMS/swagger/v1/swagger.json',
// mock: false,
// },
postcssLoader: {},
styleLoader: {},
cssLoader: {
......
......@@ -4,10 +4,10 @@ export function genActiveRule(routerPrefix) {
export default {
dev: [
{
name: 'civ_monitor',
entry: `//${window.location.hostname}:8080/civ_monitor`,
name: 'civ_energy',
entry: `//${window.location.hostname}:8081/civ_energy`,
container: '#micro-container',
activeRule: '/civbase/civ_monitor',
activeRule: '/civbase/civ_energy',
},
{
name: 'civ_water',
......
......@@ -83,11 +83,13 @@ const { getSchema } = require('./openapi');
emitter.on('onDevCompileDone', async () => {
try {
const openAPIConfig = config.openAPI;
const openAPIJson = await getSchema(openAPIConfig.schemaPath);
writeFileSync(
join(openAPIFilesPath, 'civ-plugins_openapi.json'),
JSON.stringify(openAPIJson, null, 2),
);
if(openAPIConfig && openAPIConfig.schemaPath) {
const openAPIJson = await getSchema(openAPIConfig.schemaPath);
writeFileSync(
join(openAPIFilesPath, 'civ-plugins_openapi.json'),
JSON.stringify(openAPIJson, null, 2),
);
}
} catch (error) {
console.error(error);
}
......
......@@ -155,6 +155,8 @@ const initGlobalConfig = () => {
// eslint-disable-next-line no-shadow
updateConfig: data =>
store.dispatch(actionCreators.getConfig(data)),
isInit: false,
logout: () => store.dispatch(actionCreators.logout())
},
() => {
(async () => {
......
......@@ -540,6 +540,7 @@ const BasicLayout = props => {
);
}, [location.pathname]);
const handleSelectedKey = item => {
debugger
const config = findPathByLeafId(
item.path,
currentRoutes.routes,
......
......@@ -388,6 +388,7 @@ class Site {
beforeChangeCheck(token, site) {
// eslint-disable-next-line no-undef
debugger
appService
.getUserInfo({
token,
......
......@@ -17,6 +17,7 @@ import { SlideVerify } from '@wisdom-utils/components';
const Logger = logger('login');
class Login {
constructor(props, callback, isInit) {
debugger
this.events = window.share.event;
this.globalConfig = props.global;
this.updateConfig = props.updateConfig;
......@@ -24,6 +25,7 @@ class Login {
this.history = props.history;
this.callback = callback;
this.hasTry = false;
this.logout = props.logout;
if (isInit) {
this.init();
}
......@@ -70,6 +72,7 @@ class Login {
this.globalConfig.token = token;
const self = this;
// eslint-disable-next-line no-undef
appService
.getUserInfo({
token: this.globalConfig.token,
......@@ -79,6 +82,7 @@ class Login {
ignoreSite: true,
})
.then(response => {
debugger
if (response && !response.errMsg) {
self.globalConfig.userInfo = {};
if (
......@@ -95,6 +99,16 @@ class Login {
);
self.updateConfig && self.updateConfig(self.globalConfig);
self.getUserInfoAndConfig();
} else {
self.logout && self.logout();
if (
self.globalConfig.style === 'ios' &&
self.globalConfig.loginTemplate === 'IOSCloud.html'
) {
window.location.href = `${window.location.origin}`;
return false;
}
window.location.reload();
}
});
}
......
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