Commit 3084af57 authored by 叶飞's avatar 叶飞

fix web4

parents 4f6e5aec 3572b06d
This diff was suppressed by a .gitattributes entry.
export default {
navTheme: 'dark',
layout: 'side',
contentWidth: 'Fluid',
fixedHeader: false,
fixSiderbar: false,
menu: {
locale: true,
},
headerHeight: 48,
title: '熊猫智慧城市监控管理解决方案',
iconfontUrl: '',
primaryColor: '#1890ff',
};
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _default = {
navTheme: 'dark',
layout: 'side',
contentWidth: 'Fluid',
fixedHeader: false,
fixSiderbar: false,
menu: {
locale: true
},
headerHeight: 48,
title: '熊猫智慧城市监控管理解决方案',
iconfontUrl: '',
primaryColor: '#1890ff'
};
exports["default"] = _default;
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
function genActiveRule(routerPrefix) {
return function (location) {
return location.pathname.startsWith(routerPrefix);
};
}
var _default = {
dev: [{
name: 'web4_console',
entry: "//".concat(window.location.hostname, ":3020/civweb4"),
container: '#micro-container',
activeRule: genActiveRule('/civbase/civweb4'),
props: {}
}, {
name: 'civweb5',
entry: "//".concat(window.location.hostname, ":3008/civbase/civweb5"),
container: '#micro-container',
activeRule: genActiveRule('/civbase/civweb5')
}],
prod: [{
name: 'web4_console',
entry: "//".concat(window.location.host, "/civweb4"),
container: '#micro-container',
activeRule: genActiveRule('/civbase/civweb4'),
props: {}
}, {
name: 'civweb5',
entry: "//".concat(window.location.host, "/civweb5"),
container: '#micro-container',
activeRule: genActiveRule('/civbase/civweb5')
}]
};
exports["default"] = _default;
\ No newline at end of file
......@@ -3,7 +3,7 @@
module.exports = {
dev: {
'/CityInterface': {
target: 'http://192.168.10.150:8050',
target: 'http://192.168.10.151:8055',
// target: 'https://panda-water.cn',
// target: 'http://192.168.19.103:8112',
// target: 'http://192.168.12.8:8098',
......
function genActiveRule(routerPrefix) {
return location => location.pathname.startsWith(routerPrefix);
}
export default {
dev: [
{
name: 'web4_console',
entry: `//${window.location.hostname}:3020/civweb4`,
container: '#micro-container',
activeRule: genActiveRule('/civbase/civweb4'),
props: {},
},
{
name: 'civweb5',
entry: `//${window.location.hostname}:3008/civbase/civweb5`,
container: '#micro-container',
activeRule: genActiveRule('/civbase/civweb5'),
},
],
prod: [
{
name: 'web4_console',
entry: `//${window.location.host}/civweb4`,
container: '#micro-container',
activeRule: genActiveRule('/civbase/civweb4'),
props: {},
},
{
name: 'civweb5',
entry: `//${window.location.host}/civweb5`,
container: '#micro-container',
activeRule: genActiveRule('/civbase/civweb5'),
},
],
};
module.exports = {
dev: {
'/CityInterface': {
// target: 'http://192.168.10.150:8050',
// target: 'http://192.168.10.151:8055',
target: 'https://panda-water.cn',
// target: 'http://192.168.19.103:8112',
// target: 'http://192.168.12.8:8098',
......
/**
*
* Tests for {{ properCase name }}
*
* @see https://github.com/react-boilerplate/react-boilerplate/tree/master/docs/testing
*
*/
*
* Tests for {{ properCase name }}
*
*
*/
import React from 'react';
import { render } from 'react-testing-library';
......@@ -18,44 +17,47 @@ import {{ properCase name }} from '../index';
import { DEFAULT_LOCALE } from '../../../i18n';
{{/if}}
describe('<{{ properCase name }} />', () => {
it('Expect to not log errors in console', () => {
const spy = jest.spyOn(global.console, 'error');
describe('
<{{ properCase name }} />', () => {
it('Expect to not log errors in console', () => {
const spy = jest.spyOn(global.console, 'error');
{{#if wantMessages}}
render(
<IntlProvider locale={DEFAULT_LOCALE}>
render(
<IntlProvider locale={DEFAULT_LOCALE}>
<{{ properCase name }} />
</IntlProvider>,
);
</IntlProvider>,
);
{{else}}
render(<{{ properCase name }} />);
render(
<{{ properCase name }} />);
{{/if}}
expect(spy).not.toHaveBeenCalled();
});
expect(spy).not.toHaveBeenCalled();
});
it('Expect to have additional unit tests specified', () => {
expect(true).toEqual(false);
});
it('Expect to have additional unit tests specified', () => {
expect(true).toEqual(false);
});
/**
* Unskip this test to use it
*
* @see {@link https://jestjs.io/docs/en/api#testskipname-fn}
*/
it.skip('Should render and match the snapshot', () => {
/**
* Unskip this test to use it
*
* @see {@link https://jestjs.io/docs/en/api#testskipname-fn}
*/
it.skip('Should render and match the snapshot', () => {
{{#if wantMessages}}
const {
container: { firstChild },
} = render(
<IntlProvider locale={DEFAULT_LOCALE}>
const {
container: { firstChild },
} = render(
<IntlProvider locale={DEFAULT_LOCALE}>
<{{ properCase name }} />
</IntlProvider>,
);
</IntlProvider>,
);
{{else}}
const {
container: { firstChild },
} = render(<{{ properCase name }} />);
const {
container: { firstChild },
} = render(
<{{ properCase name }} />);
{{/if}}
expect(firstChild).toMatchSnapshot();
});
expect(firstChild).toMatchSnapshot();
});
});
\ No newline at end of file
/**
*
* Tests for {{ properCase name }}
*
* @see https://github.com/react-boilerplate/react-boilerplate/tree/master/docs/testing
*
*/
*
* Tests for {{ properCase name }}
*
*
*/
import React from 'react';
import { render } from 'react-testing-library';
......@@ -18,45 +17,48 @@ import { {{ properCase name }} } from '../index';
import { DEFAULT_LOCALE } from '../../../i18n';
{{/if}}
describe('<{{ properCase name }} />', () => {
it('Expect to not log errors in console', () => {
const spy = jest.spyOn(global.console, 'error');
const dispatch = jest.fn();
describe('
<{{ properCase name }} />', () => {
it('Expect to not log errors in console', () => {
const spy = jest.spyOn(global.console, 'error');
const dispatch = jest.fn();
{{#if wantMessages}}
render(
<IntlProvider locale={DEFAULT_LOCALE}>
render(
<IntlProvider locale={DEFAULT_LOCALE}>
<{{ properCase name }} dispatch={dispatch} />
</IntlProvider>,
);
</IntlProvider>,
);
{{else}}
render(<{{ properCase name }} dispatch={dispatch} />);
render(
<{{ properCase name }} dispatch={dispatch} />);
{{/if}}
expect(spy).not.toHaveBeenCalled();
});
expect(spy).not.toHaveBeenCalled();
});
it('Expect to have additional unit tests specified', () => {
expect(true).toEqual(false);
});
it('Expect to have additional unit tests specified', () => {
expect(true).toEqual(false);
});
/**
* Unskip this test to use it
*
* @see {@link https://jestjs.io/docs/en/api#testskipname-fn}
*/
it.skip('Should render and match the snapshot', () => {
/**
* Unskip this test to use it
*
* @see {@link https://jestjs.io/docs/en/api#testskipname-fn}
*/
it.skip('Should render and match the snapshot', () => {
{{#if wantMessages}}
const {
container: { firstChild },
} = render(
<IntlProvider locale={DEFAULT_LOCALE}>
const {
container: { firstChild },
} = render(
<IntlProvider locale={DEFAULT_LOCALE}>
<{{ properCase name }} />
</IntlProvider>,
);
</IntlProvider>,
);
{{else}}
const {
container: { firstChild },
} = render(<{{ properCase name }} />);
const {
container: { firstChild },
} = render(
<{{ properCase name }} />);
{{/if}}
expect(firstChild).toMatchSnapshot();
});
expect(firstChild).toMatchSnapshot();
});
});
\ No newline at end of file
......@@ -8,6 +8,10 @@ var slash = require('slash2');
var pkg = require('../../package.json');
var CopyPlugin = require('copy-webpack-plugin');
var ASSET_PATH = process.env.ASSET_PATH || '/';
module.exports = function (options) {
return {
mode: options.mode,
......@@ -136,7 +140,12 @@ module.exports = function (options) {
// drop any unreachable code.
new webpack.EnvironmentPlugin({
NODE_ENV: 'development'
})]),
}), new webpack.DefinePlugin({
'process.env.ASSET_PATH': JSON.stringify(ASSET_PATH)
}), new CopyPlugin([{
from: path.resolve(process.cwd(), 'theme'),
to: path.resolve(process.cwd(), "".concat(pkg.name.toLocaleLowerCase(), "/theme"))
}])]),
resolve: {
modules: ['node_modules', 'src'],
extensions: ['.js', '.jsx', '.react.js'],
......
......@@ -2,7 +2,9 @@ const path = require('path');
const webpack = require('webpack');
const slash = require('slash2');
const pkg = require('../../package.json');
module.exports = (options) => ({
const CopyPlugin = require('copy-webpack-plugin');
const ASSET_PATH = process.env.ASSET_PATH || '/';
module.exports = options => ({
mode: options.mode,
entry: options.entry,
output: Object.assign(
......@@ -60,8 +62,8 @@ module.exports = (options) => ({
const antdProPath = match[1].replace('.less', '');
const arr = slash(antdProPath)
.split('/')
.map((a) => a.replace(/([A-Z])/g, '-$1'))
.map((a) => a.toLowerCase());
.map(a => a.replace(/([A-Z])/g, '-$1'))
.map(a => a.toLowerCase());
return `panda-pro${arr.join('-')}-${localName}`.replace(
/--/g,
'-',
......@@ -159,6 +161,18 @@ module.exports = (options) => ({
new webpack.EnvironmentPlugin({
NODE_ENV: 'development',
}),
new webpack.DefinePlugin({
'process.env.ASSET_PATH': JSON.stringify(ASSET_PATH),
}),
new CopyPlugin([
{
from: path.resolve(process.cwd(), 'theme'),
to: path.resolve(
process.cwd(),
`${pkg.name.toLocaleLowerCase()}/theme`,
),
},
]),
]),
resolve: {
modules: ['node_modules', 'src'],
......
......@@ -178,6 +178,12 @@
"rc-util": "^5.0.1"
}
},
"@ant-design/pro-skeleton": {
"version": "1.0.0-beta.2",
"resolved": "https://g.civnet.cn:4873/@ant-design%2fpro-skeleton/-/pro-skeleton-1.0.0-beta.2.tgz",
"integrity": "sha1-710i+vyVxVm5DnGXg0Pq5+eGkCw=",
"dev": true
},
"@ant-design/pro-table": {
"version": "2.9.13",
"resolved": "https://g.civnet.cn:4873/@ant-design%2fpro-table/-/pro-table-2.9.13.tgz",
......@@ -4606,6 +4612,12 @@
"source-map": "^0.5.0"
}
},
"@nodelib/fs.stat": {
"version": "2.0.3",
"resolved": "https://g.civnet.cn:4873/@nodelib%2ffs.stat/-/fs.stat-2.0.3.tgz",
"integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==",
"dev": true
},
"@types/webpack": {
"version": "4.41.22",
"resolved": "https://g.civnet.cn:4873/@types%2fwebpack/-/webpack-4.41.22.tgz",
......@@ -4634,6 +4646,12 @@
"integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==",
"dev": true
},
"array-union": {
"version": "2.1.0",
"resolved": "https://g.civnet.cn:4873/array-union/-/array-union-2.1.0.tgz",
"integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==",
"dev": true
},
"babel-loader": {
"version": "8.1.0",
"resolved": "https://g.civnet.cn:4873/babel-loader/-/babel-loader-8.1.0.tgz",
......@@ -4660,6 +4678,15 @@
}
}
},
"braces": {
"version": "3.0.2",
"resolved": "https://g.civnet.cn:4873/braces/-/braces-3.0.2.tgz",
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
"dev": true,
"requires": {
"fill-range": "^7.0.1"
}
},
"cacache": {
"version": "15.0.5",
"resolved": "https://g.civnet.cn:4873/cacache/-/cacache-15.0.5.tgz",
......@@ -4699,6 +4726,75 @@
"integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==",
"dev": true
},
"copy-webpack-plugin": {
"version": "6.1.0",
"resolved": "https://g.civnet.cn:4873/copy-webpack-plugin/-/copy-webpack-plugin-6.1.0.tgz",
"integrity": "sha512-aWjIuLt1OVQxaDVffnt3bnGmLA8zGgAJaFwPA+a+QYVPh1vhIKjVfh3SbOFLV0kRPvGBITbw17n5CsmiBS4LQQ==",
"dev": true,
"requires": {
"cacache": "^15.0.5",
"fast-glob": "^3.2.4",
"find-cache-dir": "^3.3.1",
"glob-parent": "^5.1.1",
"globby": "^11.0.1",
"loader-utils": "^2.0.0",
"normalize-path": "^3.0.0",
"p-limit": "^3.0.2",
"schema-utils": "^2.7.1",
"serialize-javascript": "^4.0.0",
"webpack-sources": "^1.4.3"
},
"dependencies": {
"find-cache-dir": {
"version": "3.3.1",
"resolved": "https://g.civnet.cn:4873/find-cache-dir/-/find-cache-dir-3.3.1.tgz",
"integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==",
"dev": true,
"requires": {
"commondir": "^1.0.1",
"make-dir": "^3.0.2",
"pkg-dir": "^4.1.0"
}
},
"loader-utils": {
"version": "2.0.0",
"resolved": "https://g.civnet.cn:4873/loader-utils/-/loader-utils-2.0.0.tgz",
"integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==",
"dev": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
},
"make-dir": {
"version": "3.1.0",
"resolved": "https://g.civnet.cn:4873/make-dir/-/make-dir-3.1.0.tgz",
"integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==",
"dev": true,
"requires": {
"semver": "^6.0.0"
}
},
"schema-utils": {
"version": "2.7.1",
"resolved": "https://g.civnet.cn:4873/schema-utils/-/schema-utils-2.7.1.tgz",
"integrity": "sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==",
"dev": true,
"requires": {
"@types/json-schema": "^7.0.5",
"ajv": "^6.12.4",
"ajv-keywords": "^3.5.2"
}
},
"semver": {
"version": "6.3.0",
"resolved": "https://g.civnet.cn:4873/semver/-/semver-6.3.0.tgz",
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
"dev": true
}
}
},
"css-loader": {
"version": "3.6.0",
"resolved": "https://g.civnet.cn:4873/css-loader/-/css-loader-3.6.0.tgz",
......@@ -4748,6 +4844,15 @@
"ms": "2.1.2"
}
},
"dir-glob": {
"version": "3.0.1",
"resolved": "https://g.civnet.cn:4873/dir-glob/-/dir-glob-3.0.1.tgz",
"integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==",
"dev": true,
"requires": {
"path-type": "^4.0.0"
}
},
"eslint-scope": {
"version": "4.0.3",
"resolved": "https://g.civnet.cn:4873/eslint-scope/-/eslint-scope-4.0.3.tgz",
......@@ -4758,6 +4863,32 @@
"estraverse": "^4.1.1"
}
},
"fast-glob": {
"version": "3.2.4",
"resolved": "https://g.civnet.cn:4873/fast-glob/-/fast-glob-3.2.4.tgz",
"integrity": "sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ==",
"dev": true,
"requires": {
"@nodelib/fs.stat": "^2.0.2",
"@nodelib/fs.walk": "^1.2.3",
"glob-parent": "^5.1.0",
"merge2": "^1.3.0",
"micromatch": "^4.0.2",
"picomatch": "^2.2.1"
},
"dependencies": {
"micromatch": {
"version": "4.0.2",
"resolved": "https://g.civnet.cn:4873/micromatch/-/micromatch-4.0.2.tgz",
"integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==",
"dev": true,
"requires": {
"braces": "^3.0.1",
"picomatch": "^2.0.5"
}
}
}
},
"file-loader": {
"version": "6.1.0",
"resolved": "https://g.civnet.cn:4873/file-loader/-/file-loader-6.1.0.tgz",
......@@ -4792,6 +4923,15 @@
}
}
},
"fill-range": {
"version": "7.0.1",
"resolved": "https://g.civnet.cn:4873/fill-range/-/fill-range-7.0.1.tgz",
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
"dev": true,
"requires": {
"to-regex-range": "^5.0.1"
}
},
"find-up": {
"version": "4.1.0",
"resolved": "https://g.civnet.cn:4873/find-up/-/find-up-4.1.0.tgz",
......@@ -4802,6 +4942,41 @@
"path-exists": "^4.0.0"
}
},
"glob-parent": {
"version": "5.1.1",
"resolved": "https://g.civnet.cn:4873/glob-parent/-/glob-parent-5.1.1.tgz",
"integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==",
"dev": true,
"requires": {
"is-glob": "^4.0.1"
}
},
"globby": {
"version": "11.0.1",
"resolved": "https://g.civnet.cn:4873/globby/-/globby-11.0.1.tgz",
"integrity": "sha512-iH9RmgwCmUJHi2z5o2l3eTtGBtXek1OYlHrbcxOYugyHLmAsZrPj43OtHThd62Buh/Vv6VyCBD2bdyWcGNQqoQ==",
"dev": true,
"requires": {
"array-union": "^2.1.0",
"dir-glob": "^3.0.1",
"fast-glob": "^3.1.1",
"ignore": "^5.1.4",
"merge2": "^1.3.0",
"slash": "^3.0.0"
}
},
"ignore": {
"version": "5.1.8",
"resolved": "https://g.civnet.cn:4873/ignore/-/ignore-5.1.8.tgz",
"integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==",
"dev": true
},
"is-number": {
"version": "7.0.0",
"resolved": "https://g.civnet.cn:4873/is-number/-/is-number-7.0.0.tgz",
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
"dev": true
},
"is-wsl": {
"version": "1.1.0",
"resolved": "https://g.civnet.cn:4873/is-wsl/-/is-wsl-1.1.0.tgz",
......@@ -4959,6 +5134,12 @@
"randombytes": "^2.1.0"
}
},
"slash": {
"version": "3.0.0",
"resolved": "https://g.civnet.cn:4873/slash/-/slash-3.0.0.tgz",
"integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==",
"dev": true
},
"ssri": {
"version": "8.0.0",
"resolved": "https://g.civnet.cn:4873/ssri/-/ssri-8.0.0.tgz",
......@@ -5064,6 +5245,15 @@
}
}
},
"to-regex-range": {
"version": "5.0.1",
"resolved": "https://g.civnet.cn:4873/to-regex-range/-/to-regex-range-5.0.1.tgz",
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
"dev": true,
"requires": {
"is-number": "^7.0.0"
}
},
"url-loader": {
"version": "4.1.0",
"resolved": "https://g.civnet.cn:4873/url-loader/-/url-loader-4.1.0.tgz",
......@@ -6090,6 +6280,19 @@
}
}
},
"@umijs/hooks": {
"version": "1.9.3",
"resolved": "https://g.civnet.cn:4873/@umijs%2fhooks/-/hooks-1.9.3.tgz",
"integrity": "sha1-zA3p6DJxTgPBM4q6F5aa7S0pr9c=",
"dev": true,
"requires": {
"@umijs/use-request": "^1.4.3",
"intersection-observer": "^0.7.0",
"lodash.isequal": "^4.5.0",
"resize-observer-polyfill": "^1.5.1",
"screenfull": "^5.0.0"
}
},
"@umijs/plugin-analytics": {
"version": "0.2.2",
"resolved": "https://g.civnet.cn:4873/@umijs%2fplugin-analytics/-/plugin-analytics-0.2.2.tgz",
......@@ -6995,6 +7198,17 @@
"webpack-chain": "6.5.1"
}
},
"@umijs/use-request": {
"version": "1.4.3",
"resolved": "https://g.civnet.cn:4873/@umijs%2fuse-request/-/use-request-1.4.3.tgz",
"integrity": "sha1-vF+txMsH15brNfCYONahXLEoAvc=",
"dev": true,
"requires": {
"lodash.debounce": "^4.0.8",
"lodash.throttle": "^4.1.1",
"umi-request": "^1.2.17"
}
},
"@umijs/utils": {
"version": "3.2.24",
"resolved": "https://g.civnet.cn:4873/@umijs%2futils/-/utils-3.2.24.tgz",
......@@ -10299,329 +10513,115 @@
"integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==",
"dev": true,
"requires": {
"safe-buffer": "~5.1.1"
}
},
"cookie": {
"version": "0.3.1",
"resolved": "https://g.civnet.cn:4873/cookie/-/cookie-0.3.1.tgz",
"integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s="
},
"cookie-signature": {
"version": "1.0.6",
"resolved": "https://g.civnet.cn:4873/cookie-signature/-/cookie-signature-1.0.6.tgz",
"integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw="
},
"copy-concurrently": {
"version": "1.0.5",
"resolved": "https://g.civnet.cn:4873/copy-concurrently/-/copy-concurrently-1.0.5.tgz",
"integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==",
"dev": true,
"requires": {
"aproba": "^1.1.1",
"fs-write-stream-atomic": "^1.0.8",
"iferr": "^0.1.5",
"mkdirp": "^0.5.1",
"rimraf": "^2.5.4",
"run-queue": "^1.0.0"
}
},
"copy-descriptor": {
"version": "0.1.1",
"resolved": "https://g.civnet.cn:4873/copy-descriptor/-/copy-descriptor-0.1.1.tgz",
"integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=",
"dev": true
},
"copy-to-clipboard": {
"version": "3.3.1",
"resolved": "https://g.civnet.cn:4873/copy-to-clipboard/-/copy-to-clipboard-3.3.1.tgz",
"integrity": "sha512-i13qo6kIHTTpCm8/Wup+0b1mVWETvu2kIMzKoK8FpkLkFxlt0znUAHcMzox+T8sPlqtZXq3CulEjQHsYiGFJUw==",
"dev": true,
"requires": {
"toggle-selection": "^1.0.6"
}
},
"copy-webpack-plugin": {
"version": "6.1.0",
"resolved": "https://g.civnet.cn:4873/copy-webpack-plugin/-/copy-webpack-plugin-6.1.0.tgz",
"integrity": "sha512-aWjIuLt1OVQxaDVffnt3bnGmLA8zGgAJaFwPA+a+QYVPh1vhIKjVfh3SbOFLV0kRPvGBITbw17n5CsmiBS4LQQ==",
"dev": true,
"requires": {
"cacache": "^15.0.5",
"fast-glob": "^3.2.4",
"find-cache-dir": "^3.3.1",
"glob-parent": "^5.1.1",
"globby": "^11.0.1",
"loader-utils": "^2.0.0",
"normalize-path": "^3.0.0",
"p-limit": "^3.0.2",
"schema-utils": "^2.7.1",
"serialize-javascript": "^4.0.0",
"webpack-sources": "^1.4.3"
},
"dependencies": {
"@nodelib/fs.stat": {
"version": "2.0.3",
"resolved": "https://g.civnet.cn:4873/@nodelib%2ffs.stat/-/fs.stat-2.0.3.tgz",
"integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==",
"dev": true
},
"array-union": {
"version": "2.1.0",
"resolved": "https://g.civnet.cn:4873/array-union/-/array-union-2.1.0.tgz",
"integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==",
"dev": true
},
"braces": {
"version": "3.0.2",
"resolved": "https://g.civnet.cn:4873/braces/-/braces-3.0.2.tgz",
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
"dev": true,
"requires": {
"fill-range": "^7.0.1"
}
},
"cacache": {
"version": "15.0.5",
"resolved": "https://g.civnet.cn:4873/cacache/-/cacache-15.0.5.tgz",
"integrity": "sha512-lloiL22n7sOjEEXdL8NAjTgv9a1u43xICE9/203qonkZUCj5X1UEWIdf2/Y0d6QcCtMzbKQyhrcDbdvlZTs/+A==",
"dev": true,
"requires": {
"@npmcli/move-file": "^1.0.1",
"chownr": "^2.0.0",
"fs-minipass": "^2.0.0",
"glob": "^7.1.4",
"infer-owner": "^1.0.4",
"lru-cache": "^6.0.0",
"minipass": "^3.1.1",
"minipass-collect": "^1.0.2",
"minipass-flush": "^1.0.5",
"minipass-pipeline": "^1.2.2",
"mkdirp": "^1.0.3",
"p-map": "^4.0.0",
"promise-inflight": "^1.0.1",
"rimraf": "^3.0.2",
"ssri": "^8.0.0",
"tar": "^6.0.2",
"unique-filename": "^1.1.1"
}
},
"chownr": {
"version": "2.0.0",
"resolved": "https://g.civnet.cn:4873/chownr/-/chownr-2.0.0.tgz",
"integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==",
"dev": true
},
"dir-glob": {
"version": "3.0.1",
"resolved": "https://g.civnet.cn:4873/dir-glob/-/dir-glob-3.0.1.tgz",
"integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==",
"dev": true,
"requires": {
"path-type": "^4.0.0"
}
},
"fast-glob": {
"version": "3.2.4",
"resolved": "https://g.civnet.cn:4873/fast-glob/-/fast-glob-3.2.4.tgz",
"integrity": "sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ==",
"dev": true,
"requires": {
"@nodelib/fs.stat": "^2.0.2",
"@nodelib/fs.walk": "^1.2.3",
"glob-parent": "^5.1.0",
"merge2": "^1.3.0",
"micromatch": "^4.0.2",
"picomatch": "^2.2.1"
}
},
"fill-range": {
"version": "7.0.1",
"resolved": "https://g.civnet.cn:4873/fill-range/-/fill-range-7.0.1.tgz",
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
"dev": true,
"requires": {
"to-regex-range": "^5.0.1"
}
},
"find-cache-dir": {
"version": "3.3.1",
"resolved": "https://g.civnet.cn:4873/find-cache-dir/-/find-cache-dir-3.3.1.tgz",
"integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==",
"dev": true,
"requires": {
"commondir": "^1.0.1",
"make-dir": "^3.0.2",
"pkg-dir": "^4.1.0"
}
},
"find-up": {
"version": "4.1.0",
"resolved": "https://g.civnet.cn:4873/find-up/-/find-up-4.1.0.tgz",
"integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
"dev": true,
"requires": {
"locate-path": "^5.0.0",
"path-exists": "^4.0.0"
}
},
"glob-parent": {
"version": "5.1.1",
"resolved": "https://g.civnet.cn:4873/glob-parent/-/glob-parent-5.1.1.tgz",
"integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==",
"dev": true,
"requires": {
"is-glob": "^4.0.1"
}
},
"globby": {
"version": "11.0.1",
"resolved": "https://g.civnet.cn:4873/globby/-/globby-11.0.1.tgz",
"integrity": "sha512-iH9RmgwCmUJHi2z5o2l3eTtGBtXek1OYlHrbcxOYugyHLmAsZrPj43OtHThd62Buh/Vv6VyCBD2bdyWcGNQqoQ==",
"dev": true,
"requires": {
"array-union": "^2.1.0",
"dir-glob": "^3.0.1",
"fast-glob": "^3.1.1",
"ignore": "^5.1.4",
"merge2": "^1.3.0",
"slash": "^3.0.0"
}
},
"ignore": {
"version": "5.1.8",
"resolved": "https://g.civnet.cn:4873/ignore/-/ignore-5.1.8.tgz",
"integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==",
"dev": true
},
"is-number": {
"version": "7.0.0",
"resolved": "https://g.civnet.cn:4873/is-number/-/is-number-7.0.0.tgz",
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
"dev": true
},
"loader-utils": {
"version": "2.0.0",
"resolved": "https://g.civnet.cn:4873/loader-utils/-/loader-utils-2.0.0.tgz",
"integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==",
"dev": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
},
"locate-path": {
"version": "5.0.0",
"resolved": "https://g.civnet.cn:4873/locate-path/-/locate-path-5.0.0.tgz",
"integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
"dev": true,
"requires": {
"p-locate": "^4.1.0"
}
},
"lru-cache": {
"version": "6.0.0",
"resolved": "https://g.civnet.cn:4873/lru-cache/-/lru-cache-6.0.0.tgz",
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
"dev": true,
"requires": {
"yallist": "^4.0.0"
"safe-buffer": "~5.1.1"
}
},
"make-dir": {
"version": "3.1.0",
"resolved": "https://g.civnet.cn:4873/make-dir/-/make-dir-3.1.0.tgz",
"integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==",
"dev": true,
"requires": {
"semver": "^6.0.0"
}
"cookie": {
"version": "0.3.1",
"resolved": "https://g.civnet.cn:4873/cookie/-/cookie-0.3.1.tgz",
"integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s="
},
"micromatch": {
"version": "4.0.2",
"resolved": "https://g.civnet.cn:4873/micromatch/-/micromatch-4.0.2.tgz",
"integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==",
"cookie-signature": {
"version": "1.0.6",
"resolved": "https://g.civnet.cn:4873/cookie-signature/-/cookie-signature-1.0.6.tgz",
"integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw="
},
"copy-concurrently": {
"version": "1.0.5",
"resolved": "https://g.civnet.cn:4873/copy-concurrently/-/copy-concurrently-1.0.5.tgz",
"integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==",
"dev": true,
"requires": {
"braces": "^3.0.1",
"picomatch": "^2.0.5"
"aproba": "^1.1.1",
"fs-write-stream-atomic": "^1.0.8",
"iferr": "^0.1.5",
"mkdirp": "^0.5.1",
"rimraf": "^2.5.4",
"run-queue": "^1.0.0"
}
},
"mkdirp": {
"version": "1.0.4",
"resolved": "https://g.civnet.cn:4873/mkdirp/-/mkdirp-1.0.4.tgz",
"integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
"copy-descriptor": {
"version": "0.1.1",
"resolved": "https://g.civnet.cn:4873/copy-descriptor/-/copy-descriptor-0.1.1.tgz",
"integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=",
"dev": true
},
"p-limit": {
"version": "3.0.2",
"resolved": "https://g.civnet.cn:4873/p-limit/-/p-limit-3.0.2.tgz",
"integrity": "sha512-iwqZSOoWIW+Ew4kAGUlN16J4M7OB3ysMLSZtnhmqx7njIHFPlxWBX8xo3lVTyFVq6mI/lL9qt2IsN1sHwaxJkg==",
"copy-to-clipboard": {
"version": "3.3.1",
"resolved": "https://g.civnet.cn:4873/copy-to-clipboard/-/copy-to-clipboard-3.3.1.tgz",
"integrity": "sha512-i13qo6kIHTTpCm8/Wup+0b1mVWETvu2kIMzKoK8FpkLkFxlt0znUAHcMzox+T8sPlqtZXq3CulEjQHsYiGFJUw==",
"dev": true,
"requires": {
"p-try": "^2.0.0"
"toggle-selection": "^1.0.6"
}
},
"p-locate": {
"version": "4.1.0",
"resolved": "https://g.civnet.cn:4873/p-locate/-/p-locate-4.1.0.tgz",
"integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
"copy-webpack-plugin": {
"version": "5.1.2",
"resolved": "https://g.civnet.cn:4873/copy-webpack-plugin/-/copy-webpack-plugin-5.1.2.tgz",
"integrity": "sha512-Uh7crJAco3AjBvgAy9Z75CjK8IG+gxaErro71THQ+vv/bl4HaQcpkexAY8KVW/T6D2W2IRr+couF/knIRkZMIQ==",
"dev": true,
"requires": {
"p-limit": "^2.2.0"
"cacache": "^12.0.3",
"find-cache-dir": "^2.1.0",
"glob-parent": "^3.1.0",
"globby": "^7.1.1",
"is-glob": "^4.0.1",
"loader-utils": "^1.2.3",
"minimatch": "^3.0.4",
"normalize-path": "^3.0.0",
"p-limit": "^2.2.1",
"schema-utils": "^1.0.0",
"serialize-javascript": "^4.0.0",
"webpack-log": "^2.0.0"
},
"dependencies": {
"p-limit": {
"version": "2.3.0",
"resolved": "https://g.civnet.cn:4873/p-limit/-/p-limit-2.3.0.tgz",
"integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
"dev": true,
"requires": {
"p-try": "^2.0.0"
}
}
}
},
"path-exists": {
"version": "4.0.0",
"resolved": "https://g.civnet.cn:4873/path-exists/-/path-exists-4.0.0.tgz",
"integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
"dev": true
},
"pkg-dir": {
"version": "4.2.0",
"resolved": "https://g.civnet.cn:4873/pkg-dir/-/pkg-dir-4.2.0.tgz",
"integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==",
"cacache": {
"version": "12.0.4",
"resolved": "https://g.civnet.cn:4873/cacache/-/cacache-12.0.4.tgz",
"integrity": "sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ==",
"dev": true,
"requires": {
"find-up": "^4.0.0"
"bluebird": "^3.5.5",
"chownr": "^1.1.1",
"figgy-pudding": "^3.5.1",
"glob": "^7.1.4",
"graceful-fs": "^4.1.15",
"infer-owner": "^1.0.3",
"lru-cache": "^5.1.1",
"mississippi": "^3.0.0",
"mkdirp": "^0.5.1",
"move-concurrently": "^1.0.1",
"promise-inflight": "^1.0.1",
"rimraf": "^2.6.3",
"ssri": "^6.0.1",
"unique-filename": "^1.1.1",
"y18n": "^4.0.0"
}
},
"rimraf": {
"version": "3.0.2",
"resolved": "https://g.civnet.cn:4873/rimraf/-/rimraf-3.0.2.tgz",
"integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
"globby": {
"version": "7.1.1",
"resolved": "https://g.civnet.cn:4873/globby/-/globby-7.1.1.tgz",
"integrity": "sha1-+yzP+UAfhgCUXfral0QMypcrhoA=",
"dev": true,
"requires": {
"glob": "^7.1.3"
"array-union": "^1.0.1",
"dir-glob": "^2.0.0",
"glob": "^7.1.2",
"ignore": "^3.3.5",
"pify": "^3.0.0",
"slash": "^1.0.0"
}
},
"schema-utils": {
"version": "2.7.1",
"resolved": "https://g.civnet.cn:4873/schema-utils/-/schema-utils-2.7.1.tgz",
"integrity": "sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==",
"dev": true,
"requires": {
"@types/json-schema": "^7.0.5",
"ajv": "^6.12.4",
"ajv-keywords": "^3.5.2"
}
"ignore": {
"version": "3.3.10",
"resolved": "https://g.civnet.cn:4873/ignore/-/ignore-3.3.10.tgz",
"integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==",
"dev": true
},
"semver": {
"version": "6.3.0",
"resolved": "https://g.civnet.cn:4873/semver/-/semver-6.3.0.tgz",
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
"pify": {
"version": "3.0.0",
"resolved": "https://g.civnet.cn:4873/pify/-/pify-3.0.0.tgz",
"integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
"dev": true
},
"serialize-javascript": {
......@@ -10634,33 +10634,9 @@
}
},
"slash": {
"version": "3.0.0",
"resolved": "https://g.civnet.cn:4873/slash/-/slash-3.0.0.tgz",
"integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==",
"dev": true
},
"ssri": {
"version": "8.0.0",
"resolved": "https://g.civnet.cn:4873/ssri/-/ssri-8.0.0.tgz",
"integrity": "sha512-aq/pz989nxVYwn16Tsbj1TqFpD5LLrQxHf5zaHuieFV+R0Bbr4y8qUsOA45hXT/N4/9UNXTarBjnjVmjSOVaAA==",
"dev": true,
"requires": {
"minipass": "^3.1.1"
}
},
"to-regex-range": {
"version": "5.0.1",
"resolved": "https://g.civnet.cn:4873/to-regex-range/-/to-regex-range-5.0.1.tgz",
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
"dev": true,
"requires": {
"is-number": "^7.0.0"
}
},
"yallist": {
"version": "4.0.0",
"resolved": "https://g.civnet.cn:4873/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
"version": "1.0.0",
"resolved": "https://g.civnet.cn:4873/slash/-/slash-1.0.0.tgz",
"integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=",
"dev": true
}
}
......@@ -10777,6 +10753,7 @@
"version": "5.2.0",
"resolved": "https://g.civnet.cn:4873/cross-env/-/cross-env-5.2.0.tgz",
"integrity": "sha512-jtdNFfFW1hB7sMhr/H6rW1Z45LFqyI431m3qU6bFXcQ3Eh7LtBuG3h74o7ohHZ3crrRkkqHlo4jYHFPcjroANg==",
"dev": true,
"requires": {
"cross-spawn": "^6.0.5",
"is-windows": "^1.0.0"
......@@ -10786,6 +10763,7 @@
"version": "6.0.5",
"resolved": "https://g.civnet.cn:4873/cross-spawn/-/cross-spawn-6.0.5.tgz",
"integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
"dev": true,
"requires": {
"nice-try": "^1.0.4",
"path-key": "^2.0.1",
......@@ -11978,6 +11956,26 @@
"resolved": "https://g.civnet.cn:4873/encodeurl/-/encodeurl-1.0.2.tgz",
"integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k="
},
"encoding": {
"version": "0.1.13",
"resolved": "https://g.civnet.cn:4873/encoding/-/encoding-0.1.13.tgz",
"integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==",
"dev": true,
"requires": {
"iconv-lite": "^0.6.2"
},
"dependencies": {
"iconv-lite": {
"version": "0.6.2",
"resolved": "https://g.civnet.cn:4873/iconv-lite/-/iconv-lite-0.6.2.tgz",
"integrity": "sha512-2y91h5OpQlolefMPmUlivelittSWy0rP+oYVpn6A7GwVHNE8AWzoYOBNmlwks3LobaJxgHCYZAnyNo2GgpNRNQ==",
"dev": true,
"requires": {
"safer-buffer": ">= 2.1.2 < 3.0.0"
}
}
}
},
"end-of-stream": {
"version": "1.4.4",
"resolved": "https://g.civnet.cn:4873/end-of-stream/-/end-of-stream-1.4.4.tgz",
......@@ -16004,6 +16002,12 @@
"integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==",
"dev": true
},
"intersection-observer": {
"version": "0.7.0",
"resolved": "https://g.civnet.cn:4873/intersection-observer/-/intersection-observer-0.7.0.tgz",
"integrity": "sha1-7ha+6XjbU1FurS8KgVSwm0ALvck=",
"dev": true
},
"intl": {
"version": "1.2.5",
"resolved": "https://g.civnet.cn:4873/intl/-/intl-1.2.5.tgz",
......@@ -16512,7 +16516,8 @@
"is-windows": {
"version": "1.0.2",
"resolved": "https://g.civnet.cn:4873/is-windows/-/is-windows-1.0.2.tgz",
"integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA=="
"integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==",
"dev": true
},
"is-word-character": {
"version": "1.0.4",
......@@ -16546,7 +16551,8 @@
"isexe": {
"version": "2.0.0",
"resolved": "https://g.civnet.cn:4873/isexe/-/isexe-2.0.0.tgz",
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA="
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
"dev": true
},
"isobject": {
"version": "3.0.1",
......@@ -16554,6 +16560,16 @@
"integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=",
"dev": true
},
"isomorphic-fetch": {
"version": "2.2.1",
"resolved": "https://g.civnet.cn:4873/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz",
"integrity": "sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=",
"dev": true,
"requires": {
"node-fetch": "^1.0.1",
"whatwg-fetch": ">=0.10.0"
}
},
"isstream": {
"version": "0.1.2",
"resolved": "https://g.civnet.cn:4873/isstream/-/isstream-0.1.2.tgz",
......@@ -17894,9 +17910,9 @@
"dev": true
},
"kit_global_config": {
"version": "1.0.5",
"resolved": "https://g.civnet.cn:4873/kit_global_config/-/kit_global_config-1.0.5.tgz",
"integrity": "sha512-kQAP3c0AcagH3yEyCV7B4lrrWteNQrWQuKw2+Ts/wpnEurxDw3H7gCcAWVI0f++kmLYx6RpXwgV6twtmBQMU4w==",
"version": "1.0.7",
"resolved": "https://g.civnet.cn:4873/kit_global_config/-/kit_global_config-1.0.7.tgz",
"integrity": "sha512-pRGI8lBaIAra61y8EeFn6EYFp9q5+6Aa7WokkSRleVY0WBR7EdBmKVmnu72cpXA3jHphVREozVKGZ/c881k/tA==",
"requires": {
"@babel/runtime": "^7.10.5",
"js-base64": "^3.5.2",
......@@ -18411,6 +18427,12 @@
"integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=",
"dev": true
},
"lodash.debounce": {
"version": "4.0.8",
"resolved": "https://g.civnet.cn:4873/lodash.debounce/-/lodash.debounce-4.0.8.tgz",
"integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=",
"dev": true
},
"lodash.get": {
"version": "4.4.2",
"resolved": "https://g.civnet.cn:4873/lodash.get/-/lodash.get-4.4.2.tgz",
......@@ -18460,6 +18482,12 @@
"lodash._reinterpolate": "^3.0.0"
}
},
"lodash.throttle": {
"version": "4.1.1",
"resolved": "https://g.civnet.cn:4873/lodash.throttle/-/lodash.throttle-4.1.1.tgz",
"integrity": "sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ=",
"dev": true
},
"lodash.toarray": {
"version": "4.4.0",
"resolved": "https://g.civnet.cn:4873/lodash.toarray/-/lodash.toarray-4.4.0.tgz",
......@@ -19479,6 +19507,12 @@
"dev": true,
"optional": true
},
"nanoid": {
"version": "3.1.16",
"resolved": "https://g.civnet.cn:4873/nanoid/-/nanoid-3.1.16.tgz",
"integrity": "sha1-sh8KfQMRlvr3UxTXxl02NSvu72Q=",
"dev": true
},
"nanomatch": {
"version": "1.2.13",
"resolved": "https://g.civnet.cn:4873/nanomatch/-/nanomatch-1.2.13.tgz",
......@@ -19552,7 +19586,8 @@
"nice-try": {
"version": "1.0.5",
"resolved": "https://g.civnet.cn:4873/nice-try/-/nice-try-1.0.5.tgz",
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ=="
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
"dev": true
},
"no-case": {
"version": "2.3.2",
......@@ -19572,6 +19607,16 @@
"lodash.toarray": "^4.4.0"
}
},
"node-fetch": {
"version": "1.7.3",
"resolved": "https://g.civnet.cn:4873/node-fetch/-/node-fetch-1.7.3.tgz",
"integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==",
"dev": true,
"requires": {
"encoding": "^0.1.11",
"is-stream": "^1.0.1"
}
},
"node-int64": {
"version": "0.4.0",
"resolved": "https://g.civnet.cn:4873/node-int64/-/node-int64-0.4.0.tgz",
......@@ -20523,7 +20568,8 @@
"path-key": {
"version": "2.0.1",
"resolved": "https://g.civnet.cn:4873/path-key/-/path-key-2.0.1.tgz",
"integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A="
"integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=",
"dev": true
},
"path-parse": {
"version": "1.0.6",
......@@ -22358,6 +22404,21 @@
"tslib": "^1.10.0"
}
},
"qr.js": {
"version": "0.0.0",
"resolved": "https://g.civnet.cn:4873/qr.js/-/qr.js-0.0.0.tgz",
"integrity": "sha1-ys6GOG9ZoNuAUPqQ2baw6IoeNk8="
},
"qrcode.react": {
"version": "1.0.0",
"resolved": "https://g.civnet.cn:4873/qrcode.react/-/qrcode.react-1.0.0.tgz",
"integrity": "sha1-foiJ2zt2nlVejrRj1MbeIhw21d4=",
"requires": {
"loose-envify": "^1.4.0",
"prop-types": "^15.6.0",
"qr.js": "0.0.0"
}
},
"qs": {
"version": "6.9.4",
"resolved": "https://g.civnet.cn:4873/qs/-/qs-6.9.4.tgz",
......@@ -22905,14 +22966,13 @@
}
},
"react": {
"version": "16.8.6",
"resolved": "https://g.civnet.cn:4873/react/-/react-16.8.6.tgz",
"integrity": "sha512-pC0uMkhLaHm11ZSJULfOBqV4tIZkx87ZLvbbQYunNixAAvjnC+snJCg0XQXn9VIsttVsbZP/H/ewzgsd5fxKXw==",
"version": "16.12.0",
"resolved": "https://g.civnet.cn:4873/react/-/react-16.12.0.tgz",
"integrity": "sha512-fglqy3k5E+81pA8s+7K0/T3DBCF0ZDOher1elBFzF7O6arXJgzyu/FW+COxFvAWXJoJN9KIZbT2LXlukwphYTA==",
"requires": {
"loose-envify": "^1.1.0",
"object-assign": "^4.1.1",
"prop-types": "^15.6.2",
"scheduler": "^0.13.6"
"prop-types": "^15.6.2"
}
},
"react-app-polyfill": {
......@@ -23025,14 +23085,25 @@
}
},
"react-dom": {
"version": "16.8.6",
"resolved": "https://g.civnet.cn:4873/react-dom/-/react-dom-16.8.6.tgz",
"integrity": "sha512-1nL7PIq9LTL3fthPqwkvr2zY7phIPjYrT0jp4HjyEQrEROnw4dG41VVwi/wfoCneoleqrNX7iAD+pXebJZwrwA==",
"version": "16.12.0",
"resolved": "https://g.civnet.cn:4873/react-dom/-/react-dom-16.12.0.tgz",
"integrity": "sha512-LMxFfAGrcS3kETtQaCkTKjMiifahaMySFDn71fZUNpPHZQEzmk/GiAeIT8JSOrHB23fnuCOMruL2a8NYlw+8Gw==",
"requires": {
"loose-envify": "^1.1.0",
"object-assign": "^4.1.1",
"prop-types": "^15.6.2",
"scheduler": "^0.13.6"
"scheduler": "^0.18.0"
},
"dependencies": {
"scheduler": {
"version": "0.18.0",
"resolved": "https://g.civnet.cn:4873/scheduler/-/scheduler-0.18.0.tgz",
"integrity": "sha512-agTSHR1Nbfi6ulI0kYNK0203joW2Y5W4po4l+v03tOoiJKpTBbxpNhWDvqc/4IcOw+KLmSiQLTasZ4cab2/UWQ==",
"requires": {
"loose-envify": "^1.1.0",
"object-assign": "^4.1.1"
}
}
}
},
"react-error-overlay": {
......@@ -23191,6 +23262,16 @@
"shallowequal": "^1.0.1"
}
},
"react-sticky": {
"version": "6.0.3",
"resolved": "https://g.civnet.cn:4873/react-sticky/-/react-sticky-6.0.3.tgz",
"integrity": "sha1-ehi2Q+GGPaET1/cDYRjSp12ezeQ=",
"dev": true,
"requires": {
"prop-types": "^15.5.8",
"raf": "^3.3.0"
}
},
"react-test-renderer": {
"version": "16.8.6",
"resolved": "https://g.civnet.cn:4873/react-test-renderer/-/react-test-renderer-16.8.6.tgz",
......@@ -24393,6 +24474,7 @@
"version": "0.13.6",
"resolved": "https://g.civnet.cn:4873/scheduler/-/scheduler-0.13.6.tgz",
"integrity": "sha512-IWnObHt413ucAYKsD9J1QShUKkbKLQQHdxRyw73sw4FN26iWr3DY/H34xGPe4nmL1DwXyWmSWmMrA9TfQbE/XQ==",
"dev": true,
"requires": {
"loose-envify": "^1.1.0",
"object-assign": "^4.1.1"
......@@ -24409,6 +24491,12 @@
"ajv-keywords": "^3.1.0"
}
},
"screenfull": {
"version": "5.0.2",
"resolved": "https://g.civnet.cn:4873/screenfull/-/screenfull-5.0.2.tgz",
"integrity": "sha1-uazc8exnapSGdN9c0P9muQKwvtc=",
"dev": true
},
"scroll-into-view-if-needed": {
"version": "2.2.26",
"resolved": "https://g.civnet.cn:4873/scroll-into-view-if-needed/-/scroll-into-view-if-needed-2.2.26.tgz",
......@@ -24438,7 +24526,8 @@
"semver": {
"version": "5.7.1",
"resolved": "https://g.civnet.cn:4873/semver/-/semver-5.7.1.tgz",
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ=="
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
"dev": true
},
"semver-compare": {
"version": "1.0.0",
......@@ -24596,6 +24685,7 @@
"version": "1.2.0",
"resolved": "https://g.civnet.cn:4873/shebang-command/-/shebang-command-1.2.0.tgz",
"integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=",
"dev": true,
"requires": {
"shebang-regex": "^1.0.0"
}
......@@ -24603,7 +24693,8 @@
"shebang-regex": {
"version": "1.0.0",
"resolved": "https://g.civnet.cn:4873/shebang-regex/-/shebang-regex-1.0.0.tgz",
"integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM="
"integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=",
"dev": true
},
"shelljs": {
"version": "0.8.3",
......@@ -27928,6 +28019,16 @@
}
}
},
"umi-request": {
"version": "1.3.5",
"resolved": "https://g.civnet.cn:4873/umi-request/-/umi-request-1.3.5.tgz",
"integrity": "sha1-Kvfp+6ru0AhsB9jEh2s69lwISuo=",
"dev": true,
"requires": {
"isomorphic-fetch": "^2.2.1",
"qs": "^6.9.1"
}
},
"umi-webpack-bundle-analyzer": {
"version": "3.6.0",
"resolved": "https://g.civnet.cn:4873/umi-webpack-bundle-analyzer/-/umi-webpack-bundle-analyzer-3.6.0.tgz",
......@@ -29502,6 +29603,7 @@
"version": "1.3.1",
"resolved": "https://g.civnet.cn:4873/which/-/which-1.3.1.tgz",
"integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
"dev": true,
"requires": {
"isexe": "^2.0.0"
}
......@@ -86,7 +86,6 @@
"chalk": "2.4.2",
"compression": "1.7.4",
"connected-react-router": "6.4.0",
"cross-env": "5.2.0",
"express": "4.16.4",
"fontfaceobserver": "2.1.0",
"history": "4.9.0",
......@@ -98,13 +97,14 @@
"ip": "1.1.5",
"js-base64": "^3.5.2",
"js-cookie": "^2.2.1",
"kit_global_config": "^1.0.5",
"kit_global_config": "^1.0.7",
"kit_utils": "^1.3.6",
"lodash": "4.17.11",
"minimist": "1.2.0",
"prop-types": "15.7.2",
"react": "16.8.6",
"react-dom": "16.8.6",
"qrcode.react": "^1.0.0",
"react": "16.12.0",
"react-dom": "16.12.0",
"react-helmet": "6.0.0-beta",
"react-intl": "2.8.0",
"react-redux": "7.0.2",
......@@ -120,6 +120,7 @@
"devDependencies": {
"@ant-design/icons": "^4.0.0",
"@ant-design/pro-layout": "^6.5.10",
"@ant-design/pro-skeleton": "^1.0.0-beta.2",
"@ant-design/pro-table": "^2.5.3",
"@babel/cli": "7.4.3",
"@babel/core": "7.4.3",
......@@ -133,6 +134,7 @@
"@babel/register": "7.4.0",
"@commitlint/cli": "^9.1.2",
"@commitlint/config-conventional": "^9.1.2",
"@umijs/hooks": "^1.9.3",
"add-asset-html-webpack-plugin": "3.1.3",
"antd": "^4.5.3",
"axios": "^0.19.2",
......@@ -152,8 +154,10 @@
"compression-webpack-plugin": "2.0.0",
"connect-api-mocker": "^1.9.0",
"conventional-changelog-cli": "^2.1.0",
"copy-webpack-plugin": "^5.0.4",
"core-js": "^3.6.5",
"coveralls": "3.0.3",
"cross-env": "^5.2.0",
"css-loader": "^4.2.1",
"cz-customizable": "^6.3.0",
"dumi": "^1.0.13",
......@@ -185,6 +189,7 @@
"lodash": "^4.17.11",
"mockjs": "^1.0.1-beta3",
"moment": "^2.25.3",
"nanoid": "^3.1.16",
"ngrok": "3.1.1",
"node-plop": "0.18.0",
"null-loader": "0.1.1",
......@@ -205,6 +210,7 @@
"react-dom": "^16.8.6",
"react-helmet-async": "^1.0.4",
"react-router-config": "^5.1.1",
"react-sticky": "^6.0.3",
"react-test-renderer": "16.8.6",
"react-testing-library": "6.1.2",
"redux-immutable": "^4.0.0",
......
......@@ -22,8 +22,8 @@ class HttpRequest {
// removeAllPending()
// }
// ------------------------------------------------------------------------------------
if (this.getSite()) {
config.headers['Civ-Site'] = this.getSite();
if (!config.ignoreSite && this.getSite()) {
config.headers['civ-site'] = this.getSite();
}
this.removePending(config); //在一个ajax发送前执行一下取消操作
config.cancelToken = new cancelToken(c => {
......
import { params } from 'kit_utils';
const API = {
GET_CONFIG: "/CityInterface/rest/services.svc/GetConfig",
GENERATE_TOKEN: "/cityinterface/rest/services.svc/generatetoken",
GET_CONFIG: '/CityInterface/rest/services.svc/GetConfig',
GENERATE_TOKEN: '/cityinterface/rest/services.svc/generatetoken',
GENERATE_TOKEN_CHANGE: '/cityinterface/rest/services.svc/generatetokenquick',
GET_WEB_SITE_CONFIG: '/CityInterface/rest/services.svc/GetWebSiteConfig',
GET_USER_INFO: '/CityInterface/rest/services.svc/getUserInfo',
GET_OA : '/CityInterface/rest/services/OA.svc/getLoginInfo',
GET_OA: '/CityInterface/rest/services/OA.svc/getLoginInfo',
GET_LOGS: '/CityInterface/rest/services/portal.svc/OMMonitor/SaveLoginInfo',
GET_INFORMATION: '/CityInterface/rest/services/CountyProduct.svc/SCADAOper/GetInformationInfo'
}
export default (vm) => {
vm.getConfig = (data = {client: params.getParams('client'), ts: Date.now() }) => vm.get(API.GET_CONFIG,data).then(res => Promise.resolve(res))
GET_INFORMATION:
'/CityInterface/rest/services/CountyProduct.svc/SCADAOper/GetInformationInfo',
GET_CITY: 'https://pv.sohu.com/cityjson?ie=utf-8',
GET_ALL_GROUPS_INFO_FORUSER: 'CityInterface/rest/Services/Portal.svc/AuthorityManage/GetAllGroupsInfoForUser',
GET_WEATHER: '/CityInterface/rest/services/CountyProduct.svc/GetWeather'
};
export default vm => {
vm.getConfig = (
data = { client: params.getParams('client') || 'city', ts: Date.now() },
) => vm.get(API.GET_CONFIG, data).then(res => Promise.resolve(res));
vm.generateToken = (data={}) => vm.get(API.GENERATE_TOKEN, data).then(res => Promise.resolve(res))
vm.generateToken = (data = {}) =>
vm.get(API.GENERATE_TOKEN, data).then(res => Promise.resolve(res));
vm.getWebSiteConfig = (data={}) => vm.get(API.GET_WEB_SITE_CONFIG, data).then(res => Promise.resolve(res))
vm.getWebSiteConfig = (data = {}) =>
vm.get(API.GET_WEB_SITE_CONFIG, data).then(res => Promise.resolve(res));
vm.getUserInfo = (data={}) => vm.get(API.GET_USER_INFO, data).then(res => Promise.resolve(res))
vm.getUserInfo = (data = {}) =>
vm.get(API.GET_USER_INFO, data).then(res => Promise.resolve(res));
vm.getOA = (data = {}) => vm.get(API.GET_OA, data).then(res => Promise.resolve(res))
vm.getOA = (data = {}) =>
vm.get(API.GET_OA, data).then(res => Promise.resolve(res));
vm.writeLogs = (data = {}, config = {}) => vm.post(API.GET_LOGS, data, config).then(res => Promise.resolve(res))
vm.writeLogs = (data = {}, config = {}) =>
vm.post(API.GET_LOGS, data, config).then(res => Promise.resolve(res));
vm.getInformationInfo = (data={}) => vm.get(API.GET_INFORMATION, data).then(res => Promise.resolve(res))
}
\ No newline at end of file
vm.getInformationInfo = (data = {}) =>
vm.get(API.GET_INFORMATION, data).then(res => Promise.resolve(res));
vm.getCity = () => vm.get(API.GET_CITY).then(res => Promise.resolve(res))
vm.generateTokenQuick = (data={}) => vm.get(API.GENERATE_TOKEN_CHANGE, data).then(res => Promise.resolve(res))
vm.getAllGroupsInfoForUser = (data = {}, config) => vm.get(API.GET_ALL_GROUPS_INFO_FORUSER, data, config).then(res => Promise.resolve(res))
vm.getWeather = (data={}) => vm.get(API.GET_WEATHER, data).then(res => Promise.resolve(res))
};
......@@ -8,19 +8,23 @@ exports["default"] = void 0;
var _kit_utils = require("kit_utils");
var API = {
GET_CONFIG: "/CityInterface/rest/services.svc/GetConfig",
GENERATE_TOKEN: "/cityinterface/rest/services.svc/generatetoken",
GET_CONFIG: '/CityInterface/rest/services.svc/GetConfig',
GENERATE_TOKEN: '/cityinterface/rest/services.svc/generatetoken',
GENERATE_TOKEN_CHANGE: '/cityinterface/rest/services.svc/generatetokenquick',
GET_WEB_SITE_CONFIG: '/CityInterface/rest/services.svc/GetWebSiteConfig',
GET_USER_INFO: '/CityInterface/rest/services.svc/getUserInfo',
GET_OA: '/CityInterface/rest/services/OA.svc/getLoginInfo',
GET_LOGS: '/CityInterface/rest/services/portal.svc/OMMonitor/SaveLoginInfo',
GET_INFORMATION: '/CityInterface/rest/services/CountyProduct.svc/SCADAOper/GetInformationInfo'
GET_INFORMATION: '/CityInterface/rest/services/CountyProduct.svc/SCADAOper/GetInformationInfo',
GET_CITY: 'https://pv.sohu.com/cityjson?ie=utf-8',
GET_ALL_GROUPS_INFO_FORUSER: 'CityInterface/rest/Services/Portal.svc/AuthorityManage/GetAllGroupsInfoForUser',
GET_WEATHER: '/CityInterface/rest/services/CountyProduct.svc/GetWeather'
};
var _default = function _default(vm) {
vm.getConfig = function () {
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
client: _kit_utils.params.getParams('client'),
client: _kit_utils.params.getParams('client') || 'city',
ts: Date.now()
};
return vm.get(API.GET_CONFIG, data).then(function (res) {
......@@ -70,6 +74,34 @@ var _default = function _default(vm) {
return Promise.resolve(res);
});
};
vm.getCity = function () {
return vm.get(API.GET_CITY).then(function (res) {
return Promise.resolve(res);
});
};
vm.generateTokenQuick = function () {
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return vm.get(API.GENERATE_TOKEN_CHANGE, data).then(function (res) {
return Promise.resolve(res);
});
};
vm.getAllGroupsInfoForUser = function () {
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var config = arguments.length > 1 ? arguments[1] : undefined;
return vm.get(API.GET_ALL_GROUPS_INFO_FORUSER, data, config).then(function (res) {
return Promise.resolve(res);
});
};
vm.getWeather = function () {
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return vm.get(API.GET_WEATHER, data).then(function (res) {
return Promise.resolve(res);
});
};
};
exports["default"] = _default;
\ No newline at end of file
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
......@@ -2,35 +2,32 @@ import React from 'react';
import {
Avatar,
Menu,
Popover,
Spin,
} from 'antd';
import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import {
LogoutOutlined,
SettingOutlined,
UserOutlined,
} from '@ant-design/icons';
import HeaderDropdown from '../HeaderDropdown';
import styles from './index.less';
class AvatarDropdown extends React.Component {
/* eslint-disable no-unused-vars */
onMenuClick = event => {
const { key } = event;
if (key === 'logout') {
createStoreage.remove('PANDA_STORE');
this.props.history.push(
`/civbase/user/login/?client=${window.globalConfig.client}`,
`/user/login/?client=${window.globalConfig.client}`,
);
location.reload();
return;
}
};
getRoles = () => {
const roles = this.props.global.userInfo.roles || []
let ret = []
roles.forEach(item => {
ret.push(item.name)
})
return ret.join(",")
}
render() {
const props = this.props;
const {
......@@ -48,33 +45,49 @@ class AvatarDropdown extends React.Component {
},
} = this.props;
const menuHeaderDropdown = (
<Menu
className={styles.menu}
selectedKeys={[]}
onClick={this.onMenuClick}
>
{
<Menu.Item key="center">
<UserOutlined />
个人中心
</Menu.Item>
}
{
<Menu.Item key="settings">
<SettingOutlined />
个人设置
</Menu.Item>
}
{<Menu.Divider />}
<Menu.Item key="logout">
<LogoutOutlined />
退出登录
</Menu.Item>
</Menu>
<div className={styles.userInfo}>
<div className={styles.header}>
<div className={styles.avatar} style={{backgroundImage: `url(${props.global.userInfo.UserImge})`}}></div>
<div className={styles.name}>{props.global.userInfo.fullName}</div>
</div>
<div className={styles.body}>
<div className={styles.item}>
<ul>
<li>
<span></span>
<span className={styles.label}>账号:</span>
<span className={styles.value}>{props.global.userInfo.loginName}</span>
</li>
<li>
<span></span>
<span className={styles.label}>姓名:</span>
<span className={styles.value}>{props.global.userInfo.fullName}</span>
</li>
<li>
<span></span>
<span className={styles.label}>部门:</span>
<span className={styles.value}>{props.global.userInfo.depart.name}</span>
</li>
<li>
<span></span>
<span className={styles.label}>角色:</span>
<span className={styles.value}>{this.getRoles()}</span>
</li>
<li>
<span></span>
<span className={styles.label}>企业编号:</span>
<span className={styles.value}>{props.global.userInfo.site}</span>
</li>
</ul>
</div>
<div className={styles.exit}>
<a href="javascript:;" onClick={this.onMenuClick}>退出登录</a>
</div>
</div>
</div>
);
return currentUser && currentUser.name ? (
<HeaderDropdown overlay={menuHeaderDropdown}>
<Popover overlayClassName={styles.userWrapper} placement="bottom" trigger="click" content={menuHeaderDropdown}>
<span className={`${styles.action} ${styles.account}`}>
<Avatar
size="small"
......@@ -82,9 +95,9 @@ class AvatarDropdown extends React.Component {
src={currentUser.avatar}
alt="avatar"
/>
<span className={`${styles.name} anticon`}>{currentUser.name}</span>
{/* <span className={`${styles.name} anticon`}>{currentUser.name}</span> */}
</span>
</HeaderDropdown>
</Popover>
) : (
<span className={`${styles.action} ${styles.account}`}>
<Spin
......@@ -99,12 +112,5 @@ class AvatarDropdown extends React.Component {
}
}
const mapStateToProps = state => {
return {
global: state.getIn(['global', 'globalConfig']),
};
};
export default connect(
mapStateToProps,
null,
)(withRouter(AvatarDropdown));
export default withRouter(AvatarDropdown)
import React, { useState } from 'react';
import { message } from 'antd';
import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import Icon from '@ant-design/icons';
// import { searchAutoCity } from '../../api/jsonp/autoService';
import HeaderSearch from '../HeaderSearch';
// import NoticeIcon from '../NoticeIcon';
......@@ -7,6 +13,61 @@ import Avatar from './AvatarDropdown';
import styles from './index.less';
import NoticeIconView from './NoticeIconView';
const orderSvg = () => (
<svg version="1.1" x="0px" y="0px"
width="24px" height="24px" viewBox="0 0 24 24" enableBackground="new 0 0 24 24" space="preserve">
<path fill="#5F718C" d="M7.223,13.131c-0.445,0-0.815,0.364-0.815,0.816c0,0.446,0.37,0.816,0.815,0.816
c0.446,0,0.816-0.37,0.816-0.816C8.039,13.495,7.669,13.131,7.223,13.131L7.223,13.131z M7.223,16.574L7.223,16.574
c-0.445,0-0.815,0.371-0.815,0.817c0,0.45,0.37,0.814,0.815,0.814c0.446,0,0.816-0.364,0.816-0.814
C8.039,16.945,7.669,16.574,7.223,16.574L7.223,16.574z M7.223,9.688L7.223,9.688c-0.445,0-0.815,0.366-0.815,0.817
c0,0.445,0.37,0.815,0.815,0.815c0.446,0,0.816-0.37,0.816-0.815C8.039,10.054,7.669,9.688,7.223,9.688L7.223,9.688z M20.469,4.533
L20.469,4.533h-2.246V4.082c0-0.268-0.22-0.48-0.485-0.48h-2.622c-0.138-0.59-0.434-1.1-0.839-1.505
c-0.59-0.591-1.388-0.95-2.28-0.95c-0.884,0-1.677,0.359-2.262,0.95C9.323,2.502,9.022,3.012,8.879,3.602H6.263
c-0.267,0-0.492,0.213-0.492,0.48v0.451H3.548c-0.451,0-0.821,0.363-0.821,0.814v16.688c0,0.452,0.37,0.817,0.821,0.817h16.921
c0.438,0,0.805-0.365,0.805-0.817V5.348C21.273,4.896,20.907,4.533,20.469,4.533L20.469,4.533z M10.671,3.027
c0.405-0.404,0.718-0.653,1.325-0.653c0.614,0,0.933,0.249,1.337,0.653c0.221,0.227,0.158,0.256,0.273,0.574h-3.208
C10.516,3.283,10.44,3.254,10.671,3.027 M7.015,4.822L7.015,4.822h9.982v1.054H7.015 M19.647,21.215L19.647,21.215H4.359V6.158
h1.411v0.451c0,0.267,0.226,0.486,0.492,0.486h11.475c0.266,0,0.485-0.22,0.485-0.486V6.158h1.425V21.215L19.647,21.215z
M16.742,9.765L16.742,9.765H9.659c-0.267,0-0.485,0.468-0.485,0.74c0,0.267,0.219,0.739,0.485,0.739h7.083
c0.277,0,0.491-0.473,0.491-0.739C17.233,10.232,17.02,9.765,16.742,9.765L16.742,9.765z M16.742,16.65L16.742,16.65H9.659
c-0.267,0-0.485,0.468-0.485,0.741c0,0.271,0.219,0.728,0.485,0.728h7.083c0.277,0,0.491-0.457,0.491-0.728
C17.233,17.118,17.02,16.65,16.742,16.65L16.742,16.65z M16.742,13.213L16.742,13.213H9.659c-0.267,0-0.485,0.462-0.485,0.735
c0,0.271,0.219,0.734,0.485,0.734h7.083c0.277,0,0.491-0.464,0.491-0.734C17.233,13.675,17.02,13.213,16.742,13.213L16.742,13.213z"
/>
</svg>);
const homeSvg = () => (
<svg version="1.1" x="0px" y="0px" width="24px" height="24px" viewBox="0 0 24 24" enableBackground="new 0 0 24 24" space="preserve">
<path fill="#5F718C" d="M23.359,13.561v-1.313L12.057,1.064L0.642,12.247v1.37h2.84v9.318h7.381v-4.935h2.271v4.935h7.385v-9.318
L23.359,13.561z M18.815,11.917v9.319H14.84v-4.935H9.161v4.935H5.185v-9.319H3.311l8.746-8.551l8.577,8.551H18.815z"/>
</svg>
)
const OrderIcon = props => <Icon component={orderSvg} {...props} />;
const HomeIcon = props => <Icon component={homeSvg} {...props}/>
const MESSAGE_BOX_URL = 'product/maintenance/CaseManage/CaseDoingBox/StardCaseDoingBoxView|isDelay=1'
const getConfig = (widgets, url) => {
const widgetconfig = {};
if(!widgets) {
return
} else {
for(let i = 0; i< widgets.length; i++) {
const widget = widgets[i];
if(widget && widget.url) widget.url = widget.url.replace(/\\/g,'/');
if (widget.url && url.toLowerCase() == widget.url.toLowerCase()) {
widgetconfig = widget;
break;
} else {
if (widget.widgets) {
widgetconfig = getConfig(url, widget.widgets);
if (widgetconfig) {
break;
}
}
}
}
}
return widgetconfig
}
const GlobalHeaderRight = props => {
const { theme, layout } = props;
const [options, setOptions] = useState([]);
......@@ -45,6 +106,21 @@ const GlobalHeaderRight = props => {
: setOptions([]);
};
const goHome = (event) => {
event.stopPropagation()
props.history.replace(`/civweb4/?client=${props.global.client}`)
}
const handleOrder = (event) => {
event.stopPropagation()
if(getConfig(props.global.widgets.concat(props.global.uiwidgets), MESSAGE_BOX_URL)) {
props.history.push(`/civweb4/${MESSAGE_BOX_URL}`)
} else {
message.warning('对不起,您没有菜单权限!')
}
}
const handleSelect = (value, data) => {
window.share.event.emit('addTips', options, data);
};
......@@ -60,11 +136,23 @@ const GlobalHeaderRight = props => {
onChange={handleSearch}
onSearch={handleSearch}
/>
<div className={styles.nav}>
<HomeIcon onClick={goHome}/>
<OrderIcon onClick={handleOrder}/>
</div>
<NoticeIconView notices={[]} />
<Avatar menu />
<Avatar menu global={props.global}/>
{/* <SelectLang className={styles.action} /> */}
</div>
);
};
export default GlobalHeaderRight;
const mapStateToProps = state => {
return {
global: state.getIn(['global', 'globalConfig']),
};
};
export default connect(
mapStateToProps,
null,
)(withRouter(GlobalHeaderRight));
......@@ -62,6 +62,102 @@
}
}
}
.userWrapper {
.userInfo {
background-color: #fff;
width: 300px;
position: absolute;
right: 0;
top: 10px;
box-shadow: 0 0 10px rgba(0,0,0,0.15);
border-radius: 6px;
.header {
width: 100%;
height: 80px;
position: relative;
background: #40b3f7;
padding: 14px 12px;
display: flex;
border-top-left-radius: 6px;
border-top-right-radius: 6px;
.avatar {
display: inline-block;
width: 52px;
height: 52px;
border: 2px solid #fff;
background-color: #fff;
border-radius: 50%;
background-size: 100%;
background-repeat: no-repeat;
background-position: center center;
background-position: center;
cursor: pointer;
}
.name {
display: inline-block;
width: 214px;
font-size: 18px;
color: #fff;
font-weight: bold;
padding: 14px;
}
}
.body {
.item {
border-bottom: 1px solid #e0e0e0;
ul {
padding: 0 12px;
list-style: none;
margin: 0;
li {
height: 40px;
line-height: 42px;
border-bottom: 1px dashed #eee;
position: relative;
text-indent: 3px;
overflow: hidden;
width: 100%;
font-size: 12px;
font-weight: 100;
span.label {
padding: 0 2px;
max-width: 200px;
}
span.value {
padding: 0 2px;
max-width: 200px;
}
}
}
}
.exit {
height: 30px;
line-height: 30px;
text-align: right;
padding: 0 10px;
a {
color: #777;
text-decoration: none;
margin: 0 5px;
}
}
}
}
}
.nav {
display: flex;
align-items: center;
span {
&:first-child {
margin-right: 20px;
margin-left: 20px;
}
svg {
transform: scale(0.88);
}
}
}
:global(.ant-pro-global-header) {
.dark {
......
......@@ -8,13 +8,30 @@ import classNames from 'classnames';
import { connect } from 'react-redux';
import useMergeValue from 'use-merge-value';
import { BellOutlined } from '@ant-design/icons';
import Icon from '@ant-design/icons';
import HeaderDropdown from '../HeaderDropdown';
import styles from './index.less';
import NoticeList from './NoticeList';
const { TabPane } = Tabs;
const messageSvg = () => (
<svg version="1.1" x="0px" y="0px"
width="24px" height="24px" viewBox="0 0 24 24" enable-background="new 0 0 24 24" space="preserve">
<path fill="#5F718C" d="M20.486,16.373l-1.721-2.246v-0.984v-0.352V9.924c0-1.919-0.664-3.698-1.871-5.007
c-0.712-0.776-1.57-1.349-2.551-1.705c-0.091-0.514-0.35-0.983-0.737-1.335c-0.879-0.791-2.334-0.791-3.21,0
c-0.394,0.354-0.653,0.823-0.741,1.336C8.676,3.568,7.817,4.14,7.105,4.917C5.899,6.229,5.234,8.008,5.234,9.923l0.005,4.194
l-1.708,2.234c-0.241,0.256-0.372,0.584-0.372,0.932v1.092c0,0.75,0.615,1.357,1.372,1.357H19.47c0.757,0,1.371-0.607,1.371-1.357
v-1.092C20.841,16.936,20.71,16.607,20.486,16.373z M4.899,17.996v1.016l-0.001-2.061l1.628-2.154
c0.227-0.244,0.353-0.561,0.353-0.893v-4.05c0-1.516,0.509-2.914,1.436-3.935c0.459-0.506,1.001-0.895,1.608-1.166
c1.276-0.565,2.883-0.565,4.155,0c0.609,0.273,1.15,0.667,1.608,1.168c0.925,1.021,1.437,2.417,1.437,3.934v2.762v0.338v0.949
c0,0.334,0.123,0.654,0.336,0.875l1.642,2.164l0.013,1.037L4.899,17.996z"/>
<path fill="#5F718C" d="M13.685,20.236c-0.101,0.238-0.248,0.453-0.444,0.631c-0.677,0.617-1.799,0.615-2.473,0.002
c-0.194-0.18-0.344-0.396-0.446-0.633H8.895c0.146,0.627,0.474,1.199,0.955,1.639c0.588,0.543,1.354,0.841,2.158,0.841
c0.801,0,1.566-0.298,2.154-0.837c0.481-0.439,0.808-1.012,0.954-1.641L13.685,20.236z"/>
</svg>
)
const BellOutlined = props => <Icon component={messageSvg} {...props} style={{transform: 'scale(0.88)'}}/>;
const NoticeIcon = props => {
const getNotificationBox = () => {
const {
......
.sliderBlock {
position: absolute;
left: 0;
top: 0;
}
.sliderContainer {
position: relative;
text-align: center;
width: 310px;
height: 40px;
line-height: 40px;
margin-top: 15px;
background: #f7f9fa;
color: #45494c;
border: 1px solid #e4e7eb;
}
.sliderContainer.sliderContainer_active .slider {
height: 38px;
top: -1px;
border: 1px solid #1991fa;
}
.sliderContainer.sliderContainer_active .sliderMask {
height: 38px;
border-width: 1px;
}
.sliderContainer.sliderContainer_success .slider {
height: 38px;
top: -1px;
border: 1px solid #52ccba;
background-color: #52ccba !important;
}
.sliderContainer.sliderContainer_success .sliderMask {
height: 38px;
border: 1px solid #52ccba;
background-color: #d2f4ef;
}
.sliderContainer.sliderContainer_success .sliderIcon {
background-position: 0 0 !important;
}
.sliderContainer.sliderContainer_fail .sliderMask {
height: 38px;
border: 1px solid #f57a7a;
background-color: #fce1e1;
}
.sliderContainer.sliderContainer_fail .sliderIcon {
top: 14px;
background-position: 0 -82px !important;
}
.sliderContainer.sliderContainer_active .sliderText,
.sliderContainer.sliderContainer_success .sliderText,
.sliderContainer.sliderContainer_fail .sliderText {
display: none;
}
.sliderContainer .sliderMask {
position: absolute;
left: 0;
top: 0;
height: 40px;
border: 0 solid #1991fa;
background: #d1e9fe;
}
.sliderContainer .slider {
position: absolute;
top: 0;
left: 0;
width: 40px;
height: 40px;
background: #fff;
box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
cursor: pointer;
transition: background 0.2s linear;
}
.sliderContainer .slider:hover {
background: #1991fa;
}
.sliderContainer .slider:hover .sliderIcon {
background-position: 0 -13px;
}
.sliderContainer .sliderIcon {
position: absolute;
top: 15px;
left: 13px;
width: 14px;
height: 12px;
background: url(https://panda-water.cn/web4/assets/images/SlideVerify/icon.png) 0 -26px;
background-size: 34px 471px;
}
.sliderContainer .refreshIcon {
position: absolute;
right: 0;
top: 0;
width: 34px;
height: 34px;
cursor: pointer;
background: url(https://panda-water.cn/web4/assets/images/SlideVerify/icon.png) 0 -437px;
background-size: 34px 471px;
}
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _kit_utils = require("kit_utils");
var _index = _interopRequireDefault(require("./index.less"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
var SlideVerify =
/*#__PURE__*/
function () {
function SlideVerify() {
_classCallCheck(this, SlideVerify);
}
_createClass(SlideVerify, [{
key: "init",
value: function init() {
debugger;
this.initDOM();
this.initImg();
this.bindEvents();
}
}, {
key: "render",
value: function render(_ref) {
var container = _ref.container,
onSuccess = _ref.onSuccess,
onFail = _ref.onFail,
onRefresh = _ref.onRefresh;
container.style.position = container.style.position || 'relative';
this.slideLong = 42; // 拼图边长
this.slideRadius = 9; // 拼图缺口半径
this.canvasWidth = 310; // canvas宽度
this.canvasHeight = 155; // canvas高度
this.slideTotalWidth = this.slideLong + this.slideRadius * 2 + 3; // 拼图实际边长
this.container = container;
this.onSuccess = onSuccess;
this.onFail = onFail;
this.onRefresh = onRefresh;
this.init();
}
}, {
key: "initDOM",
value: function initDOM() {
var canvas = this.createCanvas(this.canvasWidth, this.canvasHeight); // 画布
var block = canvas.cloneNode(true); // 拼图
var sliderContainer = this.createElement('div', _index["default"].sliderContainer);
var refreshIcon = this.createElement('div', _index["default"].refreshIcon);
var sliderMask = this.createElement('div', _index["default"].sliderMask);
var slider = this.createElement('div', _index["default"].slider);
var sliderIcon = this.createElement('span', _index["default"].sliderIcon);
var text = this.createElement('span', _index["default"].sliderText);
block.className = _index["default"].sliderBlock;
text.innerHTML = '向右滑动填充拼图';
var el = this.container;
el.appendChild(canvas);
el.appendChild(refreshIcon);
el.appendChild(block);
slider.appendChild(sliderIcon);
sliderMask.appendChild(slider);
sliderContainer.appendChild(sliderMask);
sliderContainer.appendChild(text);
el.appendChild(sliderContainer);
Object.assign(this, {
canvas: canvas,
block: block,
sliderContainer: sliderContainer,
refreshIcon: refreshIcon,
slider: slider,
sliderMask: sliderMask,
sliderIcon: sliderIcon,
text: text,
canvasCtx: canvas.getContext('2d'),
blockCtx: block.getContext('2d')
});
}
}, {
key: "initImg",
value: function initImg() {
var _this = this;
var img = this.createImg(function () {
_this.startDraw();
_this.canvasCtx.drawImage(img, 0, 0, _this.canvasWidth, _this.canvasHeight);
_this.blockCtx.drawImage(img, 0, 0, _this.canvasWidth, _this.canvasHeight);
var y = _this.slideY - _this.slideRadius * 2 - 2;
var ImageData = _this.blockCtx.getImageData(_this.slideX - 3, y, _this.slideTotalWidth, _this.slideTotalWidth);
_this.block.width = _this.slideTotalWidth;
_this.blockCtx.putImageData(ImageData, 0, y);
});
this.img = img;
}
}, {
key: "startDraw",
value: function startDraw() {
// 随机创建拼图的位置(矩形拼图左上顶点位置)
this.slideX = this.getRandomNumberByRange(this.slideTotalWidth + 10, this.canvasWidth - (this.slideTotalWidth + 10));
this.slideY = this.getRandomNumberByRange(10 + this.slideRadius * 2, this.canvasHeight - (this.slideTotalWidth + 10));
this.draw(this.canvasCtx, this.slideX, this.slideY, 'fill');
this.draw(this.blockCtx, this.slideX, this.slideY, 'clip');
}
}, {
key: "clean",
value: function clean() {
this.canvasCtx.clearRect(0, 0, this.canvasWidth, this.canvasHeight);
this.blockCtx.clearRect(0, 0, this.canvasWidth, this.canvasHeight);
this.block.width = this.canvasWidth;
}
}, {
key: "bindEvents",
value: function bindEvents() {
var _this2 = this;
this.container.onselectstart = function () {
return false;
};
this.refreshIcon.onclick = function () {
_this2.reset();
typeof _this2.onRefresh === 'function' && _this2.onRefresh();
};
var originX,
originY,
trail = [],
isMouseDown = false;
var handleDragStart = function handleDragStart(e) {
originX = e.clientX || e.touches[0].clientX;
originY = e.clientY || e.touches[0].clientY;
isMouseDown = true;
};
var handleDragMove = function handleDragMove(e) {
if (!isMouseDown) return false;
var eventX = e.clientX || e.touches[0].clientX;
var eventY = e.clientY || e.touches[0].clientY;
var moveX = eventX - originX;
var moveY = eventY - originY;
if (moveX < 0 || moveX + 38 >= _this2.canvasWidth) return false;
_this2.slider.style.left = moveX + 'px'; //按钮的滑动距离
var blockLeft = (_this2.canvasWidth - 40 - 20) / (_this2.canvasWidth - 40) * moveX; //按钮与滑块的移动比例相同
_this2.block.style.left = blockLeft + 'px';
_kit_utils.dom.addClass(_this2.sliderContainer, _index["default"]['sliderContainer_active']);
_this2.sliderMask.style.width = moveX + 'px';
trail.push(moveY);
};
var handleDragEnd = function handleDragEnd(e) {
if (!isMouseDown) return false;
isMouseDown = false;
var eventX = e.clientX || e.changedTouches[0].clientX;
if (eventX == originX) return false;
_kit_utils.dom.removeClass(_this2.sliderContainer, _index["default"]['sliderContainer_active']);
_this2.trail = trail;
var _this2$verify = _this2.verify(),
spliced = _this2$verify.spliced,
verified = _this2$verify.verified;
if (spliced) {
if (verified) {
_kit_utils.dom.addClass(_this2.sliderContainer, _index["default"]['sliderContainer_success']);
typeof _this2.onSuccess === 'function' && _this2.onSuccess();
} else {
_kit_utils.dom.addClass(_this2.sliderContainer, _index["default"]['sliderContainer_fail']);
_this2.text.innerHTML = '再试一次';
_this2.reset();
}
} else {
_kit_utils.dom.addClass(_this2.sliderContainer, _index["default"]['sliderContainer_fail']);
typeof _this2.onFail === 'function' && _this2.onFail();
setTimeout(function () {
_this2.reset();
}, 1000);
}
};
this.slider.addEventListener('mousedown', handleDragStart);
this.slider.addEventListener('touchstart', handleDragStart);
document.addEventListener('mousemove', handleDragMove);
document.addEventListener('touchmove', handleDragMove);
document.addEventListener('mouseup', handleDragEnd);
document.addEventListener('touchend', handleDragEnd);
}
}, {
key: "verify",
value: function verify() {
var arr = this.trail; // 拖动时y轴的移动距离
var average = arr.reduce(this.sum) / arr.length;
var deviations = arr.map(function (x) {
return x - average;
});
var stddev = Math.sqrt(deviations.map(this.square).reduce(this.sum) / arr.length); //总体标准差
var left = parseInt(this.block.style.left);
return {
spliced: Math.abs(left - this.slideX) < 10,
verified: stddev !== 0 // 简单验证下拖动轨迹,为零时表示Y轴上下没有波动,可能非人为操作
};
}
}, {
key: "reset",
value: function reset() {
this.sliderContainer.className = _index["default"].sliderContainer;
this.slider.style.left = 0;
this.block.style.left = 0;
this.sliderMask.style.width = 0;
this.clean();
this.img.src = this.getRandomImg();
}
}, {
key: "createCanvas",
value: function createCanvas(width, height) {
var canvas = this.createElement('canvas');
canvas.width = width;
canvas.height = height;
return canvas;
}
}, {
key: "createElement",
value: function createElement(tagName, className) {
var element = document.createElement(tagName);
element.className = className;
return element;
}
}, {
key: "getRandomNumberByRange",
value: function getRandomNumberByRange(start, end) {
return Math.round(Math.random() * (end - start) + start);
}
}, {
key: "getRandomImg",
value: function getRandomImg() {
return require("../../assets/SlideVerify/" + [this.getRandomNumberByRange(1, 8) + '.jpg']);
}
}, {
key: "createImg",
value: function createImg(onload) {
var _this3 = this;
var img = new Image();
img.setAttribute('crossOrigin', 'Anonymous');
img.src = this.getRandomImg();
img.onload = onload;
img.onerror = function () {
img.src = _this3.getRandomImg();
};
return img;
}
}, {
key: "draw",
value: function draw(ctx, x, y, operation) {
var l = this.slideLong; // 滑块边长
var r = this.slideRadius;
var PI = Math.PI;
var borderGap = 2;
ctx.beginPath();
ctx.moveTo(x, y);
ctx.arc(x + l / 2, y - r + borderGap, r, 0.72 * PI, 2.26 * PI); //上圆
ctx.lineTo(x + l, y);
ctx.arc(x + l + r - borderGap, y + l / 2, r, 1.21 * PI, 2.78 * PI); //右圆
ctx.lineTo(x + l, y + l);
ctx.lineTo(x, y + l);
ctx.arc(x + r - borderGap, y + l / 2, r + 0.4, 2.76 * PI, 1.24 * PI, true); //左圆
ctx.lineTo(x, y);
ctx.lineWidth = borderGap;
ctx.fillStyle = 'rgba(255, 255, 255, 0.7)';
ctx.strokeStyle = 'rgba(255, 255, 255, 0.7)';
ctx.stroke();
ctx[operation]();
ctx.globalCompositeOperation = 'overlay';
}
}, {
key: "sum",
value: function sum(x, y) {
return x + y;
}
}, {
key: "square",
value: function square(x) {
return x * x;
}
}]);
return SlideVerify;
}();
var _default = SlideVerify;
exports["default"] = _default;
\ No newline at end of file
import { dom } from 'kit_utils';
import styles from './index.less';
class SlideVerify {
init() {
debugger
this.initDOM()
this.initImg()
this.bindEvents()
}
render({container, onSuccess, onFail, onRefresh}) {
container.style.position = container.style.position || 'relative'
this.slideLong = 42 // 拼图边长
this.slideRadius = 9 // 拼图缺口半径
this.canvasWidth = 310 // canvas宽度
this.canvasHeight = 155 // canvas高度
this.slideTotalWidth = this.slideLong + this.slideRadius * 2 + 3 // 拼图实际边长
this.container = container
this.onSuccess = onSuccess
this.onFail = onFail
this.onRefresh = onRefresh
this.init()
}
initDOM () {
var canvas = this.createCanvas(this.canvasWidth, this.canvasHeight) // 画布
var block = canvas.cloneNode(true) // 拼图
var sliderContainer = this.createElement('div', styles.sliderContainer)
var refreshIcon = this.createElement('div', styles.refreshIcon)
var sliderMask = this.createElement('div', styles.sliderMask)
var slider = this.createElement('div', styles.slider)
var sliderIcon = this.createElement('span', styles.sliderIcon)
var text = this.createElement('span', styles.sliderText)
block.className = styles.sliderBlock
text.innerHTML = '向右滑动填充拼图'
var el = this.container
el.appendChild(canvas)
el.appendChild(refreshIcon)
el.appendChild(block)
slider.appendChild(sliderIcon)
sliderMask.appendChild(slider)
sliderContainer.appendChild(sliderMask)
sliderContainer.appendChild(text)
el.appendChild(sliderContainer)
Object.assign(this, {
canvas,
block,
sliderContainer,
refreshIcon,
slider,
sliderMask,
sliderIcon,
text,
canvasCtx: canvas.getContext('2d'),
blockCtx: block.getContext('2d')
})
}
initImg () {
var img = this.createImg(() => {
this.startDraw()
this.canvasCtx.drawImage(img, 0, 0, this.canvasWidth, this.canvasHeight)
this.blockCtx.drawImage(img, 0, 0, this.canvasWidth, this.canvasHeight)
var y = this.slideY - this.slideRadius * 2 - 2
var ImageData = this.blockCtx.getImageData(this.slideX - 3, y, this.slideTotalWidth, this.slideTotalWidth)
this.block.width = this.slideTotalWidth
this.blockCtx.putImageData(ImageData, 0, y)
})
this.img = img
}
startDraw () {
// 随机创建拼图的位置(矩形拼图左上顶点位置)
this.slideX = this.getRandomNumberByRange(this.slideTotalWidth + 10, this.canvasWidth - (this.slideTotalWidth + 10))
this.slideY = this.getRandomNumberByRange(10 + this.slideRadius * 2, this.canvasHeight - (this.slideTotalWidth + 10))
this.draw(this.canvasCtx, this.slideX, this.slideY, 'fill')
this.draw(this.blockCtx, this.slideX, this.slideY, 'clip')
}
clean () {
this.canvasCtx.clearRect(0, 0, this.canvasWidth, this.canvasHeight)
this.blockCtx.clearRect(0, 0, this.canvasWidth, this.canvasHeight)
this.block.width = this.canvasWidth
}
bindEvents () {
this.container.onselectstart = () => false
this.refreshIcon.onclick = () => {
this.reset()
typeof this.onRefresh === 'function' && this.onRefresh()
}
var originX, originY, trail = [], isMouseDown = false
var handleDragStart = function (e) {
originX = e.clientX || e.touches[0].clientX
originY = e.clientY || e.touches[0].clientY
isMouseDown = true
}
var handleDragMove = (e) => {
if (!isMouseDown) return false
var eventX = e.clientX || e.touches[0].clientX
var eventY = e.clientY || e.touches[0].clientY
var moveX = eventX - originX
var moveY = eventY - originY
if (moveX < 0 || moveX + 38 >= this.canvasWidth) return false
this.slider.style.left = moveX + 'px' //按钮的滑动距离
var blockLeft = (this.canvasWidth - 40 - 20) / (this.canvasWidth - 40) * moveX //按钮与滑块的移动比例相同
this.block.style.left = blockLeft + 'px'
dom.addClass(this.sliderContainer, styles['sliderContainer_active'])
this.sliderMask.style.width = moveX + 'px'
trail.push(moveY)
}
var handleDragEnd = (e) => {
if (!isMouseDown) return false
isMouseDown = false
var eventX = e.clientX || e.changedTouches[0].clientX
if (eventX == originX) return false
dom.removeClass(this.sliderContainer, styles['sliderContainer_active'])
this.trail = trail
var { spliced, verified } = this.verify()
if (spliced) {
if (verified) {
dom.addClass(this.sliderContainer, styles['sliderContainer_success'])
typeof this.onSuccess === 'function' && this.onSuccess()
} else {
dom.addClass(this.sliderContainer, styles['sliderContainer_fail'])
this.text.innerHTML = '再试一次'
this.reset()
}
} else {
dom.addClass(this.sliderContainer, styles['sliderContainer_fail'])
typeof this.onFail === 'function' && this.onFail()
setTimeout(() => {
this.reset()
}, 1000)
}
}
this.slider.addEventListener('mousedown', handleDragStart)
this.slider.addEventListener('touchstart', handleDragStart)
document.addEventListener('mousemove', handleDragMove)
document.addEventListener('touchmove', handleDragMove)
document.addEventListener('mouseup', handleDragEnd)
document.addEventListener('touchend', handleDragEnd)
}
verify () {
const arr = this.trail // 拖动时y轴的移动距离
const average = arr.reduce(this.sum) / arr.length
const deviations = arr.map(x => x - average)
const stddev = Math.sqrt(deviations.map(this.square).reduce(this.sum) / arr.length) //总体标准差
const left = parseInt(this.block.style.left)
return {
spliced: Math.abs(left - this.slideX) < 10,
verified: stddev !== 0, // 简单验证下拖动轨迹,为零时表示Y轴上下没有波动,可能非人为操作
}
}
reset () {
this.sliderContainer.className = styles.sliderContainer
this.slider.style.left = 0
this.block.style.left = 0
this.sliderMask.style.width = 0
this.clean()
this.img.src = this.getRandomImg()
}
createCanvas(width, height) {
const canvas = this.createElement('canvas')
canvas.width = width
canvas.height = height
return canvas;
}
createElement(tagName, className) {
const element = document.createElement(tagName)
element.className = className
return element
}
getRandomNumberByRange (start, end) {
return Math.round(Math.random() * (end - start) + start)
}
getRandomImg () {
return require(`../../assets/SlideVerify/` + [this.getRandomNumberByRange(1, 8) + '.jpg'])
}
createImg (onload) {
const img = new Image()
img.setAttribute('crossOrigin', 'Anonymous')
img.src = this.getRandomImg()
img.onload = onload
img.onerror = () => {
img.src = this.getRandomImg()
}
return img
}
draw (ctx, x, y, operation) {
const l = this.slideLong // 滑块边长
const r = this.slideRadius
const PI = Math.PI
const borderGap = 2
ctx.beginPath()
ctx.moveTo(x, y)
ctx.arc(x + l / 2, y - r + borderGap, r, 0.72 * PI, 2.26 * PI) //上圆
ctx.lineTo(x + l, y)
ctx.arc(x + l + r - borderGap, y + l / 2, r, 1.21 * PI, 2.78 * PI) //右圆
ctx.lineTo(x + l, y + l)
ctx.lineTo(x, y + l)
ctx.arc(x + r - borderGap, y + l / 2, r + 0.4, 2.76 * PI, 1.24 * PI, true) //左圆
ctx.lineTo(x, y)
ctx.lineWidth = borderGap
ctx.fillStyle = 'rgba(255, 255, 255, 0.7)'
ctx.strokeStyle = 'rgba(255, 255, 255, 0.7)'
ctx.stroke()
ctx[operation]()
ctx.globalCompositeOperation = 'overlay'
}
sum (x, y) {
return x + y
}
square (x) {
return x * x
}
}
export default SlideVerify;
\ No newline at end of file
.sliderBlock {
position: absolute;
left: 0;
top: 0;
}
.sliderContainer {
position: relative;
text-align: center;
width: 310px;
height: 40px;
line-height: 40px;
margin-top: 15px;
background: #f7f9fa;
color: #45494c;
border: 1px solid #e4e7eb;
&.sliderContainer_active {
.slider {
height: 38px;
top: -1px;
border: 1px solid #1991fa;
}
.sliderMask {
height: 38px;
border-width: 1px;
}
}
&.sliderContainer_success {
.slider {
height: 38px;
top: -1px;
border: 1px solid #52ccba;
background-color: #52ccba !important;
}
.sliderMask {
height: 38px;
border: 1px solid #52ccba;
background-color: #d2f4ef;
}
.sliderIcon {
background-position: 0 0 !important;
}
}
&.sliderContainer_fail {
.sliderMask {
height: 38px;
border: 1px solid #f57a7a;
background-color: #fce1e1;
}
.sliderIcon {
top: 14px;
background-position: 0 -82px !important;
}
}
&.sliderContainer_active .sliderText,&.sliderContainer_success .sliderText,
&.sliderContainer_fail .sliderText {
display: none;
}
.sliderMask {
position: absolute;
left: 0;
top: 0;
height: 40px;
border: 0 solid #1991fa;
background: #d1e9fe;
}
.slider {
position: absolute;
top: 0;
left: 0;
width: 40px;
height: 40px;
background: #fff;
box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
cursor: pointer;
transition: background 0.2s linear;
&:hover {
background: #1991fa;
.sliderIcon {
background-position: 0 -13px;
}
}
}
.sliderIcon {
position: absolute;
top: 15px;
left: 13px;
width: 14px;
height: 12px;
background: url(https://panda-water.cn/web4/assets/images/SlideVerify/icon.png)
0 -26px;
background-size: 34px 471px;
}
.refreshIcon {
position: absolute;
right: 0;
top: 0;
width: 34px;
height: 34px;
cursor: pointer;
background: url(https://panda-water.cn/web4/assets/images/SlideVerify/icon.png)
0 -437px;
background-size: 34px 471px;
}
}
\ No newline at end of file
import { Tabs } from 'antd';
import { Sticky } from 'react-sticky';
const { TabPane } = Tabs;
const renderTabBar = (props, DefaultTabBar) => (
<Sticky bottomOffset={80}>
{({ stylle }) => <DefaultTabBar {...props} style={{ ...stylle }} />}
</Sticky>
);
const TabRoute = () => {};
......@@ -27,7 +27,7 @@ function App(props) {
content={`${props.global && props.global.title}`}
/>
</Helmet>
<Router>
<Router basename="civbase">
<Switch>{renderRoutes(dyRoutes(props.menu || []).routes)}</Switch>
</Router>
</>
......
......@@ -4,6 +4,7 @@ import {
GET_CONFIG,
GET_CURRENT_ROUTES,
GET_ERROR_CONFIG,
GET_THEME_CONFIG,
} from './constants';
export function getConfig(data) {
......@@ -39,3 +40,10 @@ export function generateMenu(data) {
data,
};
}
export function updageSetting(data) {
return {
type: GET_THEME_CONFIG,
data,
};
}
......@@ -3,3 +3,4 @@ export const GET_ERROR_CONFIG = 'App/GET_ERROR_CONFIG';
export const GET_CURRENT_ROUTES = 'App/GET_CURRENT_ROUTES';
export const CREATE_CONEXT = 'App/CREATE_CONEXT';
export const GENERATE_MENU = 'App/GENERATE_MENU';
export const GET_THEME_CONFIG = 'App/THEME_CONFIG';
......@@ -8,6 +8,7 @@ exports.getConfigError = getConfigError;
exports.getCurrentRoute = getCurrentRoute;
exports.createContext = createContext;
exports.generateMenu = generateMenu;
exports.updageSetting = updageSetting;
var _constants = require("./constants");
......@@ -45,3 +46,10 @@ function generateMenu(data) {
data: data
};
}
function updageSetting(data) {
return {
type: _constants.GET_THEME_CONFIG,
data: data
};
}
\ No newline at end of file
......@@ -3,7 +3,7 @@
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GENERATE_MENU = exports.CREATE_CONEXT = exports.GET_CURRENT_ROUTES = exports.GET_ERROR_CONFIG = exports.GET_CONFIG = void 0;
exports.GET_THEME_CONFIG = exports.GENERATE_MENU = exports.CREATE_CONEXT = exports.GET_CURRENT_ROUTES = exports.GET_ERROR_CONFIG = exports.GET_CONFIG = void 0;
var GET_CONFIG = 'App/GET_CONFIG';
exports.GET_CONFIG = GET_CONFIG;
var GET_ERROR_CONFIG = 'App/GET_ERROR_CONFIG';
......@@ -14,3 +14,5 @@ var CREATE_CONEXT = 'App/CREATE_CONEXT';
exports.CREATE_CONEXT = CREATE_CONEXT;
var GENERATE_MENU = 'App/GENERATE_MENU';
exports.GENERATE_MENU = GENERATE_MENU;
var GET_THEME_CONFIG = 'App/THEME_CONFIG';
exports.GET_THEME_CONFIG = GET_THEME_CONFIG;
\ No newline at end of file
......@@ -7,6 +7,8 @@ exports["default"] = exports.initialState = void 0;
var _immutable = require("immutable");
var _defaultSetting = _interopRequireDefault(require("../../../../config/defaultSetting"));
var _routes = _interopRequireDefault(require("../../../utils/routes"));
var _constants = require("./constants");
......@@ -18,7 +20,8 @@ var initialState = (0, _immutable.fromJS)({
globalConfigError: '',
currentRoutes: {},
instance: null,
menu: []
menu: [],
defaultSetting: _defaultSetting["default"]
});
/* eslint-disable default-case, no-param-reassign */
......@@ -30,12 +33,10 @@ var appReducer = function appReducer() {
switch (action.type) {
case _constants.GET_CONFIG:
debugger;
console.log('updateConfig', action.data);
window.__INITIAL_STATE__ = Object.assign({}, action.data, {
allWidgets: action.data.widgets || []
});
debugger;
window.globalConfig = require('kit_global_config')["default"];
createStoreage.set('globalConfig', window.globalConfig);
var config = createStoreage.get('globalConfig');
......@@ -64,6 +65,11 @@ var appReducer = function appReducer() {
menu: action.data
});
case _constants.GET_THEME_CONFIG:
return state.merge({
defaultSetting: action.data
});
default:
return state;
}
......
import { fromJS } from 'immutable';
import defaultSetting from '../../../../config/defaultSetting';
import generRoutes from '../../../utils/routes';
import {
CREATE_CONEXT,
......@@ -7,6 +8,7 @@ import {
GET_CONFIG,
GET_CURRENT_ROUTES,
GET_ERROR_CONFIG,
GET_THEME_CONFIG,
} from './constants';
export const initialState = fromJS({
......@@ -15,18 +17,18 @@ export const initialState = fromJS({
currentRoutes: {},
instance: null,
menu: [],
defaultSetting: defaultSetting,
});
/* eslint-disable default-case, no-param-reassign */
const appReducer = (state = initialState, action) => {
switch (action.type) {
case GET_CONFIG:
debugger;
console.log('updateConfig', action.data);
window.__INITIAL_STATE__ = Object.assign({}, action.data, {
allWidgets: action.data.widgets || [],
});
debugger;
window.globalConfig = require('kit_global_config').default;
createStoreage.set('globalConfig', window.globalConfig);
......@@ -51,6 +53,10 @@ const appReducer = (state = initialState, action) => {
return state.merge({
menu: action.data,
});
case GET_THEME_CONFIG:
return state.merge({
defaultSetting: action.data,
});
default:
return state;
}
......
......@@ -5,10 +5,10 @@ Object.defineProperty(exports, "__esModule", {
});
exports.defaultApp = exports.initMicroApps = void 0;
var _reactDom = _interopRequireDefault(require("react-dom"));
var _qiankun = require("qiankun");
var _micor = _interopRequireDefault(require("../config/micor"));
var _package = _interopRequireDefault(require("../package.json"));
var _constants = require("./utils/constants");
......@@ -16,41 +16,55 @@ var _constants = require("./utils/constants");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
var initMicroApps = function initMicroApps(loader) {
debugger;
(0, _qiankun.registerMicroApps)([{
name: 'web4_console',
entry: "//".concat(window.location.hostname, ":3020/civweb4"),
container: '#subapp-container',
activeRule: function activeRule(location) {
return location.href.indexOf("/".concat(_package["default"].name.toLocaleLowerCase(), "/civweb4")) !== -1;
},
loader: loader,
props: {
var entrys = process.env.NODE_ENV !== 'production' ? _micor["default"].dev : _micor["default"].prod;
(0, _qiankun.registerMicroApps)(entrys.map(function (item) {
item.loader = loader;
item.props = {
emitter: window.share.event,
baseRoot: 'civweb4',
baseRoot: item.name,
globalConfig: JSON.stringify(createStoreage.get('globalConfig') || {}),
XMLHttpRequest: window.XMLHttpRequest
}
}], {
};
return item;
}), {
beforeLoad: [function (app) {
debugger; // hookRequest()
console.log('[LifeCycle] before load %c%s', 'color: green;', JSON.stringify(app));
// hookRequest()
// console.log(
// '[LifeCycle] before load %c%s',
// 'color: green;',
// JSON.stringify(app),
// );
console.log('[LifeCycle] before load %c%s', 'color: green;', app.name);
}],
beforeMount: [function (app) {
debugger; // hookRequest()
_reactDom["default"].unmountComponentAtNode(document.getElementById('subapp-container'));
console.log('[LifeCycle] before mount %c%s', 'color: green;', JSON.stringify(app)); // window.share.event.removeAllListeners();
// hookRequest()
// ReactDOM.unmountComponentAtNode(
// document.getElementById('subapp-container'),
// );
// console.log(
// '[LifeCycle] before mount %c%s',
// 'color: green;',
// JSON.stringify(app),
// );
// window.share.event.removeAllListeners();
console.log('[LifeCycle] before mount %c%s', 'color: green;', app.name);
}],
afterMount: [function (app) {
console.log('[LifeCycle] after mount %c%s', 'color: green;', app.name);
}],
beforeUnmount: [function (app) {
debugger;
console.log('[LifeCycle] before unmount %c%s', 'color: green;', JSON.stringify(app));
window.share.event.removeAllListeners('changeRoute');
console.log('[LifeCycle] after unmount %c%s', 'color: green;', app.name); // console.log(
// '[LifeCycle] before unmount %c%s',
// 'color: green;',
// JSON.stringify(app),
// );
}],
afterUnmount: [function (app) {
debugger;
console.log('[LifeCycle] after unmount %c%s', 'color: green;', JSON.stringify(app));
afterUnmount: [function (app) {// console.log(
// '[LifeCycle] after unmount %c%s',
// 'color: green;',
// JSON.stringify(app),
// );
}]
});
defaultApp();
......@@ -59,7 +73,7 @@ var initMicroApps = function initMicroApps(loader) {
experimentalStyleIsolation: true,
loose: true
},
singular: false,
singular: true,
scopedCSS: true,
getPublicPath: window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__,
excludeAssetFilter: function excludeAssetFilter(url) {
......@@ -80,8 +94,8 @@ var defaultApp = function defaultApp() {
var config = createStoreage.get('globalConfig');
if (config && config.token) {
var startWith = config.homepage ? config.homepage.split('/') : [];
var basePath = _constants.FILTER_FOLER.indexOf(startWith[0]) > -1 ? 'civweb4' : 'civweb';
// const startWith = config.homepage ? config.homepage.split('/') : [];
var basePath = _constants.FILTER_FOLER_REG.test(config.homepage) ? 'civweb4' : 'civweb';
(0, _qiankun.setDefaultMountApp)("/".concat(_package["default"].name.toLocaleLowerCase(), "/").concat(basePath, "/?client=").concat(config.client) // config.homepage
// ? `/${pkg.name.toLocaleLowerCase()}/${basePath}/${config.homepage}`
// : `/${pkg.name.toLocaleLowerCase()}/${basePath}/?client=${
......
......@@ -115,8 +115,8 @@ a {
& /deep/ .ant-menu-dark {
.ant-menu-submenu-selected {
.ant-menu-item-selected {
background: rgb(39, 49, 80);
border-left: 3px solid rgb(23, 160, 242);
// background: rgb(39, 49, 80);
// border-left: 3px solid rgb(23, 160, 242);
}
}
}
......@@ -148,12 +148,25 @@ a {
}
.ant-menu-dark.ant-menu-dark:not(.ant-menu-horizontal) {
.ant-menu-item-selected {
border-left: 2px solid #1890ff;
background-color: #273150;
// border-left: 2px solid #1890ff;
// background-color: #273150;
}
}
}
& /deep/ .ant-pro-global-header-layout-side {
> div {
display: flex;
}
}
}
.panda-pro-components-global-header-index-userWrapper {
& /deep/ .ant-popover-content > .ant-popover-arrow {
border-top-color: #40b3f7!important;
border-left-color: #40b3f7!important;
}
}
//global scrollbar
......
......@@ -4,19 +4,23 @@ import React, {
useState,
} from 'react';
import { Popover } from 'antd';
import { connect } from 'react-redux';
import { matchRoutes } from 'react-router-config';
import {
Link,
useHistory,
} from 'react-router-dom';
matchRoutes,
renderRoutes,
} from 'react-router-config';
import { useHistory } from 'react-router-dom';
import { MenuFoldOutlined } from '@ant-design/icons';
import ProLayout, { SettingDrawer } from '@ant-design/pro-layout';
import RightContent from '../components/GlobalHeader/RightContent';
import { Panel } from '../components/SliderPanel';
import { actionCreators } from '../containers/App/store';
import { getBaseName } from '../utils/utils';
import SecurityLayout from './SecurityLayout';
import Site from './Site';
import styles from './UserLayout.less';
const renderIcon = (icon, size) => {
......@@ -61,13 +65,37 @@ const menuExtraRender = currentRoutes => {
return;
};
const renderTitle = title => {
return <span className={styles['header-title']}>{title}</span>;
const renderTitle = (title, action) => {
const getCityStationsForUser = action && action.getCityStationsForUser();
console.log(getCityStationsForUser)
return (
<>
<span className={styles['header-title']}>
{title}
</span>
<div className={styles.cityContent}>
<Popover placement="bottom">
<span className={styles.siteName}>
<img src="https://panda-water.cn/web4/assets/images/depart.svg"/>
<span>GCK演示</span>
</span>
</Popover>
<span className={styles.weatcher}>
<img src="https://panda-water.cn/web4/assets/images/weather2/0.svg"/>
<span> -1/17</span>
</span>
</div>
</>
);
};
const BasicLayout = props => {
/* eslint-disable no-unused-vars */
const {children, settings, location = {
pathname: '/',
},} = props
const basename = getBaseName();
const history = useHistory();
const [pathname, setPathname] = useState('/welcome');
const [pathname, setPathname] = useState(props.location.pathname);
const [currentRoutes, setCurrentRoutes] = useState(props.route.routes[0]);
const [currentIndex, setCurrentIndex] = useState(0);
const [selectedKeys, setSelectedKeys] = useState([]);
......@@ -79,6 +107,10 @@ const BasicLayout = props => {
setCollapse(collapse);
};
const [siteAction, setSiteAction] = useState(() => {
return new Site(props)
})
matchRoutes(props.route.routes, props.location.pathname);
const extraRender = menuExtraRender(currentRoutes);
let clearTime = null;
......@@ -92,6 +124,7 @@ const BasicLayout = props => {
}, [currentIndex]);
const updateSettings = config => {
console.log(config);
props.updageSetting && props.updageSetting(config);
};
const handleSelectedKey = key => {
......@@ -102,10 +135,11 @@ const BasicLayout = props => {
const handleLogo = event => {
setTimeout(() => {
history.replace('/civbase/industry');
history.replace(`/industry`);
}, 300);
//
};
return (
<SecurityLayout>
<ProLayout
......@@ -113,14 +147,12 @@ const BasicLayout = props => {
siderWidth="145px"
title=""
fixSiderbar={true}
onMenuHeaderClick={event => handleLogo(event)}
onCollapse={collapse => handleMenuCollapse(collapse)}
menuExtraRender={extraRender.render}
rightContentRender={() => <RightContent />}
headerContentRender={() => renderTitle(props.global.title)}
location={{
pathname,
}}
headerContentRender={() => renderTitle(props.global.title, siteAction)}
menu={{
loading,
}}
......@@ -131,13 +163,22 @@ const BasicLayout = props => {
return defaultDom;
}
return (
<Link to={menuItemProps.path}>
<a
to={menuItemProps.path}
onClick={() =>
window.history.replaceState(
null,
`/${basename}${menuItemProps.path}`,
`/${basename}${menuItemProps.path}`,
)
}
>
{renderIcon(
menuItemProps.extData && menuItemProps.extData.icon,
17,
)}
{defaultDom}
</Link>
</a>
);
}}
subMenuItemRender={(menuItemProps, defaultDom) => {
......@@ -168,9 +209,18 @@ const BasicLayout = props => {
menuDataRef.current = menuData || [];
return menuData || [];
}}
menuProps={{
onClick: ({ item, key, keyPath, domEvent }) => {
setSelectedKeys(`${key}`);
setPathname(`/${basename}${key}`);
window.share && window.share.event.emit('changeRoute', key);
},
selectedKeys: [selectedKeys],
}}
{...props}
{...settings}
>
{/* {renderRoutes(props.route.routes)} */}
{renderRoutes(props.route.routes)}
<Panel
visible={extraRender.toggleSystem}
keyboard={true}
......@@ -179,12 +229,13 @@ const BasicLayout = props => {
onChange={index => setCurrentIndex(index)}
onSelect={selectKeys => handleSelectedKey(selectKeys)}
/>
<div
id="subapp-container"
className="subapp-container"
ref={microApp}
<div id="micro-container" className="subapp-container" ref={microApp} />
<SettingDrawer
settings={props.settings}
onSettingChange={config => updateSettings(config)}
publicPath={`/${basename}/theme`}
/>
<SettingDrawer onSettingChange={config => updateSettings(config)} />
</ProLayout>
</SecurityLayout>
);
......@@ -192,9 +243,17 @@ const BasicLayout = props => {
const mapStateToProps = state => {
return {
global: state.getIn(['global', 'globalConfig']),
settings: state.getIn(['global', 'defaultSetting']),
};
};
const mapDispatchToProps = dispatch => {
return {
updageSetting(setting) {
dispatch(actionCreators.updageSetting(setting));
},
};
};
export default connect(
mapStateToProps,
null,
mapDispatchToProps,
)(BasicLayout);
......@@ -3,6 +3,8 @@ import React from 'react';
import { connect } from 'react-redux';
import { Redirect } from 'react-router-dom';
import { getBaseName } from '../utils/utils';
class SecurityLayout extends React.Component {
state = {
isReady: false,
......@@ -15,12 +17,15 @@ class SecurityLayout extends React.Component {
}
render() {
console.log(this.props);
// const { isReady } = this.state;
const { children, global } = this.props;
const isLogin = global.token !== null;
if (!isLogin && window.location.pathname !== '/civbase/user/login') {
return <Redirect to={`/civbase/user/login?client=${global.client}`} />;
if (
!isLogin &&
window.location.pathname !== `/${getBaseName()}/user/login`
) {
return (
<Redirect to={`/${getBaseName()}/user/login?client=${global.client}`} />
);
}
return children;
}
......
import { message } from 'antd';
import Cookies from 'js-cookie';
import cityJson from './city.json';
const ERR_OK = '0000'
class Site {
constructor(props) {
this.weatherCity = null
this.globalConfig = props.global
}
init(config) {
}
initWeatherCity() {
try {
if(navigator.onLine && this.globalConfig && this.globalConfig.userInfo && this.globalConfig.userInfo.site) {
http.getCity().then(res => {
if(res && !isNaN(res.cid)) {
const cityResult = JSON.parse(cityJson);
const city = cityResult[res.cid];
this.weatherCity = city ? city: null;
}
})
}
}catch(e) {
console.error(e)
}
}
getCityStationsForUser() {
debugger
const loginName = this.globalConfig.userInfo.loginName;
const self = this;
Http.getAllGroupsInfoForUser({
loginName: loginName,
'request.preventCache': new Date().getTime()
}, {
ignoreSite: true
}).then(res => {
debugger
if(res && res.say.errMsg === '' && res.say.statusCode === ERR_OK) {
const result = res.getMe;
let city = self.weatherCity;
let arr = [];
self.globalConfig.userInfo.groupType = ""
self.globalConfig.userInfo.Groups = res.getMe;
self.globalConfig.userInfo.Industries = new Array;
if (self.globalConfig.userInfo.Groups && self.globalConfig.userInfo.Groups.length) {
self.globalConfig.userInfo.Groups.forEach(group => {
if (group.industry && self.globalConfig.userInfo.Industries.indexOf(group.industry) < 0) self.globalConfig.userInfo.Industries.push(group.industry);
});
}
if (self.globalConfig.userInfo && self.globalConfig.userInfo.site && self.globalConfig.userInfo.Groups && self.globalConfig.userInfo.Groups.length) {
var _indestryItem = self.globalConfig.userInfo.Groups.find(item => {
return item.site == self.globalConfig.userInfo.site;
});
if (_indestryItem && _indestryItem.industry) {
self.globalConfig.Industry = _indestryItem.industry;
}
}
let allStation = [];
let projectStation = [];
debugger
if (self.globalConfig.Industry) {
allStation = result.filter((item) => {
return item.industry == self.globalConfig.Industry;
})
self.showStations = allStation.filter((item) => {
return item.promoteIndex && item.promoteIndex > 0;
});
projectStation = allStation.filter((item) => {
return !item.promoteIndex;
})
} else {
allStation = result;
}
if (allStation.length) {
let allChoice = false;
allStation.forEach( (val) => {
if (val.promoteIndex == 0) {
allChoice = true;
}
})
if (!allChoice) {
// me.$el.find('#changeCityWays').hide();
// me.$el.find('.LMBcityBox').hide();
// me.$el.find('div.cities').css('min-width', 'initial');
// me.$el.find('.focusStations').addClass('LMBcolumnList');
}
if (allStation.length > 120) {
// $(me.el).find("div.cities div.cityContent").css("height", '335px');
}
let _enterprise = null;
if (self.globalConfig.userInfo.site && self.globalConfig.userInfo.site.length) {
_enterprise = allStation.filter((enterprise) => {
return enterprise.site == self.globalConfig.userInfo.site;
});
}
if (_enterprise && _enterprise.length) {
if (_enterprise[0].groupName.indexOf("演示" >= 0)) {
arr[0] = _enterprise[0].groupName;
} else {
arr = _enterprise[0].city.split('/');
}
let tmp = _enterprise[0].city.split('/')[1];
city = tmp.substr(0, tmp.length - 1);
self.globalConfig.userInfo.groupType = _enterprise[0].groupType;
} else {
arr = allStation[0].city.split('/');
let tmp = arr[1];
city = tmp.substr(0, tmp.length - 1);
self.globalConfig.userInfo.groupType = allStation[0].groupType;
}
}
if (allStation.length > 1) {
let currentStationName = arr[arr.length - 1];
// $(me.el).find('span.city').html(currentStationName);
// $(me.el).find(".item").show();
// $(me.el).find("div.cityAndWeather span.Weather").css('border-left', '1px solid #aaa');
self.AvailableofRegionName(projectStation);
self.buildCitySelectTemple(projectStation);
}
//只有演示环境出现友好提示
if (allStation.length == self.showStations.length) {
self.isOnlyDisplay = true;
// $(me.el).find(".city_pane").hide().siblings('.noStations').css('display', 'flex')
} else {
self.AvailableofRegionName(projectStation);
self.buildCitySelectTemple(projectStation);
}
console.log("showStations", self.showStations)
console.log("city", city)
return city
this.insertYSStation()
// if(city) {
// Http.getWeather({
// city: city
// }).then(res => {
// if(res.say.statusCode === ERR_OK) {
// const firtValue = res.getMe[0];
// if(firtValue.cityName) {
// const text = firtValue.forcastFirst.split(' ')[1];
// const imgPath = firtValue.presentPictureFirst.replace('gif', 'svg')
// return (
// <>
// <img src={`https://panda-water.cn/web4/assets/images/weather2/${imgPath}`}/>
// <span>{text + " " + firtValue.temperatureFirst}</span>
// </>
// )
// }
// }
// })
// }
}
})
}
insertYSStation() {
let list = [];
const hot = ["HOT", "县", "市", "New"];
this.showStations.sort((a, b) => a.promoteIndex - b.promoteIndex);
}
getNumberofRegion() {
}
AvailableofRegionName() {
}
writeCookie(tk, site) {
const date = new Date();
date.setTime(date.getTime() + 24 * 60 * 60 * 1000)
Cookies.set("token", tk, {
expires: date.toGMTString(),
path: "/"
})
const encodeSite = Base64.encode(encodeURIComponent(site));
Cookies.set("site", encodeSite, {
expires: date.toGMTString(),
path: "/"
})
const loginSite = this.getLocalSites()
loginSite[token] = site
localStorage.setItem("loginSite", JSON.stringify(loginSite))
// window.location.reload
}
changeGroup(event) {
c
Http.generateTokenQuick({
loginName: this.globalConfig.userInfo.loginName
}).then(res => {
const token = res.token
if(token) {
this.beforeChangeCheck(token, "")
}
}).catch(error => {
message.warning("切换企业失败")
})
}
beforeChangeCheck(token, site) {
Http.getUserInfo({
token: token,
subOID: 'subOID',
site: site
}).then(res => {
if(res && !res.errMsg) {
this.writeCookie(token, site)
} else {
message.warning('企业切换失败,请联系管理员排查问题!')
}
}).catch(e => {
message.warning('企业切换失败,请联系管理员排查问题!')
})
}
AvailableofRegionName() {}
buildCitySelectTemple() {}
getLocalSites() {
const localSite = localStorage.getItem("loginSite"), value = {};
if(localSite) {
value = JSON.parse(localSite)
}
return value;
}
}
export default Site;
\ No newline at end of file
......@@ -79,8 +79,50 @@
color: #555;
text-shadow: none;
font-weight: 100;
font-size: 20px;
font-size: 22px;
vertical-align: middle;
// padding-left: 80px;
letter-spacing: 2px;
}
.cityContent {
.siteName {
padding-right: 5px;
display: inline;
flex-grow: 1;
cursor: pointer;
text-shadow: none;
color: #777;
font-size: 14px;
vertical-align: middle;
padding-left: 15px;
letter-spacing: 2px;
font-weight: 100;
span {
padding-left: 5px;
text-shadow: none;
color: #777;
font-size: 14px;
vertical-align: middle;
}
img {
margin: 0!important;
}
}
.weatcher {
border-left: 1px solid rgb(170, 170, 170);
text-shadow: none;
color: #777;
font-size: 14px;
font-weight: 100;
vertical-align: middle;
padding-left: 15px;
letter-spacing: 2px;
span {
padding-left: 5px;
vertical-align: middle;
}
img {
width: 24px;
}
}
}
\ No newline at end of file
{
"110100": "北京",
"120100": "天津",
"310100": "上海",
"500100": "重庆",
"710001": "台南",
"710002": "台北",
"710003": "台中",
"710004": "嘉义",
"710005": "高雄",
"130100": "石家庄",
"130200": "唐山",
"130300": "秦皇岛",
"130400": "邯郸",
"130500": "邢台",
"130600": "保定",
"130700": "张家口",
"130800": "承德",
"130900": "沧州",
"131000": "廊坊",
"131100": "衡水",
"140100": "太原",
"140200": "大同",
"140300": "阳泉",
"140400": "长治",
"140500": "晋城",
"140600": "朔州",
"140700": "晋中",
"140800": "运城",
"140900": "忻州",
"141000": "临汾",
"141100": "吕梁",
"150100": "呼和浩特",
"150200": "包头",
"150300": "乌海",
"150400": "赤峰",
"150500": "通辽",
"150600": "鄂尔多斯",
"150700": "呼伦贝尔",
"150800": "巴彦淖尔",
"150900": "乌兰察布",
"152200": "兴安盟",
"152500": "锡林郭勒盟",
"152900": "阿拉善盟",
"210100": "沈阳",
"210200": "大连",
"210300": "鞍山",
"210400": "抚顺",
"210500": "本溪",
"210600": "丹东",
"210700": "锦州",
"210800": "营口",
"210900": "阜新",
"211000": "辽阳",
"211100": "盘锦",
"211200": "铁岭",
"211300": "朝阳",
"211400": "葫芦岛",
"220100": "长春",
"220200": "吉林",
"220300": "四平",
"220400": "辽源",
"220500": "通化",
"220600": "白山",
"220700": "松原",
"220800": "白城",
"222400": "延边朝鲜族自治州",
"230100": "哈尔滨",
"230200": "齐齐哈尔",
"230300": "鸡西",
"230400": "鹤岗",
"230500": "双鸭山",
"230600": "大庆",
"230700": "伊春",
"230800": "佳木斯",
"230900": "七台河",
"231000": "牡丹江",
"231100": "黑河",
"231200": "绥化",
"232700": "大兴安岭地区",
"320100": "南京",
"320200": "无锡",
"320300": "徐州",
"320400": "常州",
"320500": "苏州",
"320600": "南通",
"320700": "连云港",
"320800": "淮安",
"320900": "盐城",
"321000": "扬州",
"321100": "镇江",
"321200": "泰州",
"321300": "宿迁",
"330100": "杭州",
"330200": "宁波",
"330300": "温州",
"330400": "嘉兴",
"330500": "湖州",
"330600": "绍兴",
"330700": "金华",
"330800": "衢州",
"330900": "舟山",
"331000": "台州",
"331100": "丽水",
"340100": "合肥",
"340200": "芜湖",
"340300": "蚌埠",
"340400": "淮南",
"340500": "马鞍山",
"340600": "淮北",
"340700": "铜陵",
"340800": "安庆",
"341000": "黄山",
"341100": "滁州",
"341200": "阜阳",
"341300": "宿州",
"341500": "六安",
"341600": "亳州",
"341700": "池州",
"341800": "宣城",
"350100": "福州",
"350200": "厦门",
"350300": "莆田",
"350400": "三明",
"350500": "泉州",
"350600": "漳州",
"350700": "南平",
"350800": "龙岩",
"350900": "宁德",
"360100": "南昌",
"360200": "景德镇",
"360300": "萍乡",
"360400": "九江",
"360500": "新余",
"360600": "鹰潭",
"360700": "赣州",
"360800": "吉安",
"360900": "宜春",
"361000": "抚州",
"361100": "上饶",
"370100": "济南",
"370200": "青岛",
"370300": "淄博",
"370400": "枣庄",
"370500": "东营",
"370600": "烟台",
"370700": "潍坊",
"370800": "济宁",
"370900": "泰安",
"371000": "威海",
"371100": "日照",
"371200": "莱芜",
"371300": "临沂",
"371400": "德州",
"371500": "聊城",
"371600": "滨州",
"371700": "菏泽",
"410100": "郑州",
"410200": "开封",
"410300": "洛阳",
"410400": "平顶山",
"410500": "安阳",
"410600": "鹤壁",
"410700": "新乡",
"410800": "焦作",
"410900": "濮阳",
"411000": "许昌",
"411100": "漯河",
"411200": "三门峡",
"411300": "南阳",
"411400": "商丘",
"411500": "信阳",
"411600": "周口",
"411700": "驻马店",
"419001": "济源",
"420100": "武汉",
"420200": "黄石",
"420300": "十堰",
"420500": "宜昌",
"420600": "襄阳",
"420700": "鄂州",
"420800": "荆门",
"420900": "孝感",
"421000": "荆州",
"421100": "黄冈",
"421200": "咸宁",
"421300": "随州",
"422800": "恩施土家族苗族自治州",
"429004": "仙桃",
"429005": "潜江",
"429006": "天门",
"429021": "神农架林区",
"430100": "长沙",
"430200": "株洲",
"430300": "湘潭",
"430400": "衡阳",
"430500": "邵阳",
"430600": "岳阳",
"430700": "常德",
"430800": "张家界",
"430900": "益阳",
"431000": "郴州",
"431100": "永州",
"431200": "怀化",
"431300": "娄底",
"433100": "湘西土家族苗族自治州",
"440100": "广州",
"440200": "韶关",
"440300": "深圳",
"440400": "珠海",
"440500": "汕头",
"440600": "佛山",
"440700": "江门",
"440800": "湛江",
"440900": "茂名",
"441200": "肇庆",
"441300": "惠州",
"441400": "梅州",
"441500": "汕尾",
"441600": "河源",
"441700": "阳江",
"441800": "清远",
"441900": "东莞",
"442000": "中山",
"442100": "东沙群岛",
"445100": "潮州",
"445200": "揭阳",
"445300": "云浮",
"450100": "南宁",
"450200": "柳州",
"450300": "桂林",
"450400": "梧州",
"450500": "北海",
"450600": "防城港",
"450700": "钦州",
"450800": "贵港",
"450900": "玉林",
"451000": "百色",
"451100": "贺州",
"451200": "河池",
"451300": "来宾",
"451400": "崇左",
"460100": "海口",
"460200": "三亚",
"460300": "三沙",
"460400": "儋州",
"469001": "五指山",
"469002": "琼海",
"469005": "文昌",
"469006": "万宁",
"469007": "东方",
"469021": "定安",
"469022": "屯昌",
"469023": "澄迈",
"469024": "临高",
"469025": "白沙黎族自治县",
"469026": "昌江黎族自治县",
"469027": "乐东黎族自治县",
"469028": "陵水黎族自治县",
"469029": "保亭黎族苗族自治县",
"469030": "琼中黎族苗族自治县",
"510100": "成都",
"510300": "自贡",
"510400": "攀枝花",
"510500": "泸州",
"510600": "德阳",
"510700": "绵阳",
"510800": "广元",
"510900": "遂宁",
"511000": "内江",
"511100": "乐山",
"511300": "南充",
"511400": "眉山",
"511500": "宜宾",
"511600": "广安",
"511700": "达州",
"511800": "雅安",
"511900": "巴中",
"512000": "资阳",
"513200": "阿坝藏族羌族自治州",
"513300": "甘孜藏族自治州",
"513400": "凉山彝族自治州",
"520100": "贵阳",
"520200": "六盘水",
"520300": "遵义",
"520400": "安顺",
"520500": "毕节",
"520600": "铜仁",
"522300": "黔西南布依族苗族自治州",
"522600": "黔东南苗族侗族自治州",
"522700": "黔南布依族苗族自治州",
"530100": "昆明",
"530300": "曲靖",
"530400": "玉溪",
"530500": "保山",
"530600": "昭通",
"530700": "丽江",
"530800": "普洱",
"530900": "临沧",
"532300": "楚雄彝族自治州",
"532500": "红河哈尼族彝族自治州",
"532600": "文山壮族苗族自治州",
"532800": "西双版纳傣族自治州",
"532900": "大理白族自治州",
"533100": "德宏傣族景颇族自治州",
"533300": "怒江傈僳族自治州",
"533400": "迪庆藏族自治州",
"540100": "拉萨",
"540200": "日喀则",
"540300": "昌都",
"540400": "林芝",
"540500": "山南",
"540600": "那曲",
"542500": "阿里地区",
"610100": "西安",
"610200": "铜川",
"610300": "宝鸡",
"610400": "咸阳",
"610500": "渭南",
"610600": "延安",
"610700": "汉中",
"610800": "榆林",
"610900": "安康",
"611000": "商洛",
"620100": "兰州",
"620200": "嘉峪关",
"620300": "金昌",
"620400": "白银",
"620500": "天水",
"620600": "武威",
"620700": "张掖",
"620800": "平凉",
"620900": "酒泉",
"621000": "庆阳",
"621100": "定西",
"621200": "陇南",
"622900": "临夏回族自治州",
"623000": "甘南藏族自治州",
"630100": "西宁",
"630200": "海东",
"632200": "海北藏族自治州",
"632300": "黄南藏族自治州",
"632500": "海南藏族自治州",
"632600": "果洛藏族自治州",
"632700": "玉树藏族自治州",
"632800": "海西蒙古族藏族自治州",
"640100": "银川",
"640200": "石嘴山",
"640300": "吴忠",
"640400": "固原",
"640500": "中卫",
"650100": "乌鲁木齐",
"650200": "克拉玛依",
"650400": "吐鲁番",
"650500": "哈密市",
"652300": "昌吉回族自治州",
"652700": "博尔塔拉蒙古自治州",
"652800": "巴音郭楞蒙古自治州",
"652900": "阿克苏地区",
"653000": "克孜勒苏柯尔克孜自治州",
"653100": "喀什地区",
"653200": "和田地区",
"654000": "伊犁哈萨克自治州",
"654200": "塔城地区",
"654300": "阿勒泰地区",
"659001": "石河子",
"659002": "阿拉尔",
"659003": "图木舒克",
"659004": "五家渠",
"659005": "北屯",
"659006": "铁门关",
"659007": "双河",
"659008": "可克达拉",
"659009": "昆玉",
"810100": "香港",
"820100": "澳门"
}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _antd = require("antd");
var _jsCookie = _interopRequireDefault(require("js-cookie"));
var _city = _interopRequireDefault(require("./city.json"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _readOnlyError(name) { throw new Error("\"" + name + "\" is read-only"); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
var ERR_OK = '0000';
var Site =
/*#__PURE__*/
function () {
function Site(props) {
_classCallCheck(this, Site);
this.weatherCity = null;
this.globalConfig = props.global;
}
_createClass(Site, [{
key: "init",
value: function init(config) {}
}, {
key: "initWeatherCity",
value: function initWeatherCity() {
var _this = this;
try {
if (navigator.onLine && this.globalConfig && this.globalConfig.userInfo && this.globalConfig.userInfo.site) {
http.getCity().then(function (res) {
if (res && !isNaN(res.cid)) {
var cityResult = JSON.parse(_city["default"]);
var city = cityResult[res.cid];
_this.weatherCity = city ? city : null;
}
});
}
} catch (e) {
console.error(e);
}
}
}, {
key: "getCityStationsForUser",
value: function getCityStationsForUser() {
var _this2 = this;
debugger;
var loginName = this.globalConfig.userInfo.loginName;
var self = this;
Http.getAllGroupsInfoForUser({
loginName: loginName,
'request.preventCache': new Date().getTime()
}, {
ignoreSite: true
}).then(function (res) {
debugger;
if (res && res.say.errMsg === '' && res.say.statusCode === ERR_OK) {
var result = res.getMe;
var city = self.weatherCity;
var arr = [];
self.globalConfig.userInfo.groupType = "";
self.globalConfig.userInfo.Groups = res.getMe;
self.globalConfig.userInfo.Industries = new Array();
if (self.globalConfig.userInfo.Groups && self.globalConfig.userInfo.Groups.length) {
self.globalConfig.userInfo.Groups.forEach(function (group) {
if (group.industry && self.globalConfig.userInfo.Industries.indexOf(group.industry) < 0) self.globalConfig.userInfo.Industries.push(group.industry);
});
}
if (self.globalConfig.userInfo && self.globalConfig.userInfo.site && self.globalConfig.userInfo.Groups && self.globalConfig.userInfo.Groups.length) {
var _indestryItem = self.globalConfig.userInfo.Groups.find(function (item) {
return item.site == self.globalConfig.userInfo.site;
});
if (_indestryItem && _indestryItem.industry) {
self.globalConfig.Industry = _indestryItem.industry;
}
}
var allStation = [];
var projectStation = [];
debugger;
if (self.globalConfig.Industry) {
allStation = result.filter(function (item) {
return item.industry == self.globalConfig.Industry;
});
self.showStations = allStation.filter(function (item) {
return item.promoteIndex && item.promoteIndex > 0;
});
projectStation = allStation.filter(function (item) {
return !item.promoteIndex;
});
} else {
allStation = result;
}
if (allStation.length) {
var allChoice = false;
allStation.forEach(function (val) {
if (val.promoteIndex == 0) {
allChoice = true;
}
});
if (!allChoice) {// me.$el.find('#changeCityWays').hide();
// me.$el.find('.LMBcityBox').hide();
// me.$el.find('div.cities').css('min-width', 'initial');
// me.$el.find('.focusStations').addClass('LMBcolumnList');
}
if (allStation.length > 120) {// $(me.el).find("div.cities div.cityContent").css("height", '335px');
}
var _enterprise = null;
if (self.globalConfig.userInfo.site && self.globalConfig.userInfo.site.length) {
_enterprise = allStation.filter(function (enterprise) {
return enterprise.site == self.globalConfig.userInfo.site;
});
}
if (_enterprise && _enterprise.length) {
if (_enterprise[0].groupName.indexOf("演示" >= 0)) {
arr[0] = _enterprise[0].groupName;
} else {
arr = _enterprise[0].city.split('/');
}
var tmp = _enterprise[0].city.split('/')[1];
city = tmp.substr(0, tmp.length - 1);
self.globalConfig.userInfo.groupType = _enterprise[0].groupType;
} else {
arr = allStation[0].city.split('/');
var _tmp = arr[1];
city = _tmp.substr(0, _tmp.length - 1);
self.globalConfig.userInfo.groupType = allStation[0].groupType;
}
}
if (allStation.length > 1) {
var currentStationName = arr[arr.length - 1]; // $(me.el).find('span.city').html(currentStationName);
// $(me.el).find(".item").show();
// $(me.el).find("div.cityAndWeather span.Weather").css('border-left', '1px solid #aaa');
self.AvailableofRegionName(projectStation);
self.buildCitySelectTemple(projectStation);
} //只有演示环境出现友好提示
if (allStation.length == self.showStations.length) {
self.isOnlyDisplay = true; // $(me.el).find(".city_pane").hide().siblings('.noStations').css('display', 'flex')
} else {
self.AvailableofRegionName(projectStation);
self.buildCitySelectTemple(projectStation);
}
console.log("showStations", self.showStations);
console.log("city", city);
return city;
_this2.insertYSStation(); // if(city) {
// Http.getWeather({
// city: city
// }).then(res => {
// if(res.say.statusCode === ERR_OK) {
// const firtValue = res.getMe[0];
// if(firtValue.cityName) {
// const text = firtValue.forcastFirst.split(' ')[1];
// const imgPath = firtValue.presentPictureFirst.replace('gif', 'svg')
// return (
// <>
// <img src={`https://panda-water.cn/web4/assets/images/weather2/${imgPath}`}/>
// <span>{text + " " + firtValue.temperatureFirst}</span>
// </>
// )
// }
// }
// })
// }
}
});
}
}, {
key: "insertYSStation",
value: function insertYSStation() {
var list = [];
var hot = ["HOT", "县", "市", "New"];
this.showStations.sort(function (a, b) {
return a.promoteIndex - b.promoteIndex;
});
}
}, {
key: "getNumberofRegion",
value: function getNumberofRegion() {}
}, {
key: "AvailableofRegionName",
value: function AvailableofRegionName() {}
}, {
key: "writeCookie",
value: function writeCookie(tk, site) {
var date = new Date();
date.setTime(date.getTime() + 24 * 60 * 60 * 1000);
_jsCookie["default"].set("token", tk, {
expires: date.toGMTString(),
path: "/"
});
var encodeSite = Base64.encode(encodeURIComponent(site));
_jsCookie["default"].set("site", encodeSite, {
expires: date.toGMTString(),
path: "/"
});
var loginSite = this.getLocalSites();
loginSite[token] = site;
localStorage.setItem("loginSite", JSON.stringify(loginSite)); // window.location.reload
}
}, {
key: "changeGroup",
value: function changeGroup(event) {
var _this3 = this;
c;
Http.generateTokenQuick({
loginName: this.globalConfig.userInfo.loginName
}).then(function (res) {
var token = res.token;
if (token) {
_this3.beforeChangeCheck(token, "");
}
})["catch"](function (error) {
_antd.message.warning("切换企业失败");
});
}
}, {
key: "beforeChangeCheck",
value: function beforeChangeCheck(token, site) {
var _this4 = this;
Http.getUserInfo({
token: token,
subOID: 'subOID',
site: site
}).then(function (res) {
if (res && !res.errMsg) {
_this4.writeCookie(token, site);
} else {
_antd.message.warning('企业切换失败,请联系管理员排查问题!');
}
})["catch"](function (e) {
_antd.message.warning('企业切换失败,请联系管理员排查问题!');
});
}
}, {
key: "AvailableofRegionName",
value: function AvailableofRegionName() {}
}, {
key: "buildCitySelectTemple",
value: function buildCitySelectTemple() {}
}, {
key: "getLocalSites",
value: function getLocalSites() {
var localSite = localStorage.getItem("loginSite"),
value = {};
if (localSite) {
value = (_readOnlyError("value"), JSON.parse(localSite));
}
return value;
}
}]);
return Site;
}();
var _default = Site;
exports["default"] = _default;
\ No newline at end of file
import ReactDOM from 'react-dom';
import {
addGlobalUncaughtErrorHandler,
registerMicroApps,
......@@ -8,76 +6,91 @@ import {
start,
} from 'qiankun';
import micorConfig from '../config/micor';
import pkg from '../package.json';
import { FILTER_FOLER } from './utils/constants';
import { FILTER_FOLER_REG } from './utils/constants';
export const initMicroApps = loader => {
debugger;
const entrys =
process.env.NODE_ENV !== 'production' ? micorConfig.dev : micorConfig.prod;
registerMicroApps(
[
{
name: 'web4_console',
entry: `//${window.location.hostname}:3020/civweb4`,
container: '#subapp-container',
activeRule: location =>
location.href.indexOf(`/${pkg.name.toLocaleLowerCase()}/civweb4`) !==
-1,
loader,
props: {
entrys.map(item => {
item.loader = loader;
item.props = {
emitter: window.share.event,
baseRoot: 'civweb4',
globalConfig: JSON.stringify(
createStoreage.get('globalConfig') || {},
),
baseRoot: item.name,
globalConfig: JSON.stringify(createStoreage.get('globalConfig') || {}),
XMLHttpRequest: window.XMLHttpRequest,
},
},
],
};
return item;
}),
{
beforeLoad: [
app => {
debugger;
// hookRequest()
// console.log(
// '[LifeCycle] before load %c%s',
// 'color: green;',
// JSON.stringify(app),
// );
console.log(
'[LifeCycle] before load %c%s',
'color: green;',
JSON.stringify(app),
app.name,
);
},
],
beforeMount: [
app => {
debugger;
// hookRequest()
ReactDOM.unmountComponentAtNode(
document.getElementById('subapp-container'),
);
// ReactDOM.unmountComponentAtNode(
// document.getElementById('subapp-container'),
// );
// console.log(
// '[LifeCycle] before mount %c%s',
// 'color: green;',
// JSON.stringify(app),
// );
// window.share.event.removeAllListeners();
console.log(
'[LifeCycle] before mount %c%s',
'color: green;',
JSON.stringify(app),
app.name,
);
// window.share.event.removeAllListeners();
},
],
beforeUnmount: [
afterMount: [
app => {
debugger;
console.log(
'[LifeCycle] before unmount %c%s',
'[LifeCycle] after mount %c%s',
'color: green;',
JSON.stringify(app),
app.name,
);
},
],
afterUnmount: [
beforeUnmount: [
app => {
debugger;
window.share.event.removeAllListeners('changeRoute');
console.log(
'[LifeCycle] after unmount %c%s',
'color: green;',
JSON.stringify(app),
app.name,
);
// console.log(
// '[LifeCycle] before unmount %c%s',
// 'color: green;',
// JSON.stringify(app),
// );
},
],
afterUnmount: [
app => {
// console.log(
// '[LifeCycle] after unmount %c%s',
// 'color: green;',
// JSON.stringify(app),
// );
},
],
},
......@@ -89,7 +102,7 @@ export const initMicroApps = loader => {
experimentalStyleIsolation: true,
loose: true,
},
singular: false,
singular: true,
scopedCSS: true,
getPublicPath: window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__,
excludeAssetFilter: url => {
......@@ -113,9 +126,10 @@ export const initMicroApps = loader => {
export const defaultApp = () => {
const config = createStoreage.get('globalConfig');
if (config && config.token) {
const startWith = config.homepage ? config.homepage.split('/') : [];
const basePath =
FILTER_FOLER.indexOf(startWith[0]) > -1 ? 'civweb4' : 'civweb';
// const startWith = config.homepage ? config.homepage.split('/') : [];
const basePath = FILTER_FOLER_REG.test(config.homepage)
? 'civweb4'
: 'civweb';
setDefaultMountApp(
`/${pkg.name.toLocaleLowerCase()}/${basePath}/?client=${config.client}`,
// config.homepage
......
......@@ -3,11 +3,16 @@ import React, {
useState,
} from 'react';
import { Spin } from 'antd';
import {
Space,
Spin,
} from 'antd';
import classNames from 'classnames';
import { connect } from 'react-redux';
import { actionCreators } from '../../containers/App/store';
import SecurityLayout from '../../layouts/SecurityLayout';
import LoginAction from '../user/login/login';
import styles from './index.less';
const industries = ['供水', '排水', '消防', '暖通', '节水', '实验室'];
......@@ -35,12 +40,23 @@ const BootPage = props => {
const [loadding, setLoadding] = useState(false);
const handlePage = useCallback((event, type) => {
event.persist();
setLoadding(true)
const config = props.global;
let loginAction = new LoginAction(props);
console.log(loginAction)
config.uiwidgets = [];
config.widgets = [];
config.allWidgets = [];
props.instance && props.instance.updateConfig(config);
props.instance && props.instance.getUserInfoAndConfig('', true, type);
// props.instance && props.instance.getUserInfoAndConfig('', true, type);
loginAction.getUserInfoAndConfig('', true, type)
loginAction.events.on('toggleIndustry', event => {
setLoadding(false);
props.history.push(`/?client=${props.global.client}`);
window.share.event.emit('triggerMicro', props.global);
location.reload();
});
}, []);
return (
<SecurityLayout>
......@@ -78,7 +94,10 @@ const BootPage = props => {
{renderIndustries(props.global, handlePage)}
</ul>
</section>
<Spin spinning={loadding} />
<Space className={styles.abs}>
<Spin spinning={loadding} size="large"/>
</Space>
</div>
</div>
</SecurityLayout>
......@@ -90,8 +109,17 @@ const mapStateToProps = state => {
instance: state.getIn(['global', 'instance']),
};
};
const mapDispatchToProps = dispatch => {
return {
updateConfig(config) {
dispatch(actionCreators.getConfig(config));
},
createContext(data) {
dispatch(actionCreators.createContext(data));
},
};
};
export default connect(
mapStateToProps,
null,
mapDispatchToProps,
)(BootPage);
......@@ -97,6 +97,13 @@
}
}
.abs {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}
......
......@@ -11,6 +11,8 @@ var _jsCookie = _interopRequireDefault(require("js-cookie"));
var _sha = _interopRequireDefault(require("sha1"));
var _SlideVerify = _interopRequireDefault(require("../../../components/SlideVerify"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _readOnlyError(name) { throw new Error("\"" + name + "\" is read-only"); }
......@@ -27,13 +29,12 @@ function () {
function Login(props) {
_classCallCheck(this, Login);
console.log(props);
this.events = window.share.event;
this.globalConfig = props.global;
this.updateConfig = props.updateConfig;
this.createContext = props.createContext;
this.history = props.history;
this.init();
this.hasTry = false; // this.init();
}
_createClass(Login, [{
......@@ -91,7 +92,7 @@ function () {
}
}, {
key: "getIndustry",
value: function getIndustry(flag, token) {
value: function getIndustry(flag, token, _getIndustry) {
var _this3 = this;
this.globalConfig.userInfo.Industries = new Array();
......@@ -105,15 +106,15 @@ function () {
if (!flag && this.isSignIn && this.globalConfig.userInfo.Industries.length && this.globalConfig.userInfo.Industries.length > 1) {
this.createContext(this); //console.log('云平台');
this.history.push('/civbase/industry');
this.history.push('/industry');
return false;
}
this.getWebConfig(token);
this.getWebConfig(token, _getIndustry);
}
}, {
key: "getWebConfig",
value: function getWebConfig(token) {
value: function getWebConfig(token, getIndustry) {
var _this4 = this;
Http.getWebSiteConfig({
......@@ -142,7 +143,9 @@ function () {
_this4.globalConfig.style = 'sandbox';
_this4.globalConfig.uiwidgets = [_this4.globalConfig.shareWidget];
_this4.globalConfig.widgets = [];
} // window.share.event.removeAllListeners('loginSuccess');
} // this.events.removeAllListeners('loginSuccess')
// this.events.removeAllListeners('toggleIndustry')
// window.share.event = this.events;
if (_this4.globalConfig.userInfo.site && _this4.globalConfig.userInfo.site.length > 0) {
......@@ -163,21 +166,14 @@ function () {
if (mainConf.shortcutIcon) _this4.globalConfig.shortcutIcon = mainConf.shortcutIcon;
}
_this4.updateConfig && _this4.updateConfig(_this4.globalConfig); //loginSuccess
debugger;
_this4.events.emit('loginSuccess');
_this4.updateConfig && _this4.updateConfig(_this4.globalConfig);
getIndustry ? _this4.events.emit('toggleIndustry') : _this4.events.emit('loginSuccess');
window.share.event = _this4.events;
});
} else {
//loginSuccess
_this4.updateConfig && _this4.updateConfig(_this4.globalConfig);
debugger;
_this4.events.emit('loginSuccess');
getIndustry ? _this4.events.emit('toggleIndustry') : _this4.events.emit('loginSuccess');
window.share.event = _this4.events;
}
});
......@@ -201,7 +197,6 @@ function () {
}, {
key: "getProjectItems",
value: function getProjectItems() {
debugger;
var MAX_BOTTOM = 0;
var isScale = false;
var widgetIndex = -1;
......@@ -433,7 +428,6 @@ function () {
value: function getUserInfoAndConfig(failCallback, flag, industry) {
var _this7 = this;
debugger;
var token = this.globalConfig.token;
var site = _jsCookie["default"].get('site');
......@@ -470,14 +464,12 @@ function () {
'request.preventCache': Date.now()
}).then(function (response) {
try {
debugger;
if (response && !response.errMsg) {
_this7.globalConfig.userInfo = Object.assign({}, response, _this7.globalConfig.userInfo); // Cookies.set('site', this.globalConfig.userInfo.site);
_this7.writeLogs();
_this7.getIndustry(flag, token);
_this7.getIndustry(flag, token, industry);
} else {
if (_this7.goLogin()) {
return false;
......@@ -508,7 +500,6 @@ function () {
} else {
try {
this.writeLogs();
debugger;
this.getIndustry(flag, token);
} catch (error) {
if (this.goLogin()) {
......@@ -525,6 +516,8 @@ function () {
value: function login(usr, pwd, userPhone, isRememberPWD) {
var _this8 = this;
this.events.removeAllListeners('loginError');
var self = this;
Http.generateToken({
f: 'json',
expiration: this.globalConfig.expiration,
......@@ -562,14 +555,48 @@ function () {
_this8.getUserInfoAndConfig();
} else {
self.hasTry = true;
self.events.emit('loginError', response);
console.log('登录失败', response.message);
_this8.hasTry = true;
}
})["catch"](function (error) {
_this8.handleLoginError();
self.hasTry = true;
self.handleLoginError();
self.events.emit('loginError', error.message);
console.log('登录失败', error.message);
_this8.hasTry = true;
});
}
}, {
key: "loginHandler",
value: function loginHandler(user, pwd, userPhone, isRememberPWD, ref) {
var _this9 = this;
debugger;
if (user && pwd) {
if (this.loginFailed && this.captchaObj) {
this.captchaObj.verify();
} else {
if (this.hasTry) {
this.slideVerify(ref, function () {
_this9.login(user, pwd, userPhone, isRememberPWD);
});
} else {
this.login(user, pwd, userPhone, isRememberPWD);
}
}
}
}
}, {
key: "slideVerify",
value: function slideVerify(ref, _onSuccess, onFail, onRefresh) {
this.events.emit('loginVisible', true);
var slideVerify = new _SlideVerify["default"]();
slideVerify.render({
container: ref.current,
onSuccess: function onSuccess() {
_onSuccess && _onSuccess();
}
});
}
}]);
......
......@@ -7,15 +7,19 @@ import React, {
import {
Alert,
Checkbox,
message,
Modal,
Popover,
} from 'antd';
import classNames from 'classnames';
import { dom } from 'kit_utils';
import QRCode from 'qrcode.react';
import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import { actionCreators } from '../../../containers/App/store';
import LoginForm from './components/Login';
import LoginAction from './Login';
import LoginAction from './login';
import styles from './style.less';
const { UserName, Password, Submit } = LoginForm;
......@@ -23,7 +27,7 @@ const { UserName, Password, Submit } = LoginForm;
const LoginMessage = ({ content }) => (
<Alert
style={{
marginBottom: 24,
marginBottom: 2,
}}
message={content}
type="error"
......@@ -31,35 +35,114 @@ const LoginMessage = ({ content }) => (
/>
);
const useRenderQcode = (props) => {
const qrcodes = props.qrcode.split("|");
const qcodeComponent = (url) => {
return (<img src={url} className="QuickMark-cont" style={{width: '150px', height: '150px'}}/>)
}
let element = [];
qrcodes.forEach((item, index) => {
const firstValue = item.split("=");
switch(firstValue[0]) {
case "小程序":
element.push(
<div className={classNames(styles['quickMark-single'], styles['mini-single'])} key={index}>
<Popover placement="top" content={qcodeComponent("https://panda-water.cn/web4/assets/images/小程序二维码.jpg")}>
<div className={styles['icon-Container']}>
<span className={styles.Wechat}></span>
<span className="iconText WechatText">Wechat</span>
</div>
</Popover>
</div>
)
break;
case "智联小程序":
element.push(
<div className={classNames(styles["quickMark-single"], "miniIOT-single")} key={index}>
<Popover placement="top" content={qcodeComponent("https://panda-water.cn/web4/assets/images/智联小程序二维码.jpg")}>
<div className={styles['icon-Container']}>
<span className={styles.Wechat}></span>
<span className={classNames(styles.iconText, styles.WechatText)}>熊猫智联</span>
</div>
</Popover>
</div>
)
break;
case "Android":
element.push(
<div className={classNames(styles["quickMark-single"], "miniIOT-single")} key={index}>
<Popover placement="top" content={<QRCode value={firstValue[1].replace(/{ip}/ig, props.ip || window.location.host)}/>}>
<div className={styles['icon-Container']}>
<span className={styles.Android}></span>
<span className={classNames(styles.iconText, styles.AndroidText)}>Android</span>
</div>
</Popover>
</div>
)
break;
case "iPhone":
element.push(
<div className={classNames(styles["quickMark-single"], "miniIOT-single")} key={index}>
{/* <img src="https://panda-water.cn/web4/assets/images/智联小程序二维码.jpg" class="QuickMark-cont"/> */}
<Popover placement="top" content={<QRCode value={firstValue[1].replace(/{ip}/ig, props.ip || window.location.host)}/>}>
<div className={styles['icon-Container']}>
<span className={styles.Wechat}></span>
<span className={classNames(styles.iconText, styles.iphoneText)}>iPhone</span>
</div>
</Popover>
</div>
)
break;
default:
if(item && item.replace(/ /g, "").length > 0) {
}
break;
}
})
return element;
}
const Login = props => {
const { userLogin = {} } = props;
const videoRef = useRef();
const loginRef = useRef();
const timeRef = useRef();
const titleRef = useRef();
const sliVerify = useRef();
const loginFormRef = useRef();
const footerRef = useRef();
const { status, type: loginType } = userLogin;
const [status, setStatus ] = useState('normal');
const [autoLogin, setAutoLogin] = useState(true);
const [submitting, setSubmitting] = useState(false);
const [currentDate, setCurrentDate] = useState({});
const [type, setType] = useState('account');
const [visible, setVisible] = useState(false)
const [action, setAction] = useState(() => {
return new LoginAction(props)
})
const handleSubmit = values => {
/* eslint-disable no-console */
let loginAction = new LoginAction(props);
loginAction.login(values.userName, values.password);
action && action.loginHandler(values.userName, values.password, null, false, sliVerify);
setSubmitting(true);
loginAction.events.on('loginSuccess', event => {
action && action.events.on('loginSuccess', event => {
setSubmitting(false);
// window.share.event.on('updateGlobalConfig', props.global);
props.history.push(`/civbase/?client=${props.global.client}`);
props.history.push(`/?client=${props.global.client}`);
window.share.event.emit('triggerMicro', props.global);
});
action && action.events.on('loginError', event => {
console.log(event)
message.error('账户或密码错误')
setSubmitting(false)
})
action && action.events.on('loginVisible', status => {
setVisible(status)
})
};
let loginTimeInterval = null;
let videoTimeout = null;
useEffect(() => {
if (loginTimeInterval)
clearInterval(loginTimeInterval), (loginTimeInterval = null);
......@@ -88,7 +171,7 @@ const Login = props => {
videoRef.current.addEventListener('ended', function() {
dom.removeClass(loginRef.current, styles.caseHide);
dom.addClass(loginRef.current, styles.loginTimeShow);
setTimeout(() => {
videoTimeout = setTimeout(() => {
dom.removeClass(timeRef.current, styles.caseHide);
dom.addClass(timeRef.current, 'animate__fadeIn');
......@@ -102,8 +185,15 @@ const Login = props => {
}, 500);
});
}
return () => {
videoTimeout && clearTimeout(videoTimeout)
}
}, [videoRef]);
const renderAddons = useRenderQcode(props.global)
return (
<div className={styles.main}>
<video
......@@ -173,7 +263,7 @@ const Login = props => {
onTabChange={setType}
onSubmit={handleSubmit}
>
{status === 'error' && loginType === 'account' && !submitting && (
{status === 'error' && type === 'account' && !submitting && (
<LoginMessage content="账户或密码错误" />
)}
<UserName
......@@ -217,7 +307,11 @@ const Login = props => {
)}
ref={footerRef}
>
<div className={classNames('QuickMark', 'QM-wrapper')} />
<div className={classNames(styles.quickMark)}>
{
renderAddons
}
</div>
<span className={classNames(styles.copyright)}>
Copyright ©
<a target="_blank" href="https://panda-water.cn">
......@@ -227,8 +321,22 @@ const Login = props => {
<a target="_blank" id="IndexCaseNumber" href="">
ICP11036640-1
</a>
<span className="addons">
<span className="split"></span>
<a id="qrcode" href="javascript:void(0);"><span class="glyphicon glyphicon-qrcode" role="button" title="手持APP下载"></span></a>
</span>
</span>
</div>
<Modal
centered
visible={visible}
width={340}
footer={null}
closable={false}
bodyStyle={{padding: '15px'}}
>
<div ref={sliVerify}></div>
</Modal>
</div>
);
};
......
......@@ -2,15 +2,17 @@ import { decode } from 'js-base64';
import Cookies from 'js-cookie';
import sha1 from 'sha1';
import SlideVerify from '../../../components/SlideVerify';
class Login {
constructor(props) {
console.log(props);
this.events = window.share.event;
this.globalConfig = props.global;
this.updateConfig = props.updateConfig;
this.createContext = props.createContext;
this.history = props.history;
this.init();
this.hasTry = false
// this.init();
}
init() {
......@@ -72,7 +74,7 @@ class Login {
}
}
getIndustry(flag, token) {
getIndustry(flag, token, getIndustry) {
this.globalConfig.userInfo.Industries = new Array();
if (
this.globalConfig.userInfo.Groups &&
......@@ -95,13 +97,13 @@ class Login {
) {
this.createContext(this);
//console.log('云平台');
this.history.push('/civbase/industry');
this.history.push('/industry');
return false;
}
this.getWebConfig(token);
this.getWebConfig(token, getIndustry);
}
getWebConfig(token) {
getWebConfig(token, getIndustry) {
Http.getWebSiteConfig({
client: this.globalConfig.client,
token: token,
......@@ -134,7 +136,9 @@ class Login {
this.globalConfig.uiwidgets = [this.globalConfig.shareWidget];
this.globalConfig.widgets = [];
}
// window.share.event.removeAllListeners('loginSuccess');
// this.events.removeAllListeners('loginSuccess')
// this.events.removeAllListeners('toggleIndustry')
// window.share.event = this.events;
if (
this.globalConfig.userInfo.site &&
this.globalConfig.userInfo.site.length > 0
......@@ -158,17 +162,15 @@ class Login {
this.globalConfig.shortcutIcon = mainConf.shortcutIcon;
}
this.updateConfig && this.updateConfig(this.globalConfig);
//loginSuccess
debugger;
this.events.emit('loginSuccess');
getIndustry ? this.events.emit('toggleIndustry'):this.events.emit('loginSuccess');
window.share.event = this.events;
});
} else {
//loginSuccess
this.updateConfig && this.updateConfig(this.globalConfig);
debugger;
this.events.emit('loginSuccess');
getIndustry ? this.events.emit('toggleIndustry'):this.events.emit('loginSuccess');
window.share.event = this.events;
}
......@@ -189,7 +191,6 @@ class Login {
}
getProjectItems() {
debugger;
let MAX_BOTTOM = 0;
let isScale = false;
let widgetIndex = -1;
......@@ -410,7 +411,6 @@ class Login {
});
}
getUserInfoAndConfig(failCallback, flag, industry) {
debugger;
const token = this.globalConfig.token;
const site = Cookies.get('site');
let _industrySite = null;
......@@ -455,7 +455,6 @@ class Login {
})
.then(response => {
try {
debugger;
if (response && !response.errMsg) {
this.globalConfig.userInfo = Object.assign(
{},
......@@ -464,7 +463,7 @@ class Login {
);
// Cookies.set('site', this.globalConfig.userInfo.site);
this.writeLogs();
this.getIndustry(flag, token);
this.getIndustry(flag, token, industry);
} else {
if (this.goLogin()) {
return false;
......@@ -490,7 +489,6 @@ class Login {
} else {
try {
this.writeLogs();
debugger;
this.getIndustry(flag, token);
} catch (error) {
if (this.goLogin()) {
......@@ -503,6 +501,8 @@ class Login {
}
login(usr, pwd, userPhone, isRememberPWD) {
this.events.removeAllListeners('loginError')
const self = this;
Http.generateToken({
f: 'json',
expiration: this.globalConfig.expiration, //token过期时间(单位:秒)
......@@ -535,16 +535,47 @@ class Login {
this.updateConfig && this.updateConfig(this.globalConfig);
this.getUserInfoAndConfig();
} else {
self.hasTry = true;
self.events.emit('loginError',response)
console.log('登录失败', response.message);
this.hasTry = true;
}
})
.catch(error => {
this.handleLoginError();
self.hasTry = true;
self.handleLoginError();
self.events.emit('loginError',error.message)
console.log('登录失败', error.message);
this.hasTry = true;
});
}
loginHandler(user, pwd, userPhone, isRememberPWD, ref) {
debugger
if(user && pwd ) {
if(this.loginFailed && this.captchaObj) {
this.captchaObj.verify()
} else {
if(this.hasTry) {
this.slideVerify(ref, () => {
this.login(user, pwd, userPhone, isRememberPWD)
})
} else {
this.login(user, pwd, userPhone, isRememberPWD)
}
}
}
}
slideVerify(ref, onSuccess, onFail, onRefresh) {
this.events.emit('loginVisible', true)
const slideVerify = new SlideVerify()
slideVerify.render({
container: ref.current,
onSuccess: () => {
onSuccess && onSuccess()
}
})
}
}
export default Login;
......@@ -148,6 +148,7 @@
.caseHide {
display: none!important ;
}
.footerCase{
width: 100%;
height: 16%;
......@@ -155,6 +156,60 @@
position: absolute;
bottom: 0;
left: 0;
.quickMark {
position: absolute;
bottom: 48px;
text-align: center;
width: 100%;
font-size: 12px;
min-height: 71px;
&-single {
text-align: center;
width: 120px;
display: inline-block;
span {
&.Android {
display: block;
background-image: url(https://panda-water.cn/web4/assets/images/login/dark/Android1.png);
width: 26px;
height: 32px;
margin: auto;
margin-bottom: 6px;
}
&.Wechat {
display: block;
background-image: url(https://panda-water.cn/web4/assets/images/login/dark/Wechat1.png);
width: 34px;
height: 32px;
margin: auto;
margin-bottom: 6px;
}
&.iphone {
display: block;
background-image: url(https://panda-water.cn/web4/assets/images/login/dark/iphone1.png);
width: 28px;
height: 32px;
margin: auto;
margin-bottom: 6px;
}
}
}
.Android-single .Android-code, .iphone-single .iphone-code {
margin: 0px 0px 10px 0px;
width: 150px;
height: 150px;
background: #fff;
padding: 5px;
display: none;
transform: translateX(-15px);
}
.icon-Container {
height: 50px;
cursor: pointer;
}
}
.copyright {
position: absolute;
z-index: 2;
......
......@@ -8,22 +8,22 @@ export const dyRoutes = routes => {
return {
routes: [
{
path: '/civbase/user',
path: '/user',
component: UserLayout,
routes: [
{
name: 'login',
path: '/civbase/user/login',
path: '/user/login',
component: Login,
},
],
},
{
path: '/civbase/industry',
path: '/industry',
component: BootPage,
},
{
path: '/civbase',
path: '/',
component: BasicLayout,
routes: [...dyRoutes],
},
......
......@@ -27,18 +27,18 @@ var dyRoutes = function dyRoutes(routes) {
var dyRoutes = routes;
return {
routes: [{
path: '/civbase/user',
path: '/user',
component: _UserLayout["default"],
routes: [{
name: 'login',
path: '/civbase/user/login',
path: '/user/login',
component: _login["default"]
}]
}, {
path: '/civbase/industry',
path: '/industry',
component: _bootpage["default"]
}, {
path: '/civbase',
path: '/',
component: _BasicLayout["default"],
routes: _toConsumableArray(dyRoutes)
}]
......
......@@ -2,16 +2,6 @@ export const RESTART_ON_REMOUNT = '@@saga-injector/restart-on-remount';
export const DAEMON = '@@saga-injector/daemon';
export const ONCE_TILL_UNMOUNT = '@@saga-injector/once-till-unmount';
export const FILTER_FOLER = [
'configs',
'configuration',
'framework',
'iframe',
'product',
'productex',
'project',
'qrcode',
'threedimensional',
'video',
'widgetconfigs',
];
export const FILTER_FOLER_REG = /(configs|configuration|framework|iframe|product|productex|project|qrcode|threedimensional|video|widgetconfigs)/;
export const FILTER_FOLER_WEB5 = /(pages)/;
......@@ -3,12 +3,14 @@
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.FILTER_FOLER = exports.ONCE_TILL_UNMOUNT = exports.DAEMON = exports.RESTART_ON_REMOUNT = void 0;
exports.FILTER_FOLER_WEB5 = exports.FILTER_FOLER_REG = exports.ONCE_TILL_UNMOUNT = exports.DAEMON = exports.RESTART_ON_REMOUNT = void 0;
var RESTART_ON_REMOUNT = '@@saga-injector/restart-on-remount';
exports.RESTART_ON_REMOUNT = RESTART_ON_REMOUNT;
var DAEMON = '@@saga-injector/daemon';
exports.DAEMON = DAEMON;
var ONCE_TILL_UNMOUNT = '@@saga-injector/once-till-unmount';
exports.ONCE_TILL_UNMOUNT = ONCE_TILL_UNMOUNT;
var FILTER_FOLER = ['configs', 'configuration', 'framework', 'iframe', 'product', 'productex', 'project', 'qrcode', 'threedimensional', 'video', 'widgetconfigs'];
exports.FILTER_FOLER = FILTER_FOLER;
\ No newline at end of file
var FILTER_FOLER_REG = /(configs|configuration|framework|iframe|product|productex|project|qrcode|threedimensional|video|widgetconfigs)/;
exports.FILTER_FOLER_REG = FILTER_FOLER_REG;
var FILTER_FOLER_WEB5 = /(pages)/;
exports.FILTER_FOLER_WEB5 = FILTER_FOLER_WEB5;
\ No newline at end of file
......@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
});
exports["default"] = exports.guid = void 0;
var _constants = require("./constants");
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
......@@ -16,7 +18,9 @@ var timestamp = new Date().getTime();
var guid = function guid(prefix) {
prefix = prefix || '';
return prefix + (timestamp++).toString(36);
};
}; // web5 web4路由菜单生成
//重写菜单生成, web4和web5分开
exports.guid = guid;
......@@ -26,16 +30,17 @@ var generRotes = function generRotes(data) {
if (item.hasOwnProperty('widgets')) {
ret.push({
name: item.label,
path: "/civbase/civweb4/".concat(guid('web_console')),
path: "/civweb/".concat(guid('web_console')),
component: 'BasicLayout',
routes: generRotes(item.widgets),
extData: _objectSpread({}, item)
});
} else {
var baseURL = _constants.FILTER_FOLER_REG.test(item.url) ? 'civweb4' : 'civweb5';
ret.push({
name: item.label,
component: 'BasicLayout',
path: item.hasOwnProperty('url') ? "/civbase/civweb4/".concat(item.url) + (item.url.indexOf('?') < 0 ? '?' : '&') + "key=".concat(guid()) : guid('web_console'),
path: item.hasOwnProperty('url') ? "/".concat(baseURL, "/").concat(item.url.replace(/\s*/g, "")) : guid('web_console'),
extData: _objectSpread({}, item)
});
}
......
......@@ -4,12 +4,15 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isPromise = isPromise;
exports.getBaseName = getBaseName;
exports.getRouteAuthority = exports.getAuthorityFromRouter = exports.getPageQuery = exports.isUrl = void 0;
var _pathToRegexp = _interopRequireDefault(require("path-to-regexp"));
var _querystring = require("querystring");
var _packageLock = _interopRequireDefault(require("../../package-lock.json"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
......@@ -73,3 +76,7 @@ function isPromise(obj) {
_typeof(obj) === 'object' || typeof obj === 'function') && // 初始promise 或 promise.then返回的
typeof obj.then === 'function';
}
function getBaseName() {
return _packageLock["default"].name.toLocaleLowerCase();
}
\ No newline at end of file
import { FILTER_FOLER_REG } from './constants';
let timestamp = new Date().getTime();
export const guid = function(prefix) {
prefix = prefix || '';
return prefix + (timestamp++).toString(36);
};
// web5 web4路由菜单生成
//重写菜单生成, web4和web5分开
const generRotes = data => {
let ret = [];
data.forEach(item => {
if (item.hasOwnProperty('widgets')) {
ret.push({
name: item.label,
path: `/civbase/civweb4/${guid('web_console')}`,
path: `/civweb/${guid('web_console')}`,
component: 'BasicLayout',
routes: generRotes(item.widgets),
extData: { ...item },
});
} else {
const baseURL = FILTER_FOLER_REG.test(item.url) ? 'civweb4' : 'civweb5';
ret.push({
name: item.label,
component: 'BasicLayout',
path: item.hasOwnProperty('url')
? `/civbase/civweb4/${item.url}` +
(item.url.indexOf('?') < 0 ? '?' : '&') +
`key=${guid()}`
? `/${baseURL}/${item.url.replace(/\s*/g,"")}`
: guid('web_console'),
extData: { ...item },
});
......
import pathRegexp from 'path-to-regexp';
import { parse } from 'querystring';
import pkg from '../../package-lock.json';
/* eslint no-useless-escape:0 import/prefer-default-export:0 */
const reg = /(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/;
......@@ -46,3 +48,7 @@ export function isPromise(obj) {
typeof obj.then === 'function'
);
}
export function getBaseName() {
return pkg.name.toLocaleLowerCase();
}
This source diff could not be displayed because it is too large. You can view the blob instead.
No preview for this file type
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