Commit daf705e8 by zhangleyuan

feat:第一次提交项目代码

parents
/*
* @Author: 吴文洁
* @Date: 2020-04-30 10:39:36
* @LastEditors: 吴文洁
* @LastEditTime: 2020-08-24 11:43:35
* @Description:
*/
module.exports = {
"parser": '@typescript-eslint/parser',
"plugins": [
"jsx-control-statements",
"@typescript-eslint"
],
"rules": {
"react/jsx-no-undef": [2, { "allowGlobals": true }]
},
"extends": ["react-app", "plugin:jsx-control-statements/recommended"],
}
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
## Available Scripts
In the project directory, you can run:
### `yarn start`
Runs the app in the development mode.<br />
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.<br />
You will also see any lint errors in the console.
### `yarn test`
Launches the test runner in the interactive watch mode.<br />
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `yarn build`
Builds the app for production to the `build` folder.<br />
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.<br />
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `yarn eject`
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).
### Code Splitting
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
### Analyzing the Bundle Size
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
### Making a Progressive Web App
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
### Advanced Configuration
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
### Deployment
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
### `yarn build` fails to minify
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
'use strict';
const fs = require('fs');
const path = require('path');
const paths = require('./paths');
// Make sure that including paths.js after env.js will read .env variables.
delete require.cache[require.resolve('./paths')];
const NODE_ENV = process.env.NODE_ENV;
if (!NODE_ENV) {
throw new Error(
'The NODE_ENV environment variable is required but was not specified.'
);
}
// https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use
const dotenvFiles = [
`${paths.dotenv}.${NODE_ENV}.local`,
`${paths.dotenv}.${NODE_ENV}`,
// Don't include `.env.local` for `test` environment
// since normally you expect tests to produce the same
// results for everyone
NODE_ENV !== 'test' && `${paths.dotenv}.local`,
paths.dotenv,
].filter(Boolean);
// Load environment variables from .env* files. Suppress warnings using silent
// if this file is missing. dotenv will never modify any environment variables
// that have already been set. Variable expansion is supported in .env files.
// https://github.com/motdotla/dotenv
// https://github.com/motdotla/dotenv-expand
dotenvFiles.forEach(dotenvFile => {
if (fs.existsSync(dotenvFile)) {
require('dotenv-expand')(
require('dotenv').config({
path: dotenvFile,
})
);
}
});
// We support resolving modules according to `NODE_PATH`.
// This lets you use absolute paths in imports inside large monorepos:
// https://github.com/facebook/create-react-app/issues/253.
// It works similar to `NODE_PATH` in Node itself:
// https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders
// Note that unlike in Node, only *relative* paths from `NODE_PATH` are honored.
// Otherwise, we risk importing Node.js core modules into an app instead of webpack shims.
// https://github.com/facebook/create-react-app/issues/1023#issuecomment-265344421
// We also resolve them to make sure all tools using them work consistently.
const appDirectory = fs.realpathSync(process.cwd());
process.env.NODE_PATH = (process.env.NODE_PATH || '')
.split(path.delimiter)
.filter(folder => folder && !path.isAbsolute(folder))
.map(folder => path.resolve(appDirectory, folder))
.join(path.delimiter);
// Grab NODE_ENV and REACT_APP_* environment variables and prepare them to be
// injected into the application via DefinePlugin in webpack configuration.
const REACT_APP = /^REACT_APP_/i;
function getClientEnvironment(publicUrl) {
const raw = Object.keys(process.env)
.filter(key => REACT_APP.test(key))
.reduce(
(env, key) => {
env[key] = process.env[key];
return env;
},
{
// Useful for determining whether we’re running in production mode.
// Most importantly, it switches React into the correct mode.
NODE_ENV: process.env.NODE_ENV || 'development',
DEPLOY_ENV: process.env.DEPLOY_ENV,
// Useful for resolving the correct path to static assets in `public`.
// For example, <img src={process.env.PUBLIC_URL + '/img/logo.png'} />.
// This should only be used as an escape hatch. Normally you would put
// images into the `src` and `import` them in code to get their paths.
PUBLIC_URL: publicUrl,
// We support configuring the sockjs pathname during development.
// These settings let a developer run multiple simultaneous projects.
// They are used as the connection `hostname`, `pathname` and `port`
// in webpackHotDevClient. They are used as the `sockHost`, `sockPath`
// and `sockPort` options in webpack-dev-server.
WDS_SOCKET_HOST: process.env.WDS_SOCKET_HOST,
WDS_SOCKET_PATH: process.env.WDS_SOCKET_PATH,
WDS_SOCKET_PORT: process.env.WDS_SOCKET_PORT,
}
);
// Stringify all values so we can feed into webpack DefinePlugin
const stringified = {
'process.env': Object.keys(raw).reduce((env, key) => {
env[key] = JSON.stringify(raw[key]);
return env;
}, {}),
};
return { raw, stringified };
}
module.exports = getClientEnvironment;
'use strict';
const fs = require('fs');
const path = require('path');
const crypto = require('crypto');
const chalk = require('react-dev-utils/chalk');
const paths = require('./paths');
// Ensure the certificate and key provided are valid and if not
// throw an easy to debug error
function validateKeyAndCerts({ cert, key, keyFile, crtFile }) {
let encrypted;
try {
// publicEncrypt will throw an error with an invalid cert
encrypted = crypto.publicEncrypt(cert, Buffer.from('test'));
} catch (err) {
throw new Error(
`The certificate "${chalk.yellow(crtFile)}" is invalid.\n${err.message}`
);
}
try {
// privateDecrypt will throw an error with an invalid key
crypto.privateDecrypt(key, encrypted);
} catch (err) {
throw new Error(
`The certificate key "${chalk.yellow(keyFile)}" is invalid.\n${
err.message
}`
);
}
}
// Read file and throw an error if it doesn't exist
function readEnvFile(file, type) {
if (!fs.existsSync(file)) {
throw new Error(
`You specified ${chalk.cyan(
type
)} in your env, but the file "${chalk.yellow(file)}" can't be found.`
);
}
return fs.readFileSync(file);
}
// Get the https config
// Return cert files if provided in env, otherwise just true or false
function getHttpsConfig() {
const { SSL_CRT_FILE, SSL_KEY_FILE, HTTPS } = process.env;
const isHttps = HTTPS === 'true';
if (isHttps && SSL_CRT_FILE && SSL_KEY_FILE) {
const crtFile = path.resolve(paths.appPath, SSL_CRT_FILE);
const keyFile = path.resolve(paths.appPath, SSL_KEY_FILE);
const config = {
cert: readEnvFile(crtFile, 'SSL_CRT_FILE'),
key: readEnvFile(keyFile, 'SSL_KEY_FILE'),
};
validateKeyAndCerts({ ...config, keyFile, crtFile });
return config;
}
return isHttps;
}
module.exports = getHttpsConfig;
'use strict';
// This is a custom Jest transformer turning style imports into empty objects.
// http://facebook.github.io/jest/docs/en/webpack.html
module.exports = {
process() {
return 'module.exports = {};';
},
getCacheKey() {
// The output is always the same.
return 'cssTransform';
},
};
'use strict';
const path = require('path');
const camelcase = require('camelcase');
// This is a custom Jest transformer turning file imports into filenames.
// http://facebook.github.io/jest/docs/en/webpack.html
module.exports = {
process(src, filename) {
const assetFilename = JSON.stringify(path.basename(filename));
if (filename.match(/\.svg$/)) {
// Based on how SVGR generates a component name:
// https://github.com/smooth-code/svgr/blob/01b194cf967347d43d4cbe6b434404731b87cf27/packages/core/src/state.js#L6
const pascalCaseFilename = camelcase(path.parse(filename).name, {
pascalCase: true,
});
const componentName = `Svg${pascalCaseFilename}`;
return `const React = require('react');
module.exports = {
__esModule: true,
default: ${assetFilename},
ReactComponent: React.forwardRef(function ${componentName}(props, ref) {
return {
$$typeof: Symbol.for('react.element'),
type: 'svg',
ref: ref,
key: null,
props: Object.assign({}, props, {
children: ${assetFilename}
})
};
}),
};`;
}
return `module.exports = ${assetFilename};`;
},
};
'use strict';
const fs = require('fs');
const path = require('path');
const paths = require('./paths');
const chalk = require('react-dev-utils/chalk');
const resolve = require('resolve');
/**
* Get additional module paths based on the baseUrl of a compilerOptions object.
*
* @param {Object} options
*/
function getAdditionalModulePaths(options = {}) {
const baseUrl = options.baseUrl;
// We need to explicitly check for null and undefined (and not a falsy value) because
// TypeScript treats an empty string as `.`.
if (baseUrl == null) {
// If there's no baseUrl set we respect NODE_PATH
// Note that NODE_PATH is deprecated and will be removed
// in the next major release of create-react-app.
const nodePath = process.env.NODE_PATH || '';
return nodePath.split(path.delimiter).filter(Boolean);
}
const baseUrlResolved = path.resolve(paths.appPath, baseUrl);
// We don't need to do anything if `baseUrl` is set to `node_modules`. This is
// the default behavior.
if (path.relative(paths.appNodeModules, baseUrlResolved) === '') {
return null;
}
// Allow the user set the `baseUrl` to `appSrc`.
if (path.relative(paths.appSrc, baseUrlResolved) === '') {
return [paths.appSrc];
}
// If the path is equal to the root directory we ignore it here.
// We don't want to allow importing from the root directly as source files are
// not transpiled outside of `src`. We do allow importing them with the
// absolute path (e.g. `src/Components/Button.js`) but we set that up with
// an alias.
if (path.relative(paths.appPath, baseUrlResolved) === '') {
return null;
}
// Otherwise, throw an error.
throw new Error(
chalk.red.bold(
"Your project's `baseUrl` can only be set to `src` or `node_modules`." +
' Create React App does not support other values at this time.'
)
);
}
/**
* Get webpack aliases based on the baseUrl of a compilerOptions object.
*
* @param {*} options
*/
function getWebpackAliases(options = {}) {
const baseUrl = options.baseUrl;
if (!baseUrl) {
return {};
}
const baseUrlResolved = path.resolve(paths.appPath, baseUrl);
if (path.relative(paths.appPath, baseUrlResolved) === '') {
return {
src: paths.appSrc,
};
}
}
/**
* Get jest aliases based on the baseUrl of a compilerOptions object.
*
* @param {*} options
*/
function getJestAliases(options = {}) {
const baseUrl = options.baseUrl;
if (!baseUrl) {
return {};
}
const baseUrlResolved = path.resolve(paths.appPath, baseUrl);
if (path.relative(paths.appPath, baseUrlResolved) === '') {
return {
'^src/(.*)$': '<rootDir>/src/$1',
};
}
}
function getModules() {
// Check if TypeScript is setup
const hasTsConfig = fs.existsSync(paths.appTsConfig);
const hasJsConfig = fs.existsSync(paths.appJsConfig);
if (hasTsConfig && hasJsConfig) {
throw new Error(
'You have both a tsconfig.json and a jsconfig.json. If you are using TypeScript please remove your jsconfig.json file.'
);
}
let config;
// If there's a tsconfig.json we assume it's a
// TypeScript project and set up the config
// based on tsconfig.json
if (hasTsConfig) {
const ts = require(resolve.sync('typescript', {
basedir: paths.appNodeModules,
}));
config = ts.readConfigFile(paths.appTsConfig, ts.sys.readFile).config;
// Otherwise we'll check if there is jsconfig.json
// for non TS projects.
} else if (hasJsConfig) {
config = require(paths.appJsConfig);
}
config = config || {};
const options = config.compilerOptions || {};
const additionalModulePaths = getAdditionalModulePaths(options);
return {
additionalModulePaths: additionalModulePaths,
webpackAliases: getWebpackAliases(options),
jestAliases: getJestAliases(options),
hasTsConfig,
};
}
module.exports = getModules();
/*
* @Author: 吴文洁
* @Date: 2020-08-24 13:36:56
* @LastEditors: 吴文洁
* @LastEditTime: 2020-08-24 13:36:56
* @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
'use strict';
const path = require('path');
const fs = require('fs');
const getPublicUrlOrPath = require('react-dev-utils/getPublicUrlOrPath');
// Make sure any symlinks in the project folder are resolved:
// https://github.com/facebook/create-react-app/issues/637
const appDirectory = fs.realpathSync(process.cwd());
const resolveApp = relativePath => path.resolve(appDirectory, relativePath);
// We use `PUBLIC_URL` environment variable or "homepage" field to infer
// "public path" at which the app is served.
// webpack needs to know it to put the right <script> hrefs into HTML even in
// single-page apps that may serve index.html for nested URLs like /todos/42.
// We can't use a relative path in HTML because we don't want to load something
// like /todos/42/static/js/bundle.7289d.js. We have to know the root.
const publicUrlOrPath = getPublicUrlOrPath(
process.env.NODE_ENV === 'development',
require(resolveApp('package.json')).homepage,
process.env.PUBLIC_URL
);
const moduleFileExtensions = [
'web.mjs',
'mjs',
'web.js',
'js',
'web.ts',
'ts',
'web.tsx',
'tsx',
'json',
'web.jsx',
'jsx',
];
// Resolve file paths in the same order as webpack
const resolveModule = (resolveFn, filePath) => {
const extension = moduleFileExtensions.find(extension =>
fs.existsSync(resolveFn(`${filePath}.${extension}`))
);
if (extension) {
return resolveFn(`${filePath}.${extension}`);
}
return resolveFn(`${filePath}.js`);
};
// config after eject: we're in ./config/
module.exports = {
dotenv: resolveApp('.env'),
appPath: resolveApp('.'),
appBuild: resolveApp('dist'),
appPublic: resolveApp('public'),
appHtml: resolveApp('public/index.html'),
appIndexJs: resolveModule(resolveApp, 'src/index'),
appPackageJson: resolveApp('package.json'),
appSrc: resolveApp('src'),
appTsConfig: resolveApp('tsconfig.json'),
appJsConfig: resolveApp('jsconfig.json'),
yarnLockFile: resolveApp('yarn.lock'),
testsSetup: resolveModule(resolveApp, 'src/setupTests'),
proxySetup: resolveApp('src/setupProxy.js'),
appNodeModules: resolveApp('node_modules'),
publicUrlOrPath,
};
module.exports.moduleFileExtensions = moduleFileExtensions;
'use strict';
const { resolveModuleName } = require('ts-pnp');
exports.resolveModuleName = (
typescript,
moduleName,
containingFile,
compilerOptions,
resolutionHost
) => {
return resolveModuleName(
moduleName,
containingFile,
compilerOptions,
resolutionHost,
typescript.resolveModuleName
);
};
exports.resolveTypeReferenceDirective = (
typescript,
moduleName,
containingFile,
compilerOptions,
resolutionHost
) => {
return resolveModuleName(
moduleName,
containingFile,
compilerOptions,
resolutionHost,
typescript.resolveTypeReferenceDirective
);
};
'use strict';
const fs = require('fs');
const errorOverlayMiddleware = require('react-dev-utils/errorOverlayMiddleware');
const evalSourceMapMiddleware = require('react-dev-utils/evalSourceMapMiddleware');
const noopServiceWorkerMiddleware = require('react-dev-utils/noopServiceWorkerMiddleware');
const ignoredFiles = require('react-dev-utils/ignoredFiles');
const redirectServedPath = require('react-dev-utils/redirectServedPathMiddleware');
const paths = require('./paths');
const getHttpsConfig = require('./getHttpsConfig');
const host = process.env.HOST || '0.0.0.0';
const sockHost = process.env.WDS_SOCKET_HOST;
const sockPath = process.env.WDS_SOCKET_PATH; // default: '/sockjs-node'
const sockPort = process.env.WDS_SOCKET_PORT;
module.exports = function(proxy, allowedHost) {
return {
// WebpackDevServer 2.4.3 introduced a security fix that prevents remote
// websites from potentially accessing local content through DNS rebinding:
// https://github.com/webpack/webpack-dev-server/issues/887
// https://medium.com/webpack/webpack-dev-server-middleware-security-issues-1489d950874a
// However, it made several existing use cases such as development in cloud
// environment or subdomains in development significantly more complicated:
// https://github.com/facebook/create-react-app/issues/2271
// https://github.com/facebook/create-react-app/issues/2233
// While we're investigating better solutions, for now we will take a
// compromise. Since our WDS configuration only serves files in the `public`
// folder we won't consider accessing them a vulnerability. However, if you
// use the `proxy` feature, it gets more dangerous because it can expose
// remote code execution vulnerabilities in backends like Django and Rails.
// So we will disable the host check normally, but enable it if you have
// specified the `proxy` setting. Finally, we let you override it if you
// really know what you're doing with a special environment variable.
disableHostCheck:
!proxy || process.env.DANGEROUSLY_DISABLE_HOST_CHECK === 'true',
// Enable gzip compression of generated files.
compress: true,
// Silence WebpackDevServer's own logs since they're generally not useful.
// It will still show compile warnings and errors with this setting.
clientLogLevel: 'none',
// By default WebpackDevServer serves physical files from current directory
// in addition to all the virtual build products that it serves from memory.
// This is confusing because those files won’t automatically be available in
// production build folder unless we copy them. However, copying the whole
// project directory is dangerous because we may expose sensitive files.
// Instead, we establish a convention that only files in `public` directory
// get served. Our build script will copy `public` into the `build` folder.
// In `index.html`, you can get URL of `public` folder with %PUBLIC_URL%:
// <link rel="icon" href="%PUBLIC_URL%/favicon.ico">
// In JavaScript code, you can access it with `process.env.PUBLIC_URL`.
// Note that we only recommend to use `public` folder as an escape hatch
// for files like `favicon.ico`, `manifest.json`, and libraries that are
// for some reason broken when imported through webpack. If you just want to
// use an image, put it in `src` and `import` it from JavaScript instead.
contentBase: paths.appPublic,
contentBasePublicPath: paths.publicUrlOrPath,
// By default files from `contentBase` will not trigger a page reload.
watchContentBase: true,
// Enable hot reloading server. It will provide WDS_SOCKET_PATH endpoint
// for the WebpackDevServer client so it can learn when the files were
// updated. The WebpackDevServer client is included as an entry point
// in the webpack development configuration. Note that only changes
// to CSS are currently hot reloaded. JS changes will refresh the browser.
hot: true,
// Use 'ws' instead of 'sockjs-node' on server since we're using native
// websockets in `webpackHotDevClient`.
transportMode: 'ws',
// Prevent a WS client from getting injected as we're already including
// `webpackHotDevClient`.
injectClient: false,
// Enable custom sockjs pathname for websocket connection to hot reloading server.
// Enable custom sockjs hostname, pathname and port for websocket connection
// to hot reloading server.
sockHost,
sockPath,
sockPort,
// It is important to tell WebpackDevServer to use the same "publicPath" path as
// we specified in the webpack config. When homepage is '.', default to serving
// from the root.
// remove last slash so user can land on `/test` instead of `/test/`
publicPath: paths.publicUrlOrPath.slice(0, -1),
// WebpackDevServer is noisy by default so we emit custom message instead
// by listening to the compiler events with `compiler.hooks[...].tap` calls above.
quiet: true,
// Reportedly, this avoids CPU overload on some systems.
// https://github.com/facebook/create-react-app/issues/293
// src/node_modules is not ignored to support absolute imports
// https://github.com/facebook/create-react-app/issues/1065
watchOptions: {
ignored: ignoredFiles(paths.appSrc),
},
https: getHttpsConfig(),
host,
overlay: false,
headers: {
'Access-Control-Allow-Origin': '*'
},
historyApiFallback: {
// Paths with dots should still use the history fallback.
// See https://github.com/facebook/create-react-app/issues/387.
disableDotRule: true,
index: paths.publicUrlOrPath,
},
public: allowedHost,
// `proxy` is run between `before` and `after` `webpack-dev-server` hooks
proxy,
before(app, server) {
// Keep `evalSourceMapMiddleware` and `errorOverlayMiddleware`
// middlewares before `redirectServedPath` otherwise will not have any effect
// This lets us fetch source contents from webpack for the error overlay
app.use(evalSourceMapMiddleware(server));
// This lets us open files from the runtime error overlay.
app.use(errorOverlayMiddleware());
if (fs.existsSync(paths.proxySetup)) {
// This registers user provided middleware for proxy reasons
require(paths.proxySetup)(app);
}
},
after(app) {
// Redirect to `PUBLIC_URL` or `homepage` from `package.json` if url not match
app.use(redirectServedPath(paths.publicUrlOrPath));
// This service worker file is effectively a 'no-op' that will reset any
// previous service worker registered for the same host:port combination.
// We do this in development to avoid hitting the production cache if
// it used the same host and port.
// https://github.com/facebook/create-react-app/issues/2272#issuecomment-302832432
app.use(noopServiceWorkerMiddleware(paths.publicUrlOrPath));
},
};
};
{
"files": {
"main.css": "./static/css/main.9d619ca9.chunk.css",
"main.js": "./static/js/main.f0daf0a1.chunk.js",
"main.js.map": "./static/js/main.f0daf0a1.chunk.js.map",
"runtime-main.js": "./static/js/runtime-main.92b18eb7.js",
"runtime-main.js.map": "./static/js/runtime-main.92b18eb7.js.map",
"static/css/2.781455bf.chunk.css": "./static/css/2.781455bf.chunk.css",
"static/js/2.78b55eb5.chunk.js": "./static/js/2.78b55eb5.chunk.js",
"static/js/2.78b55eb5.chunk.js.map": "./static/js/2.78b55eb5.chunk.js.map",
"index.html": "./index.html",
"precache-manifest.608c6b753287828e5b320c9cea320eb2.js": "./precache-manifest.608c6b753287828e5b320c9cea320eb2.js",
"service-worker.js": "./service-worker.js",
"static/css/2.781455bf.chunk.css.map": "./static/css/2.781455bf.chunk.css.map",
"static/css/main.9d619ca9.chunk.css.map": "./static/css/main.9d619ca9.chunk.css.map",
"static/js/2.78b55eb5.chunk.js.LICENSE.txt": "./static/js/2.78b55eb5.chunk.js.LICENSE.txt"
},
"entrypoints": [
"static/js/runtime-main.92b18eb7.js",
"static/css/2.781455bf.chunk.css",
"static/js/2.78b55eb5.chunk.js",
"static/css/main.9d619ca9.chunk.css",
"static/js/main.f0daf0a1.chunk.js"
]
}
\ No newline at end of file
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="./favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="./logo192.png"/><link rel="manifest" href="./manifest.json"/><title>React App</title><script type="text/javascript" src="https://image.xiaomaiketang.com/xm/PhotoClip.js"></script><link href="./static/css/2.781455bf.chunk.css" rel="stylesheet"><link href="./static/css/main.9d619ca9.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,l,a=r[0],c=r[1],f=r[2],p=0,s=[];p<a.length;p++)l=a[p],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(i&&i(r);s.length;)s.shift()();return u.push.apply(u,f||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++){var c=t[a];0!==o[c]&&(n=!1)}n&&(u.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={1:0},u=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="./";var a=this.webpackJsonp_cloudclass=this.webpackJsonp_cloudclass||[],c=a.push.bind(a);a.push=r,a=a.slice();for(var f=0;f<a.length;f++)r(a[f]);var i=c;t()}([])</script><script src="./static/js/2.78b55eb5.chunk.js"></script><script src="./static/js/main.f0daf0a1.chunk.js"></script></body></html>
\ No newline at end of file
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
self.__precacheManifest = (self.__precacheManifest || []).concat([
{
"revision": "14c27cadc75a21ddf21673fb27143a39",
"url": "./index.html"
},
{
"revision": "6fd175c303b4f0744c7b",
"url": "./static/css/2.781455bf.chunk.css"
},
{
"revision": "a32e318eb8839b913662",
"url": "./static/css/main.9d619ca9.chunk.css"
},
{
"revision": "6fd175c303b4f0744c7b",
"url": "./static/js/2.78b55eb5.chunk.js"
},
{
"revision": "6083d9c769f39b252a49c0c719a4b64c",
"url": "./static/js/2.78b55eb5.chunk.js.LICENSE.txt"
},
{
"revision": "a32e318eb8839b913662",
"url": "./static/js/main.f0daf0a1.chunk.js"
},
{
"revision": "1adbb2ea27cf985e253b",
"url": "./static/js/runtime-main.92b18eb7.js"
}
]);
\ No newline at end of file
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:
/**
* Welcome to your Workbox-powered service worker!
*
* You'll need to register this file in your web app and you should
* disable HTTP caching for this file too.
* See https://goo.gl/nhQhGp
*
* The rest of the code is auto-generated. Please don't update this file
* directly; instead, make changes to your Workbox build configuration
* and re-run your build process.
* See https://goo.gl/2aRDsh
*/
importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");
importScripts(
"./precache-manifest.608c6b753287828e5b320c9cea320eb2.js"
);
self.addEventListener('message', (event) => {
if (event.data && event.data.type === 'SKIP_WAITING') {
self.skipWaiting();
}
});
workbox.core.clientsClaim();
/**
* The workboxSW.precacheAndRoute() method efficiently caches and responds to
* requests for URLs in the manifest.
* See https://goo.gl/S9QRab
*/
self.__precacheManifest = [].concat(self.__precacheManifest || []);
workbox.precaching.precacheAndRoute(self.__precacheManifest, {});
workbox.routing.registerNavigationRoute(workbox.precaching.getCacheKeyForURL("./index.html"), {
blacklist: [/^\/_/,/\/[^/?]+\.[^/]+$/],
});
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
*{margin:0;padding:0;box-sizing:border-box}.ant-layout-content{height:100vh;padding:16px;background-color:#f0f2f5}.page-body{background:#fff;padding:16px;margin-top:16px}.video-course .operate{display:flex}.video-course .operate__item{color:#ff7519;cursor:pointer}.video-course .operate__item.split{margin:0 8px}
/*# sourceMappingURL=main.9d619ca9.chunk.css.map */
\ No newline at end of file
{"version":3,"sources":["index.less"],"names":[],"mappings":"AAOA,EACE,QAAA,CACA,SAAA,CACA,qBACF,CAQA,oBACE,YAAA,CACA,YAAA,CACA,wBACF,CACA,WACE,eAAA,CACA,YAAA,CACA,eACF,CA5BA,uBACE,YACF,CACA,6BACE,aAAA,CACA,cACF,CACA,mCACE,YACF","file":"main.9d619ca9.chunk.css","sourcesContent":[".video-course .operate {\n display: flex;\n}\n.video-course .operate__item {\n color: #FF7519;\n cursor: pointer;\n}\n.video-course .operate__item.split {\n margin: 0 8px;\n}\n"]}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
/*!
Copyright (c) 2017 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
/** @license React v0.19.1
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v16.14.0
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v16.14.0
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
//! moment.js
This source diff could not be displayed because it is too large. You can view the blob instead.
!function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports.cloudclass=t():e.cloudclass=t()}(this,(function(){return(this.webpackJsonp_cloudclass=this.webpackJsonp_cloudclass||[]).push([[0],{120:function(e,t,n){},177:function(e,t,n){e.exports=n(350)},243:function(e,t,n){},350:function(e,t,n){"use strict";n.r(t),n.d(t,"bootstrap",(function(){return V})),n.d(t,"mount",(function(){return z})),n.d(t,"unmount",(function(){return G})),n.d(t,"update",(function(){return D}));var a=n(34),o=n.n(a),c=n(69),r=n(0),u=n.n(r),s=n(4),i=n.n(s),l=n(112),p=n(17),d=n(25),m=n(174),f=n(172),h=n(21),v=n(22),y=window.localStorage,b=new(function(){function e(){Object(h.a)(this,e)}return Object(v.a)(e,[{key:"supportLocalStorage",value:function(){return!!y}},{key:"get",value:function(e){if(this.supportLocalStorage())return y.getItem(e)}},{key:"set",value:function(e,t){this.supportLocalStorage()&&y.setItem(e,t)}},{key:"setObj",value:function(e,t){this.supportLocalStorage()&&y.setItem(e,JSON.stringify(t))}},{key:"getObj",value:function(e){var t=null;if(this.supportLocalStorage()){var n=y.getItem(e);try{n&&(t=JSON.parse(n))}catch(a){t=n}}return t}},{key:"remove",value:function(e){this.supportLocalStorage()&&y.removeItem(e)}},{key:"clear",value:function(){this.supportLocalStorage()&&y.clear()}}]),e}()),g="xiaomai",k="https://dev-heimdall.xiaomai5.com/",j=(n(183),n(120),n(40)),O=n(39),w=n(16),E=n(351),N=n(173),_=n(352),I=n(162),S=n.n(I),x=n(353),C=new(function(){function e(){Object(h.a)(this,e)}return Object(v.a)(e,[{key:"getUid",value:function(){return b.get("".concat(g,"_uid"))||"1115167164014264433"}},{key:"getAid",value:function(){return b.get("".concat(g,"_aid"))||"1298172751712686082"}},{key:"getTid",value:function(){return b.get("".concat(g,"_tid"))||"1298172751712686082"}},{key:"getCid",value:function(){return b.get("".concat(g,"_cid"))}},{key:"getToken",value:function(){return b.get("".concat(g,"_token"))||"f24733242f634815a30184dfa5edf9b6"}}]),e}()),T=function(){function e(){Object(h.a)(this,e)}return Object(v.a)(e,null,[{key:"post",value:function(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{requestType:"json"},o="".concat(t,"?p=w&v=v").concat("5.4.8","&userType=").concat("B","&token=").concat(C.getToken(),"&uid=").concat(C.getUid(),"&tid=").concat(C.getTid(),"&aid=").concat(C.getAid());return new Promise((function(t,c){var r=window,u=r.NewVersion,s=r.currentUserInstInfo.instId,i=S.a.create({timeout:2e4,responseType:"json",headers:{instId:s,p:"w",v:"VERSION",vn:"v".concat("5.4.8"),project:"xmzj-web-b",userType:"B",cid:C.getCid(),uid:C.getUid(),tid:C.getTid(),token:C.getToken(),bizAccountId:C.getAid(),xmVersion:u?"5.0":"4.0","Content-Type":"json"===a.requestType?"application/json; charset=UTF-8":"application/x-www-form-urlencoded"}});"GET"!==e&&"form"===a.requestType&&(i.defaults.transformRequest=[function(e){var t="",n=Object.keys(e);return n.forEach((function(a,o){o<n.length-1?t+="".concat(encodeURIComponent(a),"=").concat(encodeURIComponent(e[a]),"&"):t+="".concat(encodeURIComponent(a),"=").concat(encodeURIComponent(e[a]))})),t.replace(/&$/,""),t}]),i.interceptors.request.use((function(e){return e}),(function(e){return Promise.reject(e)})),i.interceptors.response.use((function(e){var t=e.data,n=t.message,a=t.success,o=t.resultMsg,c=t.resultCode;return a||0===c?e:(x.a.error(n||o),Promise.reject(e.data))}),(function(e){return x.a.error(e.message),Promise.reject(e.message)})),i("GET"===e?Object.assign({params:n,url:"".concat(k).concat(o),method:e}):Object.assign({data:n,url:"".concat(k).concat(o),method:e})).then((function(e){t(e.data)})).catch((function(e){c(e)}))}))}}]),e}(),L=function(){function e(){Object(h.a)(this,e)}return Object(v.a)(e,null,[{key:"Business",value:function(e,t,n){return T.post("POST","business/".concat(e),t,n)}},{key:"Apollo",value:function(e,t,n){return T.post("POST","apollo/".concat(e),t,n)}},{key:"Sales",value:function(e,t,n){return T.post("POST","sales/".concat(e),t,n)}},{key:"post",value:function(e,t,n){return T.post("POST",e,t,n)}}]),e}(),U=(n(243),[{key:"cloudClass",name:"\u4e91\u8bfe\u5802",routes:[{key:"video_course",name:"\u89c6\u9891\u8bfe",path:"/cloudclass/video_course",component:function(e){Object(j.a)(n,e);var t=Object(O.a)(n);function n(e){var a;Object(h.a)(this,n),(a=t.call(this,e)).parseColumns=function(){return[{title:"\u89c6\u9891\u8bfe",key:"scheduleName",dataIndex:"scheduleName",width:"25%"},{title:"\u5b66\u5458\u4eba\u6570",key:"stuNum",dataIndex:"stuNum"},{title:"\u521b\u5efa\u4eba",key:"teacherName",dataIndex:"teacherName"},{title:"\u64cd\u4f5c",key:"operate",dataIndex:"operate",render:function(e,t){return u.a.createElement("div",{className:"operate"},u.a.createElement("div",{className:"operate__item"},"\u5206\u4eab"),u.a.createElement("span",{className:"operate__item split"}," | "),u.a.createElement("div",{className:"operate__item"},"\u7f16\u8f91"),u.a.createElement("span",{className:"operate__item split"}," | "),u.a.createElement("div",{className:"operate__item"},"\u5220\u9664"))}}]},a.handleFetchVideoCourseList=function(){L.Apollo("public/apollo/lessonScheduleListPage",a.state.query).then((function(e){var t=e.result,n=(void 0===t?{}:t).records,o=void 0===n?[]:n;a.setState({dataSource:o})}))};var o=window.currentUserInstInfo.instId;return a.state={query:{instId:o,size:10,current:1},dataSource:[]},a}return Object(v.a)(n,[{key:"componentDidMount",value:function(){this.handleFetchVideoCourseList()}},{key:"render",value:function(){var e=this.state.dataSource;return u.a.createElement("div",{className:"video-course"},u.a.createElement("div",{className:"page-header"},"\u89c6\u9891\u8bfe"),u.a.createElement("div",{className:"page-body"},u.a.createElement(_.a,{rowKey:function(e){return e.id},dataSource:e,columns:this.parseColumns()})))}}]),n}(u.a.Component)},{key:"prepare_lesson",name:"\u8d44\u6599\u4e91\u76d8",path:"/cloudclass/prepare_lesson",component:function(e){Object(j.a)(n,e);var t=Object(O.a)(n);function n(e){var a;return Object(h.a)(this,n),(a=t.call(this,e)).state={},a}return Object(v.a)(n,[{key:"render",value:function(){return u.a.createElement("div",{className:"prepare-lesson-page page"},u.a.createElement("div",{className:"content-header"},"\u8d44\u6599\u4e91\u76d8"),u.a.createElement("div",{className:"box content-body"}))}}]),n}(u.a.Component)},{key:"test",name:"\u9875\u9762\u6d4b\u8bd5",path:"/cloudclass/test",component:function(e){Object(j.a)(n,e);var t=Object(O.a)(n);function n(e){var a;return Object(h.a)(this,n),(a=t.call(this,e)).state={},a}return Object(v.a)(n,[{key:"render",value:function(){return u.a.createElement("div",{className:"prepare-lesson-page page"},u.a.createElement("div",{className:"content-header"},"\u6d4b\u8bd5"),u.a.createElement("div",{className:"box content-body"},"\u6d4b\u8bd5\u5185\u5bb9"))}}]),n}(u.a.Component)}]}].map((function(e){return e.routes||[]})).reduce((function(e,t){return e.concat.apply(e,Object(N.a)(t))}))),P=E.a.Content,B=function(e){Object(j.a)(n,e);var t=Object(O.a)(n);function n(){return Object(h.a)(this,n),t.apply(this,arguments)}return Object(v.a)(n,[{key:"render",value:function(){return u.a.createElement("div",{className:"app"},u.a.createElement("div",{className:"content__body"},u.a.createElement(P,null,U.map((function(e){return u.a.createElement(w.a,{key:e.path,component:e.component,path:e.path,exact:e.exact})})))))}}]),n}(u.a.Component),q=Object(d.b)();window.RCHistory=f.a.extend({},q,{push:function(e){q.push(e)},pushState:function(e){q.push(e)},pushStateWithStatus:function(e){q.push(e)},goBack:q.goBack,location:q.location,replace:function(e){q.replace(e)}});var A=function(e){var t=e.verifyInfo;R(t)},R=function(e){var t=e.aid,n=e.tid,a=e.uid,o=e.cid,c=e.token;b.set("".concat(g,"_aid"),t),b.set("".concat(g,"_tid"),n),b.set("".concat(g,"_uid"),a),b.set("".concat(g,"_cid"),o),b.set("".concat(g,"_token"),c)};function V(){return J.apply(this,arguments)}function J(){return(J=Object(c.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:console.log("react app bootstraped");case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function z(e){return F.apply(this,arguments)}function F(){return(F=Object(c.a)(o.a.mark((function e(t){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:A(t),i.a.render(u.a.createElement(l.a,q,u.a.createElement(p.a,{locale:m.a},u.a.createElement(B,null))),document.getElementById("root"));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function G(){return M.apply(this,arguments)}function M(){return(M=Object(c.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:document.getElementById("root")&&i.a.unmountComponentAtNode(document.getElementById("root"));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function D(e){return H.apply(this,arguments)}function H(){return(H=Object(c.a)(o.a.mark((function e(t){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:console.log("update props",t);case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}}},[[177,1,2]]])}));
//# sourceMappingURL=main.f0daf0a1.chunk.js.map
\ No newline at end of file
!function(e){function r(r){for(var n,l,a=r[0],c=r[1],f=r[2],p=0,s=[];p<a.length;p++)l=a[p],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(i&&i(r);s.length;)s.shift()();return u.push.apply(u,f||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++){var c=t[a];0!==o[c]&&(n=!1)}n&&(u.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={1:0},u=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"===typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="./";var a=this.webpackJsonp_cloudclass=this.webpackJsonp_cloudclass||[],c=a.push.bind(a);a.push=r,a=a.slice();for(var f=0;f<a.length;f++)r(a[f]);var i=c;t()}([]);
//# sourceMappingURL=runtime-main.92b18eb7.js.map
\ No newline at end of file
{"version":3,"sources":["../webpack/bootstrap"],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","modules","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","1","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","this","oldJsonpFunction","slice"],"mappings":"aACE,SAASA,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GACnBK,EAAiBL,EAAK,GAIHM,EAAI,EAAGC,EAAW,GACpCD,EAAIH,EAASK,OAAQF,IACzBJ,EAAUC,EAASG,GAChBG,OAAOC,UAAUC,eAAeC,KAAKC,EAAiBX,IAAYW,EAAgBX,IACpFK,EAASO,KAAKD,EAAgBX,GAAS,IAExCW,EAAgBX,GAAW,EAE5B,IAAID,KAAYG,EACZK,OAAOC,UAAUC,eAAeC,KAAKR,EAAaH,KACpDc,EAAQd,GAAYG,EAAYH,IAKlC,IAFGe,GAAqBA,EAAoBhB,GAEtCO,EAASC,QACdD,EAASU,OAATV,GAOD,OAHAW,EAAgBJ,KAAKK,MAAMD,EAAiBb,GAAkB,IAGvDe,IAER,SAASA,IAER,IADA,IAAIC,EACIf,EAAI,EAAGA,EAAIY,EAAgBV,OAAQF,IAAK,CAG/C,IAFA,IAAIgB,EAAiBJ,EAAgBZ,GACjCiB,GAAY,EACRC,EAAI,EAAGA,EAAIF,EAAed,OAAQgB,IAAK,CAC9C,IAAIC,EAAQH,EAAeE,GACG,IAA3BX,EAAgBY,KAAcF,GAAY,GAE3CA,IACFL,EAAgBQ,OAAOpB,IAAK,GAC5Be,EAASM,EAAoBA,EAAoBC,EAAIN,EAAe,KAItE,OAAOD,EAIR,IAAIQ,EAAmB,GAKnBhB,EAAkB,CACrBiB,EAAG,GAGAZ,EAAkB,GAGtB,SAASS,EAAoB1B,GAG5B,GAAG4B,EAAiB5B,GACnB,OAAO4B,EAAiB5B,GAAU8B,QAGnC,IAAIC,EAASH,EAAiB5B,GAAY,CACzCK,EAAGL,EACHgC,GAAG,EACHF,QAAS,IAUV,OANAhB,EAAQd,GAAUW,KAAKoB,EAAOD,QAASC,EAAQA,EAAOD,QAASJ,GAG/DK,EAAOC,GAAI,EAGJD,EAAOD,QAKfJ,EAAoBO,EAAInB,EAGxBY,EAAoBQ,EAAIN,EAGxBF,EAAoBS,EAAI,SAASL,EAASM,EAAMC,GAC3CX,EAAoBY,EAAER,EAASM,IAClC5B,OAAO+B,eAAeT,EAASM,EAAM,CAAEI,YAAY,EAAMC,IAAKJ,KAKhEX,EAAoBgB,EAAI,SAASZ,GACX,qBAAXa,QAA0BA,OAAOC,aAC1CpC,OAAO+B,eAAeT,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DrC,OAAO+B,eAAeT,EAAS,aAAc,CAAEe,OAAO,KAQvDnB,EAAoBoB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQnB,EAAoBmB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,kBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKzC,OAAO0C,OAAO,MAGvB,GAFAxB,EAAoBgB,EAAEO,GACtBzC,OAAO+B,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOnB,EAAoBS,EAAEc,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRvB,EAAoB2B,EAAI,SAAStB,GAChC,IAAIM,EAASN,GAAUA,EAAOiB,WAC7B,WAAwB,OAAOjB,EAAgB,SAC/C,WAA8B,OAAOA,GAEtC,OADAL,EAAoBS,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRX,EAAoBY,EAAI,SAASgB,EAAQC,GAAY,OAAO/C,OAAOC,UAAUC,eAAeC,KAAK2C,EAAQC,IAGzG7B,EAAoB8B,EAAI,KAExB,IAAIC,EAAaC,KAA8B,wBAAIA,KAA8B,yBAAK,GAClFC,EAAmBF,EAAW5C,KAAKuC,KAAKK,GAC5CA,EAAW5C,KAAOf,EAClB2D,EAAaA,EAAWG,QACxB,IAAI,IAAIvD,EAAI,EAAGA,EAAIoD,EAAWlD,OAAQF,IAAKP,EAAqB2D,EAAWpD,IAC3E,IAAIU,EAAsB4C,EAI1BxC,I","file":"static/js/runtime-main.92b18eb7.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t1: 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"./\";\n\n \tvar jsonpArray = this[\"webpackJsonp_cloudclass\"] = this[\"webpackJsonp_cloudclass\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// run deferred modules from other chunks\n \tcheckDeferredModules();\n"],"sourceRoot":""}
\ No newline at end of file
#! /usr/bin/env node
/*
* @Author: 吴文洁
* @Date: 2020-06-05 14:59:14
* @LastEditors: 吴文洁
* @LastEditTime: 2020-08-04 19:28:08
* @Description:
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
const fs = require('fs')
const [
messageFile,
commitType,
] = process.env.HUSKY_GIT_PARAMS.split(' ');
if (commitType == null) {
const currentMessage = fs.readFileSync(messageFile, 'utf8');
// eslint-disable-next-line no-console
const pattern = new RegExp('(feat|fix|style|docs|refactor|pref|test):');
const _currentMessage = currentMessage.replace('\n', '');
if (!pattern.test(currentMessage) && currentMessage.indexOf('Merge branch') === -1) {
// eslint-disable-next-line no-console
console.error(`\x1b[31m ${_currentMessage}不符合commit-msg规范,具体规范请访问 http://wiki.ixm5.cn/pages/viewpage.action?pageId=2918494 \x1b[31m`);
process.exit(1);
}
if (_currentMessage.length <= 10) {
// eslint-disable-next-line no-console
console.error(`\x1b[31m ${_currentMessage}提交的信息字数不得少于5个字符`);
process.exit(1);
}
process.exit(0);
}
#! /usr/bin/env node
/*
* @Author: 吴文洁
* @Date: 2020-06-05 09:38:03
* @LastEditors: 吴文洁
* @LastEditTime: 2020-09-02 15:45:50
* @Description:
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
const execSync = require('child_process').execSync;
// 获取当前分支名称
const branchName = execSync('git rev-parse --abbrev-ref HEAD').toString().trim();
// 校验分支名是否合法
const firstPattern = new RegExp('dev|rc|gray|master');
const secondPattern = new RegExp('(feature|hotfix)/[a-z]{4,}/[0-9]{8,}/[a-zA-Z-]{4,}');
const firstMatch = firstPattern.test(branchName);
const secondMatch = secondPattern.test(branchName);
if (!firstMatch && !secondMatch) {
// eslint-disable-next-line no-console
console.error(`\x1b[31m ${branchName}不符合分支规范,具体规范请访问 http://wiki.ixm5.cn/pages/viewpage.action?pageId=2918496 \x1b[31m`);
process.exit(1);
}
// 获取缓存区内容
// 通过diff指令获得所有改动过(不包括删除)的js文件路径
const fileNameStr = execSync('git diff --diff-filter=AM --cached HEAD --name-only').toString();
const fileNameList = fileNameStr.split('\n').filter(item => !!item);
// 获取需要检测的文件
const detectedFileList = fileNameList.filter(file => {
// 过滤掉空的和hooks文件夹下所有的文件
return file && file.indexOf('hooks') < 0;
});
// 遍历需要检测的文件
let errorFileList = [];
detectedFileList.forEach((file) => {
const results = execSync(`git diff --cached ${file}`);
const pattern = /^http:\/\/{1,}/;
if (pattern.test(results.toString())) {
errorFileList.push(file);
}
});
if (errorFileList.length > 0) {
const errorFileStr = JSON.stringify(errorFileList);
// eslint-disable-next-line no-console
console.error(`\x1b[31m ${errorFileStr}文件中存在不合法的http://,请将http替换为https \x1b[31m`);
process.exit(1);
}
// 校验是否有冲突
const conflictPattern = new RegExp('^<<<<<<<\\s|^=======$|^>>>>>>>\\s');
const conflictFileList = [];
fileNameList.forEach((file) => {
const results = execSync(`git diff --cached ${file}`);
if (conflictPattern.test(results)) {
conflictFileList.push(file);
}
})
if (conflictFileList.length > 0) {
const conflictFileStr = JSON.stringify(conflictFileList);
// eslint-disable-next-line no-console
console.error(`\x1b[31m ${conflictFileStr}文件中存在冲突,请解决冲突之后再提交 \x1b[31m`);
process.exit(1);
}
process.exit(0);
\ No newline at end of file
{
"name": "cloudclass",
"version": "0.1.0",
"private": true,
"homepage": "./",
"dependencies": {
"@babel/core": "7.9.0",
"@babel/plugin-transform-typescript": "^7.11.0",
"@babel/preset-typescript": "^7.10.4",
"@svgr/webpack": "4.3.3",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"@types/react": "^16.9.46",
"@types/react-dom": "^16.9.8",
"@types/react-router-dom": "^5.1.5",
"@types/underscore": "^1.10.22",
"@typescript-eslint/eslint-plugin": "^2.10.0",
"@typescript-eslint/parser": "^2.10.0",
"antd": "3.26.6",
"axios": "^0.20.0",
"babel-eslint": "10.1.0",
"babel-jest": "^24.9.0",
"babel-loader": "8.1.0",
"babel-plugin-jsx-control-statements": "^4.1.0",
"babel-plugin-named-asset-import": "^0.3.6",
"babel-preset-react-app": "^9.1.2",
"camelcase": "^5.3.1",
"case-sensitive-paths-webpack-plugin": "2.3.0",
"cross-env": "^7.0.2",
"css-loader": "3.4.2",
"dotenv": "8.2.0",
"dotenv-expand": "5.1.0",
"eslint": "^6.6.0",
"eslint-config-react-app": "^5.2.1",
"eslint-loader": "3.0.3",
"eslint-plugin-flowtype": "4.6.0",
"eslint-plugin-import": "2.20.1",
"eslint-plugin-jsx-a11y": "6.2.3",
"eslint-plugin-jsx-control-statements": "^2.2.1",
"eslint-plugin-react": "7.19.0",
"eslint-plugin-react-hooks": "^1.6.1",
"file-loader": "4.3.0",
"fs-extra": "^8.1.0",
"html-webpack-plugin": "4.0.0-beta.11",
"husky": "^4.2.5",
"identity-obj-proxy": "3.0.0",
"jest": "24.9.0",
"jest-environment-jsdom-fourteen": "1.0.1",
"jest-resolve": "24.9.0",
"jest-watch-typeahead": "0.4.2",
"less-loader": "^6.2.0",
"microevent": "^1.0.0",
"mini-css-extract-plugin": "0.9.0",
"optimize-css-assets-webpack-plugin": "5.0.3",
"pnp-webpack-plugin": "1.6.4",
"postcss-flexbugs-fixes": "4.1.0",
"postcss-loader": "3.0.0",
"postcss-normalize": "8.0.1",
"postcss-preset-env": "6.7.0",
"postcss-safe-parser": "4.0.1",
"react": "^16.13.1",
"react-app-polyfill": "^1.0.6",
"react-dev-utils": "^10.2.1",
"react-dom": "^16.13.1",
"react-router-dom": "^5.2.0",
"resolve": "1.15.0",
"resolve-url-loader": "3.1.1",
"semver": "6.3.0",
"style-loader": "0.23.1",
"terser-webpack-plugin": "2.3.8",
"ts-pnp": "1.1.6",
"typescript": "^4.0.2",
"underscore": "^1.10.2",
"url-loader": "2.3.0",
"webpack": "4.42.0",
"webpack-dev-server": "3.11.0",
"webpack-manifest-plugin": "2.2.0",
"workbox-webpack-plugin": "4.3.1"
},
"scripts": {
"start": "node scripts/start.js",
"build:dev": "cross-env DEPLOY_ENV=dev node scripts/build.js",
"build:dev1": "cross-env DEPLOY_ENV=dev node scripts/build.js",
"build:rc": "cross-env DEPLOY_ENV=rc node scripts/build.js",
"build:gray": "cross-env DEPLOY_ENV=gray node scripts/build.js",
"build:prod": "cross-env DEPLOY_ENV=prod node scripts/build.js"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"babel": {
"presets": [
"react-app"
],
"plugins": [
"jsx-control-statements"
]
},
"husky": {
"hooks": {
"pre-commit": "node hooks/pre-commit.js",
"commit-msg": "node hooks/commit-msg.js",
"pre-push": "node hooks/pre-commit.js"
}
}
}
<!--
* @Author: 吴文洁
* @Date: 2020-08-24 12:20:57
* @LastEditors: 吴文洁
* @LastEditTime: 2020-08-27 10:10:06
* @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<script type="text/javascript" src="https://image.xiaomaiketang.com/xm/PhotoClip.js"></script>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:
'use strict';
// Do this as the first thing so that any code reading it knows the right env.
process.env.BABEL_ENV = 'production';
process.env.NODE_ENV = 'production';
// Makes the script crash on unhandled rejections instead of silently
// ignoring them. In the future, promise rejections that are not handled will
// terminate the Node.js process with a non-zero exit code.
process.on('unhandledRejection', err => {
throw err;
});
// Ensure environment variables are read.
require('../config/env');
const path = require('path');
const chalk = require('react-dev-utils/chalk');
const fs = require('fs-extra');
const webpack = require('webpack');
const configFactory = require('../config/webpack.config');
const paths = require('../config/paths');
const checkRequiredFiles = require('react-dev-utils/checkRequiredFiles');
const formatWebpackMessages = require('react-dev-utils/formatWebpackMessages');
const printHostingInstructions = require('react-dev-utils/printHostingInstructions');
const FileSizeReporter = require('react-dev-utils/FileSizeReporter');
const printBuildError = require('react-dev-utils/printBuildError');
const measureFileSizesBeforeBuild =
FileSizeReporter.measureFileSizesBeforeBuild;
const printFileSizesAfterBuild = FileSizeReporter.printFileSizesAfterBuild;
const useYarn = fs.existsSync(paths.yarnLockFile);
// These sizes are pretty large. We'll warn for bundles exceeding them.
const WARN_AFTER_BUNDLE_GZIP_SIZE = 512 * 1024;
const WARN_AFTER_CHUNK_GZIP_SIZE = 1024 * 1024;
const isInteractive = process.stdout.isTTY;
// Warn and crash if required files are missing
if (!checkRequiredFiles([paths.appHtml, paths.appIndexJs])) {
process.exit(1);
}
// Generate configuration
const config = configFactory('production');
// We require that you explicitly set browsers and do not fall back to
// browserslist defaults.
const { checkBrowsers } = require('react-dev-utils/browsersHelper');
checkBrowsers(paths.appPath, isInteractive)
.then(() => {
// First, read the current file sizes in build directory.
// This lets us display how much they changed later.
return measureFileSizesBeforeBuild(paths.appBuild);
})
.then(previousFileSizes => {
// Remove all content but keep the directory so that
// if you're in it, you don't end up in Trash
fs.emptyDirSync(paths.appBuild);
// Merge with the public folder
copyPublicFolder();
// Start the webpack build
return build(previousFileSizes);
})
.then(
({ stats, previousFileSizes, warnings }) => {
if (warnings.length) {
console.log(chalk.yellow('Compiled with warnings.\n'));
console.log(warnings.join('\n\n'));
console.log(
'\nSearch for the ' +
chalk.underline(chalk.yellow('keywords')) +
' to learn more about each warning.'
);
console.log(
'To ignore, add ' +
chalk.cyan('// eslint-disable-next-line') +
' to the line before.\n'
);
} else {
console.log(chalk.green('Compiled successfully.\n'));
}
console.log('File sizes after gzip:\n');
printFileSizesAfterBuild(
stats,
previousFileSizes,
paths.appBuild,
WARN_AFTER_BUNDLE_GZIP_SIZE,
WARN_AFTER_CHUNK_GZIP_SIZE
);
console.log();
const appPackage = require(paths.appPackageJson);
const publicUrl = paths.publicUrlOrPath;
const publicPath = config.output.publicPath;
const buildFolder = path.relative(process.cwd(), paths.appBuild);
printHostingInstructions(
appPackage,
publicUrl,
publicPath,
buildFolder,
useYarn
);
},
err => {
const tscCompileOnError = process.env.TSC_COMPILE_ON_ERROR === 'true';
if (tscCompileOnError) {
console.log(
chalk.yellow(
'Compiled with the following type errors (you may want to check these before deploying your app):\n'
)
);
printBuildError(err);
} else {
console.log(chalk.red('Failed to compile.\n'));
printBuildError(err);
process.exit(1);
}
}
)
.catch(err => {
if (err && err.message) {
console.log(err.message);
}
process.exit(1);
});
// Create the production build and print the deployment instructions.
function build(previousFileSizes) {
// We used to support resolving modules according to `NODE_PATH`.
// This now has been deprecated in favor of jsconfig/tsconfig.json
// This lets you use absolute paths in imports inside large monorepos:
if (process.env.NODE_PATH) {
console.log(
chalk.yellow(
'Setting NODE_PATH to resolve modules absolutely has been deprecated in favor of setting baseUrl in jsconfig.json (or tsconfig.json if you are using TypeScript) and will be removed in a future major release of create-react-app.'
)
);
console.log();
}
console.log('Creating an optimized production build...');
const compiler = webpack(config);
return new Promise((resolve, reject) => {
compiler.run((err, stats) => {
let messages;
if (err) {
if (!err.message) {
return reject(err);
}
let errMessage = err.message;
// Add additional information for postcss errors
if (Object.prototype.hasOwnProperty.call(err, 'postcssNode')) {
errMessage +=
'\nCompileError: Begins at CSS selector ' +
err['postcssNode'].selector;
}
messages = formatWebpackMessages({
errors: [errMessage],
warnings: [],
});
} else {
messages = formatWebpackMessages(
stats.toJson({ all: false, warnings: true, errors: true })
);
}
if (messages.errors.length) {
// Only keep the first error. Others are often indicative
// of the same problem, but confuse the reader with noise.
if (messages.errors.length > 1) {
messages.errors.length = 1;
}
return reject(new Error(messages.errors.join('\n\n')));
}
if (
process.env.CI &&
(typeof process.env.CI !== 'string' ||
process.env.CI.toLowerCase() !== 'false') &&
messages.warnings.length
) {
console.log(
chalk.yellow(
'\nTreating warnings as errors because process.env.CI = true.\n' +
'Most CI servers set it automatically.\n'
)
);
return reject(new Error(messages.warnings.join('\n\n')));
}
return resolve({
stats,
previousFileSizes,
warnings: messages.warnings,
});
});
});
}
function copyPublicFolder() {
fs.copySync(paths.appPublic, paths.appBuild, {
dereference: true,
filter: file => file !== paths.appHtml,
});
}
'use strict';
// Do this as the first thing so that any code reading it knows the right env.
process.env.BABEL_ENV = 'development';
process.env.NODE_ENV = 'development';
// Makes the script crash on unhandled rejections instead of silently
// ignoring them. In the future, promise rejections that are not handled will
// terminate the Node.js process with a non-zero exit code.
process.on('unhandledRejection', err => {
throw err;
});
// Ensure environment variables are read.
require('../config/env');
const fs = require('fs');
const chalk = require('react-dev-utils/chalk');
const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
const clearConsole = require('react-dev-utils/clearConsole');
const checkRequiredFiles = require('react-dev-utils/checkRequiredFiles');
const {
choosePort,
createCompiler,
prepareProxy,
prepareUrls,
} = require('react-dev-utils/WebpackDevServerUtils');
const openBrowser = require('react-dev-utils/openBrowser');
const paths = require('../config/paths');
const configFactory = require('../config/webpack.config');
const createDevServerConfig = require('../config/webpackDevServer.config');
const useYarn = fs.existsSync(paths.yarnLockFile);
const isInteractive = process.stdout.isTTY;
// Warn and crash if required files are missing
if (!checkRequiredFiles([paths.appHtml, paths.appIndexJs])) {
process.exit(1);
}
// Tools like Cloud9 rely on this.
const DEFAULT_PORT = parseInt(process.env.PORT, 10) || 3000;
const HOST = process.env.HOST || '0.0.0.0';
if (process.env.HOST) {
console.log(
chalk.cyan(
`Attempting to bind to HOST environment variable: ${chalk.yellow(
chalk.bold(process.env.HOST)
)}`
)
);
console.log(
`If this was unintentional, check that you haven't mistakenly set it in your shell.`
);
console.log(
`Learn more here: ${chalk.yellow('https://bit.ly/CRA-advanced-config')}`
);
console.log();
}
// We require that you explicitly set browsers and do not fall back to
// browserslist defaults.
const { checkBrowsers } = require('react-dev-utils/browsersHelper');
checkBrowsers(paths.appPath, isInteractive)
.then(() => {
// We attempt to use the default port but if it is busy, we offer the user to
// run on a different port. `choosePort()` Promise resolves to the next free port.
return choosePort(HOST, DEFAULT_PORT);
})
.then(port => {
if (port == null) {
// We have not found a port.
return;
}
const config = configFactory('development');
const protocol = process.env.HTTPS === 'true' ? 'https' : 'http';
const appName = require(paths.appPackageJson).name;
const useTypeScript = fs.existsSync(paths.appTsConfig);
const tscCompileOnError = process.env.TSC_COMPILE_ON_ERROR === 'true';
const urls = prepareUrls(
protocol,
HOST,
port,
paths.publicUrlOrPath.slice(0, -1)
);
const devSocket = {
warnings: warnings =>
devServer.sockWrite(devServer.sockets, 'warnings', warnings),
errors: errors =>
devServer.sockWrite(devServer.sockets, 'errors', errors),
};
// Create a webpack compiler that is configured with custom messages.
const compiler = createCompiler({
appName,
config,
devSocket,
urls,
useYarn,
useTypeScript,
tscCompileOnError,
webpack,
});
// Load proxy config
const proxySetting = require(paths.appPackageJson).proxy;
const proxyConfig = prepareProxy(
proxySetting,
paths.appPublic,
paths.publicUrlOrPath
);
// Serve webpack assets generated by the compiler over a web server.
const serverConfig = createDevServerConfig(
proxyConfig,
urls.lanUrlForConfig
);
const devServer = new WebpackDevServer(compiler, serverConfig);
devServer.headers = {
'Access-Control-Allow-Origin': '*',
};
// Launch WebpackDevServer.
devServer.listen(port, HOST, err => {
if (err) {
return console.log(err);
}
if (isInteractive) {
clearConsole();
}
// We used to support resolving modules according to `NODE_PATH`.
// This now has been deprecated in favor of jsconfig/tsconfig.json
// This lets you use absolute paths in imports inside large monorepos:
if (process.env.NODE_PATH) {
console.log(
chalk.yellow(
'Setting NODE_PATH to resolve modules absolutely has been deprecated in favor of setting baseUrl in jsconfig.json (or tsconfig.json if you are using TypeScript) and will be removed in a future major release of create-react-app.'
)
);
console.log();
}
console.log(chalk.cyan('Starting the development server...\n'));
openBrowser(urls.localUrlForBrowser);
});
['SIGINT', 'SIGTERM'].forEach(function(sig) {
process.on(sig, function() {
devServer.close();
process.exit();
});
});
if (isInteractive || process.env.CI !== 'true') {
// Gracefully exit when stdin ends
process.stdin.on('end', function() {
devServer.close();
process.exit();
});
process.stdin.resume();
}
})
.catch(err => {
if (err && err.message) {
console.log(err.message);
}
process.exit(1);
});
'use strict';
// Do this as the first thing so that any code reading it knows the right env.
process.env.BABEL_ENV = 'test';
process.env.NODE_ENV = 'test';
process.env.PUBLIC_URL = '';
// Makes the script crash on unhandled rejections instead of silently
// ignoring them. In the future, promise rejections that are not handled will
// terminate the Node.js process with a non-zero exit code.
process.on('unhandledRejection', err => {
throw err;
});
// Ensure environment variables are read.
require('../config/env');
const jest = require('jest');
const execSync = require('child_process').execSync;
let argv = process.argv.slice(2);
function isInGitRepository() {
try {
execSync('git rev-parse --is-inside-work-tree', { stdio: 'ignore' });
return true;
} catch (e) {
return false;
}
}
function isInMercurialRepository() {
try {
execSync('hg --cwd . root', { stdio: 'ignore' });
return true;
} catch (e) {
return false;
}
}
// Watch unless on CI or explicitly running all tests
if (
!process.env.CI &&
argv.indexOf('--watchAll') === -1 &&
argv.indexOf('--watchAll=false') === -1
) {
// https://github.com/facebook/create-react-app/issues/5210
const hasSourceControl = isInGitRepository() || isInMercurialRepository();
argv.push(hasSourceControl ? '--watch' : '--watchAll');
}
jest.run(argv);
/*
* @Author: 吴文洁
* @Date: 2020-08-19 18:11:13
* @LastEditors: 吴文洁
* @LastEditTime: 2020-08-31 09:50:53
* @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
interface Window {
[key: string]: string,
RCHistory: any,
currentUserInstInfo: {
instId: string,
teacherId?: string,
name?: string
},
Service: any
}
\ No newline at end of file
/*
* @Author: 吴文洁
* @Date: 2020-04-29 19:16:17
* @LastEditors: 吴文洁
* @LastEditTime: 2020-04-30 10:45:06
* @Description:
*/
declare var If: React.SFC<{ condition: boolean }>;
declare var For: React.SFC<{ each: string; index?: string; of: any[] }>;
declare var Choose: React.SFC;
declare var When: React.SFC<{ condition: boolean }>;
declare var Otherwise: React.SFC;
\ No newline at end of file
/*
* @Author: 吴文洁
* @Date: 2020-08-24 11:46:58
* @LastEditors: 吴文洁
* @LastEditTime: 2020-08-24 11:47:25
* @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
/// <reference types="node" />
/// <reference types="react" />
/// <reference types="react-dom" />
declare namespace NodeJS {
interface ProcessEnv {
readonly NODE_ENV: 'development' | 'production';
readonly PUBLIC_URL: string;
}
}
declare module '*.bmp' {
const src: string;
export default src;
}
declare module '*.gif' {
const src: string;
export default src;
}
declare module '*.jpg' {
const src: string;
export default src;
}
declare module '*.jpeg' {
const src: string;
export default src;
}
declare module '*.png' {
const src: string;
export default src;
}
declare module '*.webp' {
const src: string;
export default src;
}
declare module '*.svg' {
import * as React from 'react';
export const ReactComponent: React.FunctionComponent<React.SVGProps<
SVGSVGElement
> & { title?: string }>;
const src: string;
export default src;
}
declare module '*.module.css' {
const classes: { readonly [key: string]: string };
export default classes;
}
declare module '*.module.less' {
const classes: { readonly [key: string]: string };
export default classes;
}
\ No newline at end of file
import React from 'react';
import { Route } from 'react-router-dom';
import { Layout,ConfigProvider } from 'antd';
import { RouteConfig } from '@/routes/interface';
import Header from './modules/root/Header'
import Main from './modules/root/Main'
import Menu from './modules/root/Menu'
import zhCN from 'antd/es/locale/zh_CN'
const { Content } = Layout;
class App extends React.Component {
render() {
return (
<div id="home">
<Header/>
<ConfigProvider locale={zhCN}>
<Main/>
</ConfigProvider>
<Menu/>
</div>
)
}
}
export default App;
\ No newline at end of file
/*
* @Author: 吴文洁
* @Date: 2020-08-31 09:34:31
* @LastEditors: 吴文洁
* @LastEditTime: 2020-08-31 09:35:36
* @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, AxiosPromise } from 'axios';
import { message } from 'antd';
import { BASIC_HOST, TIME_OUT, USER_TYPE, VERSION, PROJECT } from '@/domains/basic-domain/constants';
import User from './user';
interface FetchParams {
url: string,
data: any,
options?: FetchOptions
}
interface FetchOptions {
requestType: string // 请求类型 form为表单类型 json为json类型,默认json类型
}
class Axios {
static post(
method: string,
url: string,
params: any,
options: FetchOptions = { requestType: 'json' }
): Promise<any> {
const _url = `${url}?p=w&v=v${VERSION}&userType=${USER_TYPE}&token=${User.getToken()}&uid=${User.getUid()}&tid=${User.getTid()}&aid=${User.getAid()}`;
return new Promise((resolve, reject) => {
const { NewVersion, currentUserInstInfo } = window;
const { instId } = currentUserInstInfo;
const instance: AxiosInstance = axios.create({
timeout: TIME_OUT,
responseType: 'json',
headers: {
instId,
p: 'w',
v: 'VERSION',
vn: `v${VERSION}`,
project: PROJECT,
userType: USER_TYPE,
cid: User.getCid(),
uid: User.getUid(),
tid: User.getTid(),
token: User.getToken(),
bizAccountId: User.getAid(),
xmVersion: NewVersion ? '5.0' : '4.0',
'Content-Type': options.requestType === 'json' ? 'application/json; charset=UTF-8' : 'application/x-www-form-urlencoded',
}
});
if (method !== 'GET' && options.requestType === 'form') {
instance.defaults.transformRequest = [(queryParam): string => {
let ret: string = '';
const queryKeys = Object.keys(queryParam);
queryKeys.forEach((item: string, index: number): void => {
if (index < queryKeys.length - 1) {
ret += `${encodeURIComponent(item)}=${encodeURIComponent(queryParam[item])}&`;
} else {
ret += `${encodeURIComponent(item)}=${encodeURIComponent(queryParam[item])}`;
}
});
ret.replace(/&$/, '');
return ret;
}]
}
instance.interceptors.request.use((config: AxiosRequestConfig): AxiosRequestConfig => {
return config;
}, (error: Error): Promise<any> => {
return Promise.reject(error);
})
instance.interceptors.response.use((response: AxiosResponse): AxiosResponse | AxiosPromise => {
const { message: ResMessage, success, resultMsg, resultCode } = response.data;
if (success || resultCode === 0) {
return response;
}
message.error(ResMessage || resultMsg);
return Promise.reject(response.data);
}, (error): AxiosPromise => {
message.error(error.message)
return Promise.reject(error.message);
});
let config: any;
if (method === 'GET') {
config = Object.assign({ params, url: `${BASIC_HOST}${_url}`, method });
} else {
config = Object.assign({ data: params, url: `${BASIC_HOST}${_url}`, method });
}
instance(config).then((res: AxiosResponse): void => {
resolve(res.data);
}).catch((error: Error) => {
reject(error);
})
})
}
}
export default Axios;
\ No newline at end of file
/*
* @Author: 吴文洁
* @Date: 2020-08-31 09:34:51
* @LastEditors: 吴文洁
* @LastEditTime: 2020-08-31 09:35:25
* @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
import Axios from './axios';
class Service {
static Business(url: string, params: any, option: any) {
return Axios.post('POST', `business/${url}`, params, option);
}
static Apollo(url: string, params: any, option: any) {
return Axios.post('POST', `apollo/${url}`, params, option);
}
static Sales(url: string, params: any, option: any) {
return Axios.post('POST', `sales/${url}`, params, option);
}
static post(url: string, params: any, option: any) {
return Axios.post('POST', url, params, option);
}
}
export default Service;
\ No newline at end of file
/*
* @Author: 吴文洁
* @Date: 2020-08-31 09:34:36
* @LastEditors: 吴文洁
* @LastEditTime: 2020-08-31 09:35:14
* @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
import { XMStorageImplements } from '@/domains/basic-domain/interface';
const LS: Storage = window.localStorage;
class XMStorage implements XMStorageImplements {
supportLocalStorage() {
return !!LS;
}
get(key: string) {
if (this.supportLocalStorage()) {
return LS.getItem(key);
}
}
set(key: string, value: any) {
if (this.supportLocalStorage()) {
LS.setItem(key, value);
}
}
setObj(key: string, obj: any) {
if (this.supportLocalStorage()) {
LS.setItem(key, JSON.stringify(obj));
}
}
getObj(key: string) {
let value: null | string = null;
if (this.supportLocalStorage()) {
const LSItem = LS.getItem(key);
try {
if (LSItem) {
value = JSON.parse(LSItem);
}
} catch (error) {
value = LSItem;
}
}
return value;
}
remove(key: string) {
if (this.supportLocalStorage()) {
LS.removeItem(key);
}
}
clear() {
if (this.supportLocalStorage()) {
LS.clear();
}
}
}
export default new XMStorage();
\ No newline at end of file
/*
* @Author: 吴文洁
* @Date: 2020-08-31 09:34:25
* @LastEditors: 吴文洁
* @LastEditTime: 2020-08-31 09:54:34
* @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
import Storage from './storage';
import { PREFIX } from '@/domains/basic-domain/constants';
class User {
getUid() {
return Storage.get(`${PREFIX}_uid`) || '1115167164014264433';
}
getAid() {
return Storage.get(`${PREFIX}_aid`) || '1298172751712686082';
}
getTid() {
return Storage.get(`${PREFIX}_tid`) || '1298172751712686082';
}
getCid() {
return Storage.get(`${PREFIX}_cid`);
}
getToken() {
return Storage.get(`${PREFIX}_token`) || 'f24733242f634815a30184dfa5edf9b6';
}
}
export default new User();
\ No newline at end of file
/*
* @Author: 吴文洁
* @Date: 2020-04-28 19:24:31
* @LastEditors: 吴文洁
* @LastEditTime: 2020-08-31 09:46:49
* @Description: 重写antd的样式
*/
.ant-layout-content {
height: 100vh;
padding: 16px;
background-color: #F0F2F5;
}
\ No newline at end of file
@import './normalize.less';
@import './antd-override.less';
@import './variable.less';
.page-body {
background: #fff;
padding: 16px;
margin-top: 16px;
}
\ No newline at end of file
/*
* @Author: 吴文洁
* @Date: 2020-04-28 18:14:52
* @LastEditors: 吴文洁
* @LastEditTime: 2020-08-31 09:36:52
* @Description: 样式格式化
*/
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
// color
@xm-color-primary: #FF7519;
// fonst-size
@xm-font-size-m: 14px;
\ No newline at end of file
<!--
* @Author: 吴文洁
* @Date: 2020-04-29 16:55:55
* @LastEditors: 吴文洁
* @LastEditTime: 2020-04-29 17:15:09
* @Description:
-->
### 全局公用组件
**本目录的引用别名是 @/components**
\ No newline at end of file
import MicroEvent from 'microevent';
class Bus {
}
MicroEvent.mixin(Bus);
export default new Bus();
@import './variables.less';
@theme-red: #fb6465;
@theme-green: #42bcA9;
@theme-blue: #5eb7ed;
@theme-yellow: #FFBF5A;
.page-control-theme(@color) {
.go {
color: @color;
}
.active {
background-color: @color;
border: 1px solid @color;
}
.back {
color: @color;
}
.jumper {
button {
&:active {
color: @color;
}
}
}
li {
a {
color: @color;
}
}
}
.table-theme(@color) when (@color = @theme-yellow) {
thead {
background-color: #FEECE1;
}
tbody {
tr{
border-bottom: 1px solid @xm-color-border;
}
}
.header {
.download {
color: @color;
}
}
}
.table-theme(@color) when (@color = @theme-blue) {
thead {
background-color: #E0F3FE;
}
tbody {
tr{
border-bottom: 1px solid @xm-color-border;
}
}
.header {
.download {
color: @color;
}
}
}
.table-theme(@color) when (@color = @theme-green) {
thead {
background-color: #CFECE8;
}
tbody {
tr {
border-bottom:1px solid @xm-color-border;
}
}
.header {
.download {
color: @color;
}
}
}
.table-theme(@color) when (@color = @theme-red) {
thead {
background-color: #FCE6E6;
}
tbody {
tr:nth-child(even) {
background-color: #FFF9F9;
}
}
.header {
.download {
color: @color;
}
}
}
.tab(@color) {
span {
color: @xm-sub-text-color;
border: 1px solid @color;
border-left: none;
&:first-child {
border-left: 1px solid @color;
}
}
.active {
color: #ffffff;
background: @color;
}
}
.graph-theme(@color) {
.ac-tooltip {
border: 1px solid @color;
}
}
.flexbox() {
display: -webkit-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
}
.flex(@value: 1) {
-webkit-box-flex: @value;
-webkit-flex: @value;
flex: @value;
}
// order
.order(@value: 1) {
-webkit-box-ordinal-group: @value;
-webkit-border: @value;
order: @value;
}
.flex-wrap(@fw) when (@fw = nowrap) {
-webkit-box-lines: single;
-moz-box-lines: single;
-webkit-flex-wrap: nowrap;
-ms-flex-wrap: none;
-ms-flex-wrap: nowrap;
flex-wrap: nowrap;
}
.flex-wrap(@fw) when (@fw = wrap) {
-webkit-box-lines: multiple;
-moz-box-lines: multiple;
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
}
.flex-wrap(@fw) when not (@fw = wrap) and not (@fw = nowrap) {
-webkit-flex-wrap: @fw;
-ms-flex-wrap: @fw;
flex-wrap: @fw;
}
.flex-shrink(@fs) {
-webkit-flex-shrink: @fs;
-ms-flex: 0 @fs auto;
flex-shrink: @fs;
}
// flex-direction
.flex-direction (@direction) when (@direction = row) {
-webkit-box-direction: normal;
-webkit-box-orient: horizontal;
-webkit-flex-direction: row;
flex-direction: row;
}
.flex-direction (@direction) when (@direction = row-reverse) {
-webkit-box-pack: end;
-webkit-box-orient: reverse;
-webkit-flex-direction: row-reverse;
flex-direction: row-reverse;
}
.flex-direction (@direction) when (@direction = column) {
-webkit-box-direction: normal;
-webkit-box-orient: vertical;
-webkit-flex-direction: column;
flex-direction: column;
}
.flex-direction (@direction) when (@direction = column-reverse) {
-webkit-box-pack: end;
-webkit-box-orient: reverse;
-webkit-flex-direction: column-reverse;
flex-direction: column-reverse;
}
.justify-content(@jc) when (@jc = flex-start) {
-webkit-box-pack: start;
-ms-flex-pack: start;
-webkit-justify-content: flex-start;
justify-content: flex-start;
}
.justify-content(@jc) when (@jc = flex-end) {
-webkit-box-pack: end;
-ms-flex-pack: end;
-webkit-justify-content: flex-end;
justify-content: flex-end;
}
.justify-content(@jc) when (@jc = space-between) {
-webkit-box-pack: justify;
-moz-box-pack: justify;
-ms-flex-pack: justify;
-webkit-justify-content: space-between;
justify-content: space-between;
}
.justify-content(@jc) when not (@jc = flex-start) and not (@jc = flex-end) and not (@jc = space-between) {
-webkit-box-pack: @jc;
-ms-flex-pack: @jc;
-webkit-justify-content: @jc;
justify-content: @jc;
}
.align-items(@ai) when (@ai = flex-start) {
-webkit-box-align: start;
-ms-flex-align: start;
-webkit-align-items: flex-start;
align-items: flex-start;
}
.align-items(@ai) when (@ai = flex-end) {
-webkit-box-align: end;
-ms-flex-align: end;
-webkit-align-items: flex-end;
align-items: flex-end;
}
.align-items(@ai) when not (@ai = flex-start) and not (@ai = flex-end) {
-webkit-box-align: @ai;
-ms-flex-align: @ai;
-webkit-align-items: @ai;
align-items: @ai;
}
.align-content(@ai) {
-ms-flex-line-pack: @ai;
-webkit-align-content: @ai;
align-content: @ai;
}
.align-self(@as) {
-ms-flex-item-align: @as;
-webkit-align-self: @as;
align-self: @as;
}
.text-overflow-ellipsis(){
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
width: 100%;
display: inline-block;
}
.text-overflow-ellipsis-line(@line) {
text-overflow: ellipsis;
overflow: hidden;
word-break:break-all;
display:-webkit-box;
-webkit-line-clamp: @line;
/*! autoprefixer: off */
-webkit-box-orient:vertical;
/* autoprefixer: on */
}
.btn-poster() {
display: inline-block;
padding: 3px 12px;
color: #666;
border-radius:4px;
border: 1px solid #e8e8e8;
cursor: pointer;
}
@import './mixins.less';
@import './antd.less';
.page {
position: absolute;
top: 0px;
left: 0px;
right: 0;
bottom: 0;
z-index: 101;
background-color: #F0F2F5;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
.page {
position: fixed;
top: 50px;
left: 180px;
right: 0;
bottom: 0;
z-index: 102;
overflow: auto;
.box{
&:first-child{
margin-bottom: 8px;
}
&+.box{
margin: 8px 16px;
}
&:last-child{
margin-bottom: 16px;
}
}
}
.page-content {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
box-sizing: border-box;
overflow-y: auto;
animation: all 0.75;
padding-bottom: 16px;
}
.content-sub-header{
padding: 0px 16px 0;
line-height: 30px;
}
.content-header {
padding: 10px 16px;
line-height: 30px;
h1 {
font-size: 14px;
color: #898989;
font-weight: normal;
display: inline-block;
}
}
.box{
padding: 16px;
margin: 0 16px 16px;
margin-bottom: 8px;
background: #ffffff;
// min-height: 400px;
.box-header {
line-height: 30px;
padding-bottom: 12px;
&.searchOnly{
padding-bottom: 0px;
}
.filter-row {
min-height: 30px;
margin-bottom: 10px;
>* {
float: left;
margin-left: 16px;
height: 40px;
}
>.ant-btn {
height: 28px!important;
}
*:first-child {
margin-left: 0px;
}
}
}
.box-footer {
margin-top: 16px;
}
&:first-child{
margin-bottom: 8px;
}
&+.box{
margin: 8px 16px;
}
&:last-child{
margin-bottom: 16px;
}
}
// .ant-calendar-picker{
// top:-1px;
// }
}
.box-header {
.ant-row-flex {
padding-top: 2px;
>div:nth-child(1) {
display: flex;
flex-wrap: wrap;
align-items:space-between;
.flex(1);
>*{
flex-basis: 30%;
margin-right: 3%;
margin-bottom: 16px;
}
}
&.lastRow{
>div:nth-child(1) {
>*{
margin-bottom: 0px;
}
}
}
}
}
.full-screen-page {
min-width: 1000px;
height: 100%;
position: fixed;
left: 0;
top: 0;
bottom: 0;
right: 0;
user-select: none;
background-color: #F0F2F5;
}
@import './variables.less';
// 常用的删除按钮
table {
a, .link {
cursor: pointer;
color: #FF7519;
}
td:nth-child(1):hover,
td:nth-child(2):hover {
.delete {
display: inline-block;
}
}
td:nth-child(1),
td:nth-child(2) {
position: relative;
.delete {
color: #999;
position: absolute;
right: 5px;
bottom: 10px;
display: none;
transition: all .5s;
cursor: pointer;
}
}
th {
background: @xm-table-header !important;
> .center {
text-align: center;
}
}
}
table.table {
table-layout: fixed;
width: 100%;
.left {
text-align: left;
padding-left: 10px;
}
.right {
text-align: right;
padding-right: 10px;
}
.center {
text-align: center;
}
.text-center {
text-align: center;
}
tr {
td, th {
min-height: 30px;
padding: 6px;
font-size: 14px;
color: #545455;
text-align: left;
border: 1px solid @xm-color-border;
}
th {
background: #ffece1;
border-bottom: none;
> .center {
text-align: center;
}
}
td {
overflow: hidden;
color:@xm-table-tbody-color;
white-space: nowrap;
text-overflow: ellipsis;
a {
color: #ff8534;
cursor: pointer;
}
}
}
thead {
border-top: 1px solid @xm-color-border;
tr {
border-left: 1px solid @xm-color-border;
border-bottom: 1px solid @xm-color-border;
border-right: 1px solid @xm-color-border;
background-color: @xm-table-header;
th {
background: none;
color:@xm-table-head-color;
}
}
}
tbody {
tr {
td {
background: none;
}
}
border-bottom: 1px solid @xm-color-border;
}
&.table-no-top-border{
border-top: none!important;
}
&.table-striped {
tbody {
tr:hover {
background-color: @xm-table-body-active;
}
}
th, td {
border-top: 0;
border-bottom: 0;
}
border: 1px solid @xm-color-border;
//border-bottom: 1px solid @xm-color-border;
}
&.table-striped-header {
border-bottom: none;
}
&.table-first-center {
td:first-child, th:first-child {
text-align: center;
}
}
}
.xm-table-filter {
display: inline-block;
vertical-align: top;
>* {
margin-left: 16px;
}
.xm-table-filter{
margin: 0px;
}
.date-range {
display: inline-block;
input {
display: inline-block;
width: 190px;
box-sizing: border-box;
height: 30px;
line-height: 30px;
}
}
.xm-divider {
position: relative;
width: 1px;
height: 10px;
}
.stockNum{
margin-left: 5px;
width: 18px;
height: 18px;
background-color: #FC0C0E;
border-radius: 50%;
color: #fff;
line-height: 18px;
text-align: center;
font-size: 12px;
font-weight: 300;
}
}
\ No newline at end of file
@sunLight: #FED951;
@sun: #Fc9C6B;
@sunDark: #DD8029;
@orangeLight: #FDBB70;
@orange: #FB863E;
@orangeDark: #D65E30;
@primaryLight: @sunLight;
@primary: @sun;
@primaryDark: @sunDark;
@secondaryLight: @orangeLight;
@secondary: @orange;
@secondaryDark: @orangeDark;
@sucess: @sun;
@warning: #FB696A;
@border: #e8e8e8;
@green: #3bdbaa;
@blue: #58b7ef;
@pink: #ff6767;
@text-main:#000000;
@text-sub:#686868;
@text-note:#c0c0c0;
.color-primary {
color: @sun;
}
.text-primary {
color: #fe8534;
}
.bg-primary {
background-color: @primary;
}
@font-xs: 12px;
@font-s: 13px;
@font-m: 14px;
@font-l: 15px;
@font-xl: 16px;
//old
//color
@xm-color-primary: #FF7519;
@xm-color-primary_active: #020201;
@xm-color-primary-darker: #ff8534;
@xm-color-selected: #F58E2C;
@xm-color-selected_active: #e58342;
@xm-color-secondary-light: #e28534;
@xm-color-secondary: #ff8534;
@xm-color-secondary-darker: #D65E30;
@xm-color-text-select-primary:#Fc9C6B;
@xm-color-text-select-warning:#ec4b35;
@xm-color-info: #45b2ff;
@xm-color-info2: #5e80bd;
@xm-color-danger: red;
@xm-color-danger1: #ff7538;
@xm-color-danger2: #ff0000;
@xm-color-success: #50b7a8;
@xm-color-success2: @xm-color-primary;
@xm-color-success3: @xm-color-primary;
@xm-color-success4: #139794;
@xm-color-green: #3bdbaa;
@xm-color-blue: #58b7ef;
@xm-color-pink:#ff6767;
// bg
@xm-bg-primary: @xm-color-primary;
@xm-bg-info: #45b2ff;
@xm-bg-info2: #5e80bd;
@xm-bg-danger: red;
@xm-bg-success: #50b7a8;
@xm-bg-success2: @xm-color-primary;
// btn-bg
@xm-btn-bg-info: #45b2ff;
@xm-btn-bg-info2: #5e80bd;
//分割线颜色
@xm-color-border: #e8e8e8;
//主文本色
@xm-main-text-color: #000000;
//副文本
@xm-sub-text-color: #686868;
//提示文本
@xm-note-text-color: #999;
@xm-primary-text-color: #ff8534;
// 通用阴影 1-n 阴影从小到大
@xm-box-shadow-1: 0 2px 2px rgba(0, 0, 0, 0.1);
@xm-box-shadow-2: 0 2px 4px #ccc;
@xm-box-shadow-3: 0 1px 10px #ccc;
@xm-font-size-xs: 10px;
@xm-font-size-s: 12px;
@xm-font-size-m: 14px;
@xm-font-size-l: 20px;
@xm-font-size-xl: 33px;
@xm-font-size-xxl: 34px;
// table颜色
@xm-table-header:#F7F8F9;
@xm-table-body-even:#Fafafa;
@xm-table-body-active:#F3f6fa;
@xm-table-head-color:#333;
@xm-table-tbody-color:#666;
//侧边栏宽度
@xm-left-width:180px;
@xm-left-min-width:64px;
@xm-color-text-menu:#9a9dA7;
// 下拉框
@xm-select-item-hover:#F3f6fa;
<!--
* @Author: 吴文洁
* @Date: 2020-04-29 16:57:38
* @LastEditors: 吴文洁
* @LastEditTime: 2020-04-29 17:02:39
* @Description:
-->
### 与后台的数据交互层(承担防腐重任)
**本目录的引用别名是 @/data-source**
request-apis.js和translators注意都是 复数。
translators.js 为前后端字段(or 数据结构)转换的方法集合。(防腐层)
### 注意:接口请求的所有返回数据结构,必须经过 translator 转后成与前端 domain 中的结构匹配后才能用于视图层。
<!--
* @Author: 吴文洁
* @Date: 2020-04-29 17:03:23
* @LastEditors: 吴文洁
* @LastEditTime: 2020-04-29 17:18:38
* @Description:
-->
### 本目录为“各个子域的集合”,所有领域的公共部分均放在这里
**本目录的 别名为 @/domains**
Service连接视图层和数据层
注意: Service 类中只有 static 方法。
\ No newline at end of file
/*
* @Author: 陈剑宇
* @Date: 2020-05-07 14:43:01
* @LastEditTime: 2020-11-09 09:52:03
* @LastEditors: 吴文洁
* @Description:
* @FilePath: /wheat-web-demo/src/domains/basic-domain/constants.ts
*/
import { MapInterface } from '@/domains/basic-domain/interface'
// 默认是 dev 环境
const ENV: string = process.env.DEPLOY_ENV || 'dev';
const BASIC_HOST_MAP: MapInterface = {
dev: 'https://dev-heimdall.xiaomai5.com/',
dev1: 'https://dev1-heimdall.xiaomai5.com/',
rc: 'https://rc-heimdall.xiaomai5.com/',
gray: 'https://gray-heimdall.xiaomai5.com/',
prod: 'https://gateway-heimdall.xiaomai5.com/'
};
// axios headers config
export const TIME_OUT: number = 20000;
export const USER_TYPE: string = 'B';
export const PROJECT = 'xmzj-web-b';
export const VERSION = '5.4.8';
export const PREFIX = 'xiaomai';
// host
export const BASIC_HOST: string = BASIC_HOST_MAP[ENV];
\ No newline at end of file
/*
* @Author: 吴文洁
* @Date: 2020-04-28 18:10:07
* @LastEditors: 吴文洁
* @LastEditTime: 2020-08-31 09:36:22
* @Description: 系统interface
*/
export interface VerifyInfo {
aid: string | undefined,
tid: string | undefined,
cid: string | undefined,
uid: string | undefined,
token: string | undefined,
}
// constants.ts
export interface MapInterface {
dev: string,
dev1: string,
rc: string,
gray: string,
prod: string,
[key: string]: any,
}
export interface XMStorageImplements {
get: (key: string) => any,
set: (key: string, value: any) => void,
getObj: (key: string) => any,
setObj: (key: string, obj: any) => void,
remove: (key: string) => void,
clear: () => void,
}
\ No newline at end of file
/*
* @Author: 吴文洁
* @Date: 2020-08-20 09:20:43
* @LastEditors: 吴文洁
* @LastEditTime: 2020-08-21 09:02:36
* @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
// 限制字数
const getEllipsText = (text: string, limitNum: number) => {
const limitText: string = text.replace(/\n/g, ' ');
if (limitText.length > limitNum) {
return `${limitText.substr(0, limitNum)}...`;
}
return limitText;
}
export {
getEllipsText
}
\ No newline at end of file
/*
* @Author: 吴文洁
* @Date: 2020-04-27 20:35:34
* @LastEditors: 吴文洁
* @LastEditTime: 2020-11-09 09:43:33
* @Description:
*/
import React from 'react';
import ReactDOM from 'react-dom';
import { HashRouter } from 'react-router-dom';
import { ConfigProvider } from 'antd';
import { createHashHistory } from 'history';
import zh_CN from 'antd/es/locale/zh_CN';
import _ from 'underscore';
import Storage from '@/common/js/storage';
import { PREFIX } from '@/domains/basic-domain/constants';
import { VerifyInfo } from '@/domains/basic-domain/interface';
import 'antd/dist/antd.less';
import '@/common/less/index.less';
import App from './modules/root/App';
import '@/common/less/index.less';
const history = createHashHistory();
window.RCHistory = _.extend({}, history, {
push: (obj: any) => {
history.push(obj)
},
pushState: (obj: any) => {
history.push(obj)
},
pushStateWithStatus: (obj: any) => {
history.push(obj)
},
goBack: history.goBack,
location: history.location,
replace: (obj: any) => {
history.replace(obj)
}
});
export async function mount() {
ReactDOM.render((
<HashRouter {...history} >
<ConfigProvider locale={zh_CN}>
<App/>
</ConfigProvider>
</HashRouter>
), document.getElementById('root'));
}
mount()
\ No newline at end of file
import React from 'react';
class PrepareLessonPage extends React.Component {
constructor(props) {
super(props);
this.state = {}
}
render() {
return (
<div className="prepare-lesson-page page">
<div className="content-header">资料云盘</div>
<div className="box content-body">
</div>
</div>
)
}
}
export default PrepareLessonPage;
\ No newline at end of file
/*
* @Author: 吴文洁
* @Date: 2019-07-10 10:30:49
* @LastEditors: wangyixi
* @LastEditTime: 2020-11-09 19:21:03
* @Description:
*/
import React from 'react'
import { withRouter} from 'react-router-dom';
import {ConfigProvider } from 'antd';
import Header from './Header'
import Menu from './Menu'
import Main from './Main'
import { Route, Switch } from 'react-router-dom'
import zhCN from 'antd/es/locale/zh_CN'
class App extends React.Component {
constructor(props) {
super(props)
this.state = {
}
}
componentDidMount() {
}
render() {
return [
<div id="home">
<Header/>
<ConfigProvider locale={zhCN}>
<Main/>
</ConfigProvider>
<Menu/>
</div>
]
}
}
export default withRouter(App)
/*
* @Author: 吴文洁
* @Date: 2019-09-10 18:26:03
* @LastEditors: wangyixi
* @LastEditTime: 2020-11-11 14:04:50
* @Description:
*/
import React from 'react';
import './Header.less';
import {
Menu,
Dropdown,
Icon,
message,
Modal,
Input,
Avatar,
Button,
Row,
Col,
Badge,
Tooltip,
Radio,
} from 'antd';
import { withRouter } from 'react-router-dom';
import Bus from '@/core/bus';
// var $topContainer = $('#top-container');
class Header extends React.Component {
constructor(props) {
super(props);
this.state = {
menuType: 1,
};
}
componentWillMount() {
}
componentDidMount() {
}
handleMenu = () => {
const menuType = !this.state.menuType;
this.setState({ menuType }, () => {
Bus.trigger('menuTypeChange', menuType);
});
};
render() {
const {
} = this.state;
return (
<div id="top-container" className="top-container">
<div className="top top-nav">
<div>
{this.state.menuType ? (
<img src="https://image.xiaomaiketang.com/xm/TP2x7aQ24y.png" className="logo" alt="" />
):(
<img src="https://dev.xiaomai5.com/admin/static/images/logo.928339cd.png" className="logo" alt="" />
)}
</div>
{this.state.menuType ? (
<span className="icon iconfont cursor ml20 handLike" onClick={this.handleMenu}>
&#xe7ff;{' '}
</span>
) : (
<span className="icon iconfont cursor ml20 handLike" onClick={this.handleMenu}>
&#xe7fe;
</span>
)}
<div className="message-help">
<Dropdown>
<div className="user">
<span className="name">张乐园</span>
</div>
</Dropdown>
</div>
</div>
</div>
);
}
}
export default withRouter(Header);
import React from 'react'
import './Main.less';
import Bus from "@/core/bus";
class Main extends React.Component {
constructor(props) {
super(props);
this.state = {
menuType: 1,
}
}
componentDidMount() {
Bus.bind("menuTypeChange", (menuType) => {
this.setState({ menuType })
});
}
render() {
const { hasBanner } = this.props;
return (
<div
className={this.state.menuType ? `right-container has-nav ${hasBanner ? 'has_banner' : ''}` : `right-container has-nav right-container-vertical ${hasBanner ? 'has_banner' : ''}`}
id="rightContainer"
>
我是内容区
</div>
)
}
}
export default Main;
@import '../../core/variables.less';
@import '../../core/page.less';
@import '../../core/table.less';
@top-height: 50px;
.right-container {
position: absolute;
left: @xm-left-width;
top: @top-height;
right: 0;
bottom: 0;
background-color: #f0f2f5;
overflow-x: scroll;
z-index: 1;
&.right-container-vertical{
left:@xm-left-min-width;
.page{
.page{
left: @xm-left-min-width;
}
}
}
&.has_banner {
.page {
.page {
top: 100px;
}
}
}
> .right {
position: absolute;
left: 0;
top: 0;
right: 0;
min-height: 100%;
overflow-y: auto;
min-width: 1050px;
}
}
.right-container {
// min-width: 1186px;
&:before {
content: ' ';
height: 1px;
display: block;
position: absolute;
top: 0;
left: 0;
width: 100%;
z-index: 2;
}
.right {
.normal-content {
padding-bottom: 50px;
.body {
> div {
// 页面标题头
section.content-header {
.xm-btn {
margin-left: 15px;
}
h1 {
font-size: 16px;
color: #898989;
font-weight: normal;
padding: 15px;
display: inline-block;
}
&.selectable {
margin: 15px;
padding: 0;
h1 {
box-sizing: border-box;
cursor: pointer;
display: inline-block;
background: #fff;
padding: 0;
border: 1px solid @border;
border-right: 0;
font-weight: bold;
a {
padding: 8px 30px;
font-weight: bold;
}
&.on {
border: 1px solid @primary;
background: @primary;
color: #fff;
}
&:nth-child(1) {
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
}
&:nth-last-child(1) {
&.on {
border-right: 1px solid @primary;
}
border-right: 1px solid @border;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
}
}
&.multiple {
h1{
&.on {
border-left: 1px solid @border;
}
}
}
&.with-arrow {
border: 1px solid @xm-color-border;
display: inline-block;
font-size: 0;
border-radius: 10px;
overflow: hidden;
h1 {
display: inline-block;
padding: 0px 24px;
margin: 0;
cursor: default;
font-size: 15px;
line-height: 42px;
font-weight: bold;
position: relative;
background: #fff;
&:before,
&:after {
position: absolute;
content: ' ';
border: 22px solid transparent;
border-left: 15px solid #fff;
width: 0;
height: 0;
left: 99%;
top: 0;
z-index: 100;
}
&:after {
border-left: 15px solid #eee;
left: 100%;
z-index: 99;
}
&.on {
background: @primary;
&:before {
position: absolute;
content: ' ';
border: 23px solid transparent;
border-left: 17px solid @primary;
width: 0;
height: 0;
left: 100%;
top: -1px;
z-index: 100;
}
&:after {
display: none;
}
}
&:nth-last-child(1) {
&:before {
display: none;
}
}
}
}
}
}
// 右侧容器样式
.box {
padding: 16px;
margin: 0 16px;
background: #ffffff;
box-shadow: 0 2px 4px #ccc;
}
}
}
}
}
}
import React from "react";
import { HashRouter as Router, withRouter, Link } from "react-router-dom";
import "./Menu.less";
import classNames from "classnames";
import { Menu, Icon, Modal, Badge } from "antd";
import Bus from '@/core/bus'
const MenuItem = Menu.Item;
const SubMenu = Menu.SubMenu;
const mircoLink = ["cloudclass"];
window.Router = Router;
class Menus extends React.Component {
constructor(props) {
super(props);
this.state = {
menuType: 1, // 目录的宽屏和窄屏模式
};
}
async componentDidMount() {
Bus.bind("menuTypeChange", (menuType) => {
if (menuType) {
this.setState({ menuType });
} else {
this.setState({ openKeys: [] }, () => this.setState({ menuType }));
}
})
}
render() {
return (
<div id="left-container"
className={
this.state.menuType
? "left-container"
: "left-container left-container-vertical"
}>
<div className="left">
<div className="nav">
<Menu
defaultSelectedKeys={["1"]}
defaultOpenKeys={["sub1"]}
mode={this.state.menuType ? "inline" : "vertical"}
theme="dark"
inlineCollapsed={this.state.collapsed}
>
<SubMenu
key="1"
title={
<span>
<Icon type="mail" />
{!!this.state.menuType &&(
<span>课程管理</span>
)}
</span>
}
>
<Menu.Item key="1-1">
<span>直播课</span>
</Menu.Item>
<Menu.Item key="1-2">
<span>视频课</span>
</Menu.Item>
</SubMenu>
<Menu.Item key="2">
<Icon type="pie-chart" />
{!!this.state.menuType &&(
<span>资料云盘</span>
)}
</Menu.Item>
<SubMenu
key="2"
title={
<span>
<Icon type="mail" />
{!!this.state.menuType &&(
<span>课程管理</span>
)}
</span>
}
>
<Menu.Item key="3-1">
<span>讲师管理</span>
</Menu.Item>
<Menu.Item key="3-2">
<span>用户管理</span>
</Menu.Item>
<Menu.Item key="3-3">
<span>课程分类</span>
</Menu.Item>
<Menu.Item key="3-4">
<span>店铺装修</span>
</Menu.Item>
</SubMenu>
</Menu>
</div>
</div>
<div></div>
</div>
);
}
}
export default withRouter(Menus);
import PropTypes from 'prop-types';
import { Modal, Input, Form, Button, message, Row, Col } from 'antd';
import md5 from 'blueimp-md5';
import User from '@/core/user';
import { resolve } from 'url';
const FormItem = Form.Item;
export default class PasswordModal extends BaseComponent {
constructor(props) {
super(props);
this.state = {
newpwd: "",
renewpwd: "",
verifyCode: "",
phone: Number(LS.get("uPhone")) || Number(LS.get("bindingPhone")),
openEye: false,
showTip: false,
isSetPwd: window.currentUserInstInfo.isSetPwd,
openSetForm: false,
};
}
handleChange = e => {
let newState = {};
newState[e.target.name] = e.target.value.trim();
this.setState(newState);
};
//点击保存
handleSave = () => {
let newpwd = this.state.newpwd,
renewpwd = this.state.renewpwd,
verifyCode = this.state.verifyCode,
phone = this.state.phone;
if (verifyCode == "" && this.state.isSetPwd) {
message.warning("验证码不能为空!");
return new Promise((resolve, reject) => { });
}
if (newpwd == "") {
message.error("请输入密码");
return new Promise((resolve, reject) => { });
}
if (newpwd.match(/^[0-9]*$/) || newpwd.match(/^[a-zA-Z]*$/)) {
message.warning("密码不能为纯数字或纯字母!");
return new Promise((resolve, reject) => { });
}
else if (!newpwd.match(/^[a-zA-Z0-9]{6,16}$/)) {
message.warning("密码为6-16位数字与字母!");
return new Promise((resolve, reject) => { });
} else {
if (newpwd.length < 6 || newpwd.length > 20) {
message.error("密码长度为6-20个字符");
return new Promise((resolve, reject) => { });
}
return axios.post("api-b/b/changePassword", {
phone: phone,
newpwd: md5(newpwd),
code: verifyCode
})
.then(res => {
if (res.resultCode == 0) {
message.success("修改成功, 即将退出重新登录~");
setTimeout(() => {
User.logout();
}, 500);
} else {
message.error(res.resultMsg);
}
});
}
};
sendVoiceCode() {
let phone = Number(LS.get("uPhone")) || Number(LS.get("bindingPhone"));
return window.axios.post('api-b/b/send/voiceAuthCode', { phone }).then(() => {
message.warning('验证码将以电话的形式通知到您,请注意接听');
});
}
//获取验证码
getVerifyCode = () => {
const self = this;
let phone = Number(LS.get("uPhone")) || Number(LS.get("bindingPhone"));
axios
.post("api-b/b/changePassword/authcode", {
phone: phone
})
.then(() => {
message.success("验证码已发送");
});
let haveSend = $(".sendVerifyCodes");
if (haveSend.hasClass("wait")) return;
let timer;
let timeSub = (waitTime, unit) => {
clearTimeout(timer);
timer = setTimeout(function () {
if (waitTime == 0) {
haveSend.removeClass("wait").text("发送验证码");
clearTimeout(timer);
} else {
if (waitTime < 40) {
if (!self.state.showTip) {
self.setState({ showTip: true });
setTimeout(() => self.setState({ showTip: false }), 40000);
}
}
haveSend.addClass("wait").text(waitTime + "秒后重发");
timeSub(--waitTime, 1000);
}
}, unit || 0);
};
if (true) {
timeSub(60);
}
};
render() {
const { phone, openEye, showTip, isSetPwd, openSetForm } = this.state;
return (
<Form>
<FormItem
label="手机号"
labelCol={{ span: 2 }}
>
<span>{phone}</span>
</FormItem>
{openSetForm ?
[isSetPwd && <FormItem
label="验证码"
labelCol={{ span: 2 }}
>
<Input
id="verify_code_input"
type="text"
name="verifyCode"
value={this.state.verifyCode}
placeholder="请输入验证码"
onChange={this.handleChange}
style={{ width: 240 }}
/>
<Button
id="send_verify_codes_btn"
type="button"
className='sendVerifyCodes'
style={{ marginLeft: 8 }}
onClick={this.getVerifyCode}
>
获取验证码
</Button>
{showTip && <div style={{ fontSize: '12px' }}>
<span style={{ color: "#686868" }}>收不到短信?</span>
<span
style={{ color: "#FFAB1A", cursor: "pointer" }}
id="sendRegVoiceVerifyCode"
onClick={this.sendVoiceCode}
>
使用语音验证码
</span>
</div>}
</FormItem>,
<FormItem
label={!isSetPwd ? '登录密码' : '新密码'}
labelCol={{ span: 2 }}
>
<input style={{ display: 'none' }} />
<Input
id="new_password_input"
type={openEye ? 'string' : 'password'}
value={this.state.newpwd}
name="newpwd"
style={{ width: 240 }}
onChange={this.handleChange}
placeholder="6-16位数字或字母,区分大小写"
suffix={openEye ?
<span
className="icon iconfont"
onClick={() => this.setState({ openEye: false })}
style={{ cursor: 'pointer', color: '#999' }}
>&#xe6b5;</span>
: <span
className="icon iconfont"
onClick={() => this.setState({ openEye: true })}
style={{ cursor: 'pointer', color: '#999' }}
>&#xe6dc;</span>
}
/>
</FormItem>,
<Row>
<Col span={2}>
</Col>
<Col span={18}>
<div style={{ display: 'block', lineHeight: 2.5 }}>
<Button
id="save_new_password_btn"
type="primary"
onClick={() => {
this.handleSave().then(() => {
this.setState({ isSetPwd: true, openSetForm: false });
});
}}
>
保存
</Button>
<Button
id="cancel_new_password_btn"
type=""
style={{ marginLeft: 16 }}
onClick={() => {
this.setState({ openSetForm: false })
}}
>
取消
</Button>
</div>
</Col>
</Row>
]
: <FormItem
label="登录密码"
labelCol={{ span: 2 }}
>
{!isSetPwd ?
<Button id="edit_password_btn" onClick={() => this.setState({ openSetForm: true })}>
设置密码
</Button>
: <div>
******
<Button
id="reedit_password_btn"
style={{ marginLeft: 8 }}
onClick={() => this.setState({ openSetForm: true })}
>
重设密码
</Button>
</div>
}
</FormItem>
}
</Form>
);
}
}
PasswordModal.propTypes = {
};
\ No newline at end of file
import PropTypes from 'prop-types';
import { Form, Button, message, Switch, Input, Row, Col } from 'antd';
import {
withRouter
} from 'react-router-dom';
import UpLoad from "../common/UpLoad";
import PasswordModal from './PasswordModal';
import './UserInfo.less';
import Bus from '../../core/bus';
import { HookContext } from '../../routes';
const FormItem = Form.Item;
class UserInfo extends BaseComponent {
constructor(props) {
super(props);
this.state = {
avatar: window.currentUserInstInfo.avatar || '',
nickName: window.currentUserInstInfo.nickName || '',
homeworkNotice: false,
commentNotice: false,
submitNotice: false,
fileNotice: false,
};
}
componentDidMount() {
window.NewVersion ? this.newFetchMessageControl(): this.fetchMessageControl();
}
newFetchMessageControl() {
axios.Business('public/config/getAdminConfigs').then((res) => {
let data = {};
_.map(res.result, (item) => {
if (item.configType == 'HOMEWORK_REVERT') {
data.homeworkNotice = item.configValue == 'TRUE';
} else if (item.configType == 'ASSESSMENT_REVERT') {
data.commentNotice = item.configValue == 'TRUE';
} else if (item.configType == 'MI_PUSH_T_SUBMIT_HOMEWORK') {
data.submitNotice = item.configValue == 'TRUE';
} else if (item.configType == 'MI_PUSH_T_ARCHIVES_REVERT') {
data.fileNotice = item.configValue == 'TRUE';
}
})
this.setState(data);
})
}
fetchMessageControl() {
axios.post('api-b/b/inst/adminConfig').then((res) => {
if (res.data) {
try {
const homeworkNotice = !!(_.find(res.data, (item) => {
return item.code == '1';
})).status;
const commentNotice = !!(_.find(res.data, (item) => {
return item.code == '2';
})).status;
this.setState({ homeworkNotice, commentNotice });
} catch (error) {
// this._disconnected(ERROR.INTERNAL_ERROR.code, format(ERROR.INTERNAL_ERROR, [error.message, error.stack.toString()]));
// return;
}
}
});
}
changeMessageControl(messageType, status) {
window.NewVersion ?
axios.Business('public/config/modifyAdminConfig', { configType: ENUM.adminConfig[messageType], configValue: status == 1 ? 'TRUE' : 'FALSE' }).then(() => {
this.new FetchMessageControl();
})
: axios.post('api-b/b/inst/edit/adminConfig', { messageType, status }).then(() => {
this.fetchMessageControl();
});
}
handleEditNickName = () => {
// if (!this.state.nickName) {
// message.warning('请填写昵称');
// return
// }
const query = {
nickName: this.state.nickName
}
axios.post('api-b/b/inst/edit/nickName', query).then((res) => {
message.success('保存成功');
Bus.trigger('changeNickName')
})
}
render() {
const { avatar, homeworkNotice, commentNotice, submitNotice, fileNotice } = this.state;
return (
<div className="page user-info">
<div className="page-content">
<section className="content-header">
<h1>个人信息</h1>
</section>
</div>
<div className="box first">
<Form>
<header className="title">个人信息</header>
<FormItem
label="个人头像"
labelCol={{ span: 2 }}
>
<div id="avatar_edit" className="img-box" style={{ width: 54, height: 54, display: 'inline-block' }}>
<UpLoad
addIcon={avatar ?
<span className="icon iconfont">&#xe60b;</span>
: <span
className="icon iconfont"
style={{ fontSize: '12px' }}
>上传头像</span>
}
width={54}
height={54}
img={avatar}
radius="50%"
onChange={img => {
this.state.banner = img;
axios.post("api-b/b/inst/edit/avatar", {
avatar: img,
adminId: window.currentUserInstInfo.adminId,
})
.then(res => {
this.setState({ avatar: img });
Bus.trigger('update_avatar', img);
message.success("头像上传成功");
});
}}
/>
</div>
</FormItem>
<FormItem
label="姓名"
labelCol={{ span: 2 }}
>
<span>{window.currentUserInstInfo.adminName}</span>
</FormItem>
<FormItem
label="昵称"
labelCol={{ span: 2 }}
>
<Input
id="nick_name_input"
value={this.state.nickName}
placeholder="昵称不能超过10个字符"
style={{ width: 200 }}
onChange={(event) => {
let nickName = event.target.value;
this.setState({ nickName });
}} />
<Row>
<Col span={2}></Col>
<Col>
<span className="icon iconfont" style={{ color: '#20A1FF', marginRight: 10 }}>&#xe64d;</span>“昵称”将用于家长端中的家校互动展示
</Col>
</Row>
</FormItem>
<FormItem>
<Col span={2}></Col>
<Button
id="update_user_info_btn"
onClick={this.handleEditNickName}
type="primary" >
更新信息
</Button>
</FormItem>
</Form>
</div>
<div className="box">
<header className="title">账号与密码</header>
<PasswordModal />
</div>
<div className="box" style={{ marginBottom: 24 }}>
<header className="title">新消息通知</header>
<Form>
{window.NewVersion && <FormItem
label="作业提交提醒"
labelCol={{ span: 3 }}
>
<Switch
id="homework_notice_switch"
checked={submitNotice}
onChange={() => this.changeMessageControl(38, submitNotice ? 0 : 1)}
style={{ marginLeft: 30 }}
/>
</FormItem>}
<FormItem
label="作业回复提醒"
labelCol={{ span: 3 }}
>
<Switch
id="homework_notice_switch"
checked={homeworkNotice}
onChange={() => this.changeMessageControl(1, homeworkNotice ? 0 : 1)}
style={{ marginLeft: 30 }}
/>
</FormItem>
<FormItem
label="点评回复提醒"
labelCol={{ span: 3 }}
>
<Switch
id="comment_notice_switch"
checked={commentNotice}
onChange={() => this.changeMessageControl(2, commentNotice ? 0 : 1)}
style={{ marginLeft: 30 }}
/>
</FormItem>
{window.NewVersion && <FormItem
label="成长档案回复提醒"
labelCol={{ span: 3 }}
>
<Switch
id="homework_notice_switch"
checked={fileNotice}
onChange={() => this.changeMessageControl(31, fileNotice ? 0 : 1)}
style={{ marginLeft: 30 }}
/>
</FormItem>}
</Form>
</div>
</div>
);
}
}
UserInfo.contextType = HookContext;
export default withRouter(UserInfo);
\ No newline at end of file
.user-info {
.box {
margin-top: 36px;
padding-top: 0;
&.first {
margin-top: 50px;
}
.title {
font-weight: 500;
display: block;
font-size: 18px;
color: #333;
line-height: 50px;
border-bottom: 1px solid #e8e8e8;
margin-bottom: 24px;
}
.img-box {
.icon {
cursor: pointer;
}
}
}
}
\ No newline at end of file
import React from 'react';
class testPage extends React.Component {
constructor(props) {
super(props);
this.state = {}
}
render() {
return (
<div className="prepare-lesson-page page">
<div className="content-header">测试</div>
<div className="box content-body">
测试内容
</div>
</div>
)
}
}
export default testPage;
\ No newline at end of file
import React from 'react';
import { Table } from 'antd';
import Service from '@/common/js/service';
import './index.less';
class VideoCourse extends React.Component {
constructor(props) {
super(props);
const { instId } = window.currentUserInstInfo;
this.state = {
query: {
instId,
size: 10,
current: 1,
},
dataSource: []
}
}
componentDidMount() {
this.handleFetchVideoCourseList();
}
parseColumns = () => {
const columns = [
{
title: '视频课',
key: 'scheduleName',
dataIndex: 'scheduleName',
width: '25%',
},
{
title: '学员人数',
key: "stuNum",
dataIndex: "stuNum",
},
{
title: '创建人',
key: 'teacherName',
dataIndex: 'teacherName'
},
{
title: '操作',
key: 'operate',
dataIndex: 'operate',
render: (val, record) => {
return (
<div className="operate">
<div className="operate__item">分享</div>
<span className="operate__item split"> | </span>
<div className="operate__item">编辑</div>
<span className="operate__item split"> | </span>
<div className="operate__item">删除</div>
</div>
)
}
}
];
return columns;
}
handleFetchVideoCourseList = () => {
Service.Apollo('public/apollo/lessonScheduleListPage', this.state.query)
.then((res) => {
const { result = {} } = res;
const { records = [] } = result;
this.setState({
dataSource: records
})
})
}
render() {
const { dataSource } = this.state;
return (
<div className="video-course">
<div className="page-header">视频课</div>
<div className="page-body">
<Table
rowKey={record => record.id}
dataSource={dataSource}
columns={this.parseColumns()}
/>
</div>
</div>
)
}
}
export default VideoCourse;
.video-course {
.operate {
display: flex;
&__item {
color: #FF7519;
cursor: pointer;
&.split {
margin: 0 8px;
}
}
}
}
\ No newline at end of file
<!--
* @Author: 吴文洁
* @Date: 2020-04-29 10:18:07
* @LastEditors: 吴文洁
* @LastEditTime: 2020-04-29 10:18:23
* @Description:
-->
### 各个领域下的路由配置
\ No newline at end of file
/*
* @Author: 吴文洁
* @Date: 2020-04-29 10:26:32
* @LastEditors: 吴文洁
* @LastEditTime: 2020-08-27 10:07:47
* @Description: 内容线路由配置
*/
import { MenuConfig } from '@/routes/interface';
import VideoCourse from '@/modules/video-course';
import ClassBook from '@/modules/class-book';
import TestPage from '@/modules/test';
const CloudClassConfig: MenuConfig = {
key: 'cloudClass',
name: '云课堂',
routes: [
{
key: 'video_course',
name: '视频课',
path: '/cloudclass/video_course',
component: VideoCourse
},
{
key: 'prepare_lesson',
name: '资料云盘',
path: '/cloudclass/prepare_lesson',
component: ClassBook
},
{
key: 'test',
name: '页面测试',
path: '/cloudclass/test',
component: TestPage
},
]
};
export default CloudClassConfig;
\ No newline at end of file
/*
* @Author: 吴文洁
* @Date: 2020-04-28 18:05:30
* @LastEditors: 吴文洁
* @LastEditTime: 2020-08-13 11:23:36
* @Description:
*/
import { MenuConfig, RouteConfig } from '@/routes/interface';
import CloudClass from './config/cloudClass';
// 领域路由配置
export const menuConfigs: MenuConfig[] = [ CloudClass ];
/** 所有处理后的路由的集合,用于生成Route组件 */
const allRoutes: RouteConfig[] = menuConfigs.map((config: MenuConfig) => {
return config.routes || [];
}).reduce((prev: RouteConfig[], next: RouteConfig[]) => {
return prev.concat(...next);
});
export default allRoutes;
/*
* @Author: 吴文洁
* @Date: 2020-04-28 18:10:07
* @LastEditors: 吴文洁
* @LastEditTime: 2020-08-13 10:59:08
* @Description:
*/
/** 路由配置,最终解析后转给<Route>组件 */
export interface RouteConfig {
/** 标题,用于route组件和kio的description */
name?: string;
/** 子菜单key */
key?: string;
/** 子菜单路径 */
path?: string;
component?: React.ComponentType<any>;
// 是否精确匹配
exact?: boolean;
}
/** 左侧的菜单配置 */
export interface MenuConfig {
// 菜单名称
name: string;
// 菜单key
key: string;
// 菜单对应的路由
path?: string;
// 子路由
routes?: RouteConfig[];
}
\ No newline at end of file
// This optional code is used to register a service worker.
// register() is not called by default.
// This lets the app load faster on subsequent visits in production, and gives
// it offline capabilities. However, it also means that developers (and users)
// will only see deployed updates on subsequent visits to a page, after all the
// existing tabs open on the page have been closed, since previously cached
// resources are updated in the background.
// To learn more about the benefits of this model and instructions on how to
// opt-in, read https://bit.ly/CRA-PWA
const isLocalhost = Boolean(
window.location.hostname === 'localhost' ||
// [::1] is the IPv6 localhost address.
window.location.hostname === '[::1]' ||
// 127.0.0.0/8 are considered localhost for IPv4.
window.location.hostname.match(
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
)
);
type Config = {
onSuccess?: (registration: ServiceWorkerRegistration) => void;
onUpdate?: (registration: ServiceWorkerRegistration) => void;
};
export function register(config?: Config) {
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
// The URL constructor is available in all browsers that support SW.
const publicUrl = new URL(
process.env.PUBLIC_URL,
window.location.href
);
if (publicUrl.origin !== window.location.origin) {
// Our service worker won't work if PUBLIC_URL is on a different origin
// from what our page is served on. This might happen if a CDN is used to
// serve assets; see https://github.com/facebook/create-react-app/issues/2374
return;
}
window.addEventListener('load', () => {
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
if (isLocalhost) {
// This is running on localhost. Let's check if a service worker still exists or not.
checkValidServiceWorker(swUrl, config);
// Add some additional logging to localhost, pointing developers to the
// service worker/PWA documentation.
navigator.serviceWorker.ready.then(() => {
console.log(
'This web app is being served cache-first by a service ' +
'worker. To learn more, visit https://bit.ly/CRA-PWA'
);
});
} else {
// Is not localhost. Just register service worker
registerValidSW(swUrl, config);
}
});
}
}
function registerValidSW(swUrl: string, config?: Config) {
navigator.serviceWorker
.register(swUrl)
.then(registration => {
registration.onupdatefound = () => {
const installingWorker = registration.installing;
if (installingWorker == null) {
return;
}
installingWorker.onstatechange = () => {
if (installingWorker.state === 'installed') {
if (navigator.serviceWorker.controller) {
// At this point, the updated precached content has been fetched,
// but the previous service worker will still serve the older
// content until all client tabs are closed.
console.log(
'New content is available and will be used when all ' +
'tabs for this page are closed. See https://bit.ly/CRA-PWA.'
);
// Execute callback
if (config && config.onUpdate) {
config.onUpdate(registration);
}
} else {
// At this point, everything has been precached.
// It's the perfect time to display a
// "Content is cached for offline use." message.
console.log('Content is cached for offline use.');
// Execute callback
if (config && config.onSuccess) {
config.onSuccess(registration);
}
}
}
};
};
})
.catch(error => {
console.error('Error during service worker registration:', error);
});
}
function checkValidServiceWorker(swUrl: string, config?: Config) {
// Check if the service worker can be found. If it can't reload the page.
fetch(swUrl, {
headers: { 'Service-Worker': 'script' }
})
.then(response => {
// Ensure service worker exists, and that we really are getting a JS file.
const contentType = response.headers.get('content-type');
if (
response.status === 404 ||
(contentType != null && contentType.indexOf('javascript') === -1)
) {
// No service worker found. Probably a different app. Reload the page.
navigator.serviceWorker.ready.then(registration => {
registration.unregister().then(() => {
window.location.reload();
});
});
} else {
// Service worker found. Proceed as normal.
registerValidSW(swUrl, config);
}
})
.catch(() => {
console.log(
'No internet connection found. App is running in offline mode.'
);
});
}
export function unregister() {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.ready
.then(registration => {
registration.unregister();
})
.catch(error => {
console.error(error.message);
});
}
}
// jest-dom adds custom jest matchers for asserting on DOM nodes.
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom/extend-expect';
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react",
"baseUrl": "src",
"paths": {
"@/*": ["*"]
}
},
"include": [
"src"
]
}
{
"extends": [
"tslint:recommended",
"tslint-react"
],
"rules": {
"indent": [true, "spaces", 2],
"space-before-function-paren": false,
"no-angle-bracket-type-assertion": false,
"callable-types": false,
"unified-signatures": false,
"no-string-throw": false,
"ban-types": false,
"no-console": [true, "debug", "info", "log", "time", "timeEnd", "trace"],
"no-unnecessary-initializer": false,
"force-empty-line-after-jsx-annotation": true,
"jsx-alignment": false,
"jsx-no-multiline-js": false,
"jsx-wrap-multiline": false,
"jsx-no-string-ref": false,
"jsx-self-close": false,
"quotemark": [true, "single", "jsx-double"],
"member-access": false,
"arrow-parens": false,
"object-literal-sort-keys": false,
"member-ordering": [false],
"variable-name": false,
"no-var-requires": false,
"only-arrow-functions": [false],
"no-reference": false,
"trailing-comma": [false],
"prefer-const": true,
"no-namespace": [true, "allow-declarations"],
"no-empty-interface": false,
"max-line-length": [true, 200],
"react/jsx-no-undef": [2, { "allowGlobals": true }]
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
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