Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wechat-common
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaomai-cloud-class
wechat-common
Commits
3872a787
Commit
3872a787
authored
Aug 02, 2021
by
guomingpang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/pangguoming/20210802/login-authentication' into dev
parents
53420726
b8e3b458
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
17 deletions
+13
-17
config/webpack.config.js
+9
-15
public/h5.html
+1
-0
scripts/start.js
+1
-1
src/common/js/axios.ts
+1
-0
src/routes/config/cloudClass.tsx
+1
-1
No files found.
config/webpack.config.js
View file @
3872a787
...
@@ -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.
...
...
public/h5.html
View file @
3872a787
...
@@ -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
()
...
...
scripts/start.js
View file @
3872a787
...
@@ -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
)
||
300
0
;
const
DEFAULT_PORT
=
parseInt
(
process
.
env
.
PORT
,
10
)
||
300
3
;
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
)
{
...
...
src/common/js/axios.ts
View file @
3872a787
...
@@ -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
)
}
}
...
...
src/routes/config/cloudClass.tsx
View file @
3872a787
...
@@ -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
,
},
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment