Commit 3872a787 by guomingpang

Merge branch 'feature/pangguoming/20210802/login-authentication' into dev

parents 53420726 b8e3b458
...@@ -24,19 +24,16 @@ const getClientEnvironment = require('./env'); ...@@ -24,19 +24,16 @@ const getClientEnvironment = require('./env');
const ModuleNotFoundPlugin = require('react-dev-utils/ModuleNotFoundPlugin'); const ModuleNotFoundPlugin = require('react-dev-utils/ModuleNotFoundPlugin');
const ForkTsCheckerWebpackPlugin = require('react-dev-utils/ForkTsCheckerWebpackPlugin'); const ForkTsCheckerWebpackPlugin = require('react-dev-utils/ForkTsCheckerWebpackPlugin');
const typescriptFormatter = require('react-dev-utils/typescriptFormatter'); const typescriptFormatter = require('react-dev-utils/typescriptFormatter');
var PREFIX = 'wechect-common-'
const postcssNormalize = require('postcss-normalize'); const postcssNormalize = require('postcss-normalize');
// const vConsolePlugin = require('vconsole-webpack-plugin');
const appPackageJson = require(paths.appPackageJson); const appPackageJson = require(paths.appPackageJson);
// Source maps are resource heavy and can cause out of memory issue for large source files.
const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== 'false'; const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== 'false';
// Some apps do not need the benefits of saving a web request, so not inlining the chunk // Some apps do not need the benefits of saving a web request, so not inlining the chunk
// makes for a smoother build process. // makes for a smoother build process.
const shouldInlineRuntimeChunk = process.env.INLINE_RUNTIME_CHUNK !== 'false'; const shouldInlineRuntimeChunk = process.env.INLINE_RUNTIME_CHUNK !== 'false';
const isExtendingEslintConfig = process.env.EXTEND_ESLINT === 'true';
const imageInlineSizeLimit = parseInt( const imageInlineSizeLimit = parseInt(
process.env.IMAGE_INLINE_SIZE_LIMIT || '10000' process.env.IMAGE_INLINE_SIZE_LIMIT || '10000'
...@@ -178,14 +175,14 @@ module.exports = function(webpackEnv) { ...@@ -178,14 +175,14 @@ module.exports = function(webpackEnv) {
// There will be one main bundle, and one file per asynchronous chunk. // There will be one main bundle, and one file per asynchronous chunk.
// In development, it does not produce real files. // In development, it does not produce real files.
filename: isEnvProduction filename: isEnvProduction
? 'static/js/[name].[contenthash:8].js' ?PREFIX+ 'static/js/[name].[contenthash:8].js'
: isEnvDevelopment && 'static/js/bundle.js', : isEnvDevelopment && PREFIX+'static/js/bundle.js',
// TODO: remove this when upgrading to webpack 5 // TODO: remove this when upgrading to webpack 5
futureEmitAssets: true, futureEmitAssets: true,
// There are also additional JS chunk files if you use code splitting. // There are also additional JS chunk files if you use code splitting.
chunkFilename: isEnvProduction chunkFilename: isEnvProduction
? 'static/js/[name].[contenthash:8].chunk.js' ? PREFIX+'static/js/[name].[contenthash:8].chunk.js'
: isEnvDevelopment && 'static/js/[name].chunk.js', : isEnvDevelopment && PREFIX+'static/js/[name].chunk.js',
// webpack uses `publicPath` to determine where the app is being served from. // webpack uses `publicPath` to determine where the app is being served from.
// It requires a trailing slash, or the file assets will get an incorrect path. // It requires a trailing slash, or the file assets will get an incorrect path.
// We inferred the "public path" (such as / or /my-project) from homepage. // We inferred the "public path" (such as / or /my-project) from homepage.
...@@ -373,7 +370,7 @@ module.exports = function(webpackEnv) { ...@@ -373,7 +370,7 @@ module.exports = function(webpackEnv) {
loader: require.resolve('url-loader'), loader: require.resolve('url-loader'),
options: { options: {
limit: imageInlineSizeLimit, limit: imageInlineSizeLimit,
name: 'static/media/[name].[hash:8].[ext]', name: PREFIX+'static/media/[name].[hash:8].[ext]',
}, },
}, },
// Process application JS with Babel. // Process application JS with Babel.
...@@ -508,7 +505,7 @@ module.exports = function(webpackEnv) { ...@@ -508,7 +505,7 @@ module.exports = function(webpackEnv) {
// by webpacks internal loaders. // by webpacks internal loaders.
exclude: [/\.(js|mjs|jsx|ts|tsx)$/, /\.html$/, /\.json$/], exclude: [/\.(js|mjs|jsx|ts|tsx)$/, /\.html$/, /\.json$/],
options: { options: {
name: 'static/media/[name].[hash:8].[ext]', name: PREFIX+'static/media/[name].[hash:8].[ext]',
}, },
}, },
// ** STOP ** Are you adding a new loader? // ** STOP ** Are you adding a new loader?
...@@ -581,8 +578,8 @@ module.exports = function(webpackEnv) { ...@@ -581,8 +578,8 @@ module.exports = function(webpackEnv) {
new MiniCssExtractPlugin({ new MiniCssExtractPlugin({
// Options similar to the same options in webpackOptions.output // Options similar to the same options in webpackOptions.output
// both options are optional // both options are optional
filename: 'static/css/[name].[contenthash:8].css', filename: PREFIX+'static/css/[name].[contenthash:8].css',
chunkFilename: 'static/css/[name].[contenthash:8].chunk.css', chunkFilename: PREFIX+'static/css/[name].[contenthash:8].chunk.css',
}), }),
// Generate an asset manifest file with the following content: // Generate an asset manifest file with the following content:
// - "files" key: Mapping of all asset filenames to their corresponding // - "files" key: Mapping of all asset filenames to their corresponding
...@@ -608,9 +605,6 @@ module.exports = function(webpackEnv) { ...@@ -608,9 +605,6 @@ module.exports = function(webpackEnv) {
}; };
}, },
}), }),
// new vConsolePlugin({
// enable: (process.env.DEPLOY_ENV === 'prod' || process.env.DEPLOY_ENV === 'beta') ? false : true
// }),
// Moment.js is an extremely popular library that bundles large locale files // Moment.js is an extremely popular library that bundles large locale files
// by default due to how webpack interprets its code. This is a practical // by default due to how webpack interprets its code. This is a practical
// solution that requires the user to opt into importing specific locales. // solution that requires the user to opt into importing specific locales.
......
...@@ -128,6 +128,7 @@ ...@@ -128,6 +128,7 @@
if (res.code == 200) { if (res.code == 200) {
$('#success').show() $('#success').show()
}else if(res.code === 'DEPLOY_CROP_ADD_USER_NO'){ }else if(res.code === 'DEPLOY_CROP_ADD_USER_NO'){
//租户配置到限,跳转空白提示缺省页
$('#tenant-config-error').show(); $('#tenant-config-error').show();
$('#tenant-config-error-message').html(res.message) $('#tenant-config-error-message').html(res.message)
emptyAnimation() emptyAnimation()
......
...@@ -41,7 +41,7 @@ if (!checkRequiredFiles([paths.appHtml, paths.appIndexJs])) { ...@@ -41,7 +41,7 @@ if (!checkRequiredFiles([paths.appHtml, paths.appIndexJs])) {
} }
// Tools like Cloud9 rely on this. // Tools like Cloud9 rely on this.
const DEFAULT_PORT = parseInt(process.env.PORT, 10) || 3000; const DEFAULT_PORT = parseInt(process.env.PORT, 10) || 3003;
const HOST = process.env.HOST || '0.0.0.0'; const HOST = process.env.HOST || '0.0.0.0';
if (process.env.HOST) { if (process.env.HOST) {
......
...@@ -68,6 +68,7 @@ class Axios { ...@@ -68,6 +68,7 @@ class Axios {
if (success || resultCode === 0) { if (success || resultCode === 0) {
return response; return response;
}else if(code === 'DEPLOY_CROP_ADD_USER_NO'){ }else if(code === 'DEPLOY_CROP_ADD_USER_NO'){
//租户配置到限,跳转空白提示缺省页
window.location.replace("/wechat-common/#/empty-page") window.location.replace("/wechat-common/#/empty-page")
return Promise.reject(response.data) return Promise.reject(response.data)
} }
......
...@@ -29,7 +29,7 @@ const CloudClassConfig: MenuConfig = { ...@@ -29,7 +29,7 @@ const CloudClassConfig: MenuConfig = {
}, },
{ {
key: 'empty-page', key: 'empty-page',
name: '授权登录', name: '提示',
path: '/empty-page', path: '/empty-page',
component:EmptyPage, component:EmptyPage,
}, },
......
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