mirror of
https://gitee.com/freshday/radar.git
synced 2025-12-26 07:16:26 +08:00
react 升级 15的版本
This commit is contained in:
parent
8b774f8411
commit
301808f8d6
1
.gitignore
vendored
1
.gitignore
vendored
@ -16,3 +16,4 @@
|
||||
/radar-engine/radar-engine.iml
|
||||
/radar-service/radar-service.iml
|
||||
/radar-service-impl/radar-service-impl.iml
|
||||
webapp/node_modules/
|
||||
17
.project
Normal file
17
.project
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>radar</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
4
.settings/org.eclipse.m2e.core.prefs
Normal file
4
.settings/org.eclipse.m2e.core.prefs
Normal file
@ -0,0 +1,4 @@
|
||||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
||||
17
radar-admin/.project
Normal file
17
radar-admin/.project
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>radar-admin</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
4
radar-admin/.settings/org.eclipse.m2e.core.prefs
Normal file
4
radar-admin/.settings/org.eclipse.m2e.core.prefs
Normal file
@ -0,0 +1,4 @@
|
||||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
||||
17
radar-commons/.project
Normal file
17
radar-commons/.project
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>radar-commons</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
4
radar-commons/.settings/org.eclipse.m2e.core.prefs
Normal file
4
radar-commons/.settings/org.eclipse.m2e.core.prefs
Normal file
@ -0,0 +1,4 @@
|
||||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
||||
17
radar-dal/.project
Normal file
17
radar-dal/.project
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>radar-dal</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
4
radar-dal/.settings/org.eclipse.m2e.core.prefs
Normal file
4
radar-dal/.settings/org.eclipse.m2e.core.prefs
Normal file
@ -0,0 +1,4 @@
|
||||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
||||
17
radar-dao/.project
Normal file
17
radar-dao/.project
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>radar-dao</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
4
radar-dao/.settings/org.eclipse.m2e.core.prefs
Normal file
4
radar-dao/.settings/org.eclipse.m2e.core.prefs
Normal file
@ -0,0 +1,4 @@
|
||||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
||||
17
radar-engine/.project
Normal file
17
radar-engine/.project
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>radar-engine</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
4
radar-engine/.settings/org.eclipse.m2e.core.prefs
Normal file
4
radar-engine/.settings/org.eclipse.m2e.core.prefs
Normal file
@ -0,0 +1,4 @@
|
||||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
||||
17
radar-service-impl/.project
Normal file
17
radar-service-impl/.project
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>radar-service-impl</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
4
radar-service-impl/.settings/org.eclipse.m2e.core.prefs
Normal file
4
radar-service-impl/.settings/org.eclipse.m2e.core.prefs
Normal file
@ -0,0 +1,4 @@
|
||||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
||||
17
radar-service/.project
Normal file
17
radar-service/.project
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>radar-service</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
4
radar-service/.settings/org.eclipse.m2e.core.prefs
Normal file
4
radar-service/.settings/org.eclipse.m2e.core.prefs
Normal file
@ -0,0 +1,4 @@
|
||||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
||||
5
webapp/.babelrc
Normal file
5
webapp/.babelrc
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"presets": ["es2015", "stage-0", "react"],
|
||||
"plugins": [["antd", [{ "libraryName": "antd" }]]]
|
||||
}
|
||||
|
||||
16
webapp/.gitignore
vendored
Normal file
16
webapp/.gitignore
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
.DS_Store
|
||||
node_modules/
|
||||
/dist/
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# Editor directories and files
|
||||
/sync.sh
|
||||
.idea
|
||||
.vscode
|
||||
.history
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
21
webapp/index.html
Normal file
21
webapp/index.html
Normal file
@ -0,0 +1,21 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>反欺诈系统</title>
|
||||
<link rel="shortcut icon" href="/resources/images/xwf.ico">
|
||||
<link rel="stylesheet" href="dist/style.css">
|
||||
<!-- Polyfills -->
|
||||
<!--[if lt IE 10]>
|
||||
<script src="https://as.alipayobjects.com/g/component/??console-polyfill/0.2.2/index.js,es5-shim/4.5.7/es5-shim.min.js,es5-shim/4.5.7/es5-sham.min.js,html5shiv/3.7.2/html5shiv.min.js,media-match/2.0.2/media.match.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="react-content"></div>
|
||||
|
||||
<script src="dist/common.js"></script>
|
||||
<script src="dist/main.bundle.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
52
webapp/package.json
Normal file
52
webapp/package.json
Normal file
@ -0,0 +1,52 @@
|
||||
{
|
||||
"name": "radar",
|
||||
"version": "5.0.0",
|
||||
"description": "",
|
||||
"main": "src/index.jsx",
|
||||
"scripts": {
|
||||
"build": "webpack --progress --colors --config webpack.production.config.js",
|
||||
"start": "webpack-dev-server --progress --hot --colors --open"
|
||||
},
|
||||
"dependencies": {
|
||||
"antd": "^2.1.0",
|
||||
"babel-runtime": "^6.9.2",
|
||||
"console-polyfill": "^0.2.2",
|
||||
"echarts": "^3.2.3",
|
||||
"history": "^2.1.1",
|
||||
"moment": "^2.15.1",
|
||||
"react": "^15.0.0",
|
||||
"react-dom": "^15.0.0",
|
||||
"react-router": "^2.4.0",
|
||||
"whatwg-fetch": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"animate.css": "^3.5.1",
|
||||
"babel-core": "6.x",
|
||||
"babel-eslint": "6.x",
|
||||
"babel-loader": "6.x",
|
||||
"babel-plugin-antd": "^0.5.1",
|
||||
"babel-plugin-transform-runtime": "6.x",
|
||||
"babel-preset-es2015": "6.x",
|
||||
"babel-preset-react": "6.x",
|
||||
"babel-preset-stage-0": "6.x",
|
||||
"copy-webpack-plugin": "2.x",
|
||||
"css-loader": "~0.23.0",
|
||||
"es5-shim": "^4.5.8",
|
||||
"es6-promise": "^3.2.1",
|
||||
"extract-text-webpack-plugin": "^1.0.1",
|
||||
"fetch-ie8": "^1.4.2",
|
||||
"less": "^2.7.1",
|
||||
"less-loader": "^2.2.3",
|
||||
"open-browser-webpack-plugin": "0.0.2",
|
||||
"style-loader": "~0.13.0",
|
||||
"url-loader": "^0.5.7",
|
||||
"webpack": "1.x",
|
||||
"webpack-dev-server": "^1.14.1"
|
||||
},
|
||||
"keywords": [
|
||||
"es6",
|
||||
"react"
|
||||
],
|
||||
"author": "Ding Lu",
|
||||
"license": "MIT"
|
||||
}
|
||||
@ -10,6 +10,7 @@ export var FetchUtil=function(url,method,param,callback,done=()=>{}){
|
||||
credentials: 'include'
|
||||
};
|
||||
let hide=null;
|
||||
console.log(param,'=====')
|
||||
if(method!='GET'){
|
||||
config.method=method;
|
||||
config.headers={"Content-Type": "application/json"};
|
||||
@ -55,7 +55,7 @@ class Welcome extends React.Component{
|
||||
<div>
|
||||
<div className="ibox">
|
||||
<div className="ibox-content">
|
||||
<h2>欢迎登录风控引擎管理平台!</h2>
|
||||
<h2>欢迎登录反欺诈系统管理平台!</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -78,7 +78,7 @@ class AppRoutes extends React.Component{
|
||||
render() {
|
||||
return (
|
||||
<Router history={hashHistory}>
|
||||
<Route path="/" component={App}>
|
||||
<Route path="/" component={App} >
|
||||
<IndexRedirect to="login"/>
|
||||
<Route path="/welcome" component={Welcome}>
|
||||
</Route>
|
||||
72
webapp/webpack.config.js
Normal file
72
webapp/webpack.config.js
Normal file
@ -0,0 +1,72 @@
|
||||
var webpack = require('webpack');
|
||||
var path = require('path');
|
||||
var ExtractTextPlugin = require('extract-text-webpack-plugin'); //抽取CSS文件插件
|
||||
var OpenBrowserPlugin = require('open-browser-webpack-plugin'); //自动打开浏览器插件
|
||||
|
||||
module.exports = {
|
||||
|
||||
// 配置服务器
|
||||
devServer: {
|
||||
historyApiFallback: true,
|
||||
hot: true,
|
||||
host: '0.0.0.0',
|
||||
inline: true,
|
||||
progress: true,
|
||||
contentBase: "./",
|
||||
port: 8000,
|
||||
disableHostCheck: true,
|
||||
proxy: {
|
||||
'/services/v1/*': {
|
||||
changeOrigin: true,
|
||||
//target: 'https://devradar.xwf-id.com',
|
||||
target: 'http://radar.pgmmer.top',
|
||||
//target: 'http://10.1.22.21:16580',
|
||||
secure: true
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 配置入口
|
||||
entry: [
|
||||
path.resolve(__dirname, 'src/index.jsx')
|
||||
],
|
||||
output: {
|
||||
// path: 'dist', //不写居然也没事,由于有服务器,生成不了静态文件,这也是一个坑
|
||||
publicPath: 'dist',
|
||||
filename: '[name].bundle.js'
|
||||
},
|
||||
module: {
|
||||
loaders: [{
|
||||
test: /\.css$/,
|
||||
loader: ExtractTextPlugin.extract('style-loader', 'css-loader')
|
||||
}, //坑:不能用叹号链接,必须写成这种格式
|
||||
{
|
||||
test: /\.less$/,
|
||||
loader: ExtractTextPlugin.extract('style-loader', 'css-loader!less-loader')
|
||||
//loader: 'style!css!less'
|
||||
}, {
|
||||
test: /\.js[x]?$/,
|
||||
include: path.resolve(__dirname, 'src'),
|
||||
exclude: /node_modules/,
|
||||
loader: 'babel-loader'
|
||||
}, {
|
||||
test: /\.(png|jpg)$/,
|
||||
loader: 'url?limit=8192'
|
||||
}, {
|
||||
test: /\.(woff|woff2|eot|ttf|svg)(\?.*$|$)/,
|
||||
loader: 'url'
|
||||
}
|
||||
]
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['', '.js', '.jsx'],
|
||||
},
|
||||
plugins: [
|
||||
new webpack.optimize.CommonsChunkPlugin('common.js'),
|
||||
new ExtractTextPlugin("style.css"),
|
||||
new webpack.HotModuleReplacementPlugin(),
|
||||
new OpenBrowserPlugin({
|
||||
url: 'http://localhost:8000'
|
||||
})
|
||||
]
|
||||
};
|
||||
48
webapp/webpack.production.config.js
Normal file
48
webapp/webpack.production.config.js
Normal file
@ -0,0 +1,48 @@
|
||||
var webpack = require('webpack');
|
||||
var path = require('path');
|
||||
var ExtractTextPlugin = require('extract-text-webpack-plugin'); //抽取CSS文件插件
|
||||
var uglifyJsPlugin = webpack.optimize.UglifyJsPlugin;
|
||||
|
||||
module.exports = {
|
||||
entry: [
|
||||
path.resolve(__dirname, 'src/index.jsx')
|
||||
],
|
||||
output: {
|
||||
path: 'dist',
|
||||
filename: '[name].bundle.js'
|
||||
},
|
||||
module: {
|
||||
loaders: [{
|
||||
test: /\.css$/,
|
||||
loader: ExtractTextPlugin.extract('style-loader', 'css-loader')
|
||||
}, //坑:不能用叹号链接,必须写成这种格式
|
||||
{
|
||||
test: /\.less$/,
|
||||
loader: ExtractTextPlugin.extract('style-loader', 'css-loader', 'less-loader')
|
||||
}, {
|
||||
test: /\.js[x]?$/,
|
||||
include: path.resolve(__dirname, 'src'),
|
||||
exclude: /node_modules/,
|
||||
loader: 'babel-loader'
|
||||
}, {
|
||||
test: /\.(png|jpg)$/,
|
||||
loader: 'url?limit=8192'
|
||||
}, {
|
||||
test: /\.(woff|woff2|eot|ttf|svg)(\?.*$|$)/,
|
||||
loader: 'url'
|
||||
}
|
||||
]
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['', '.js', '.jsx'],
|
||||
},
|
||||
plugins: [
|
||||
new webpack.optimize.CommonsChunkPlugin('common.js'),
|
||||
new ExtractTextPlugin("style.css"),
|
||||
new uglifyJsPlugin({
|
||||
compress: {
|
||||
warnings: false
|
||||
}
|
||||
})
|
||||
]
|
||||
};
|
||||
4901
webapp/yarn.lock
Normal file
4901
webapp/yarn.lock
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user