Commit 9091a37b authored by 张苏雅's avatar 张苏雅

init

parent 4ca4a65f
{
"presets": [
["env", {
"targets": {
"browsers": [
"last 2 versions",
"Firefox ESR",
"> 1%",
"ie >= 9",
"iOS >= 8",
"Android >= 4"
]
}
}], "react", "stage-1"
],
"plugins": [
"transform-runtime", "transform-decorators-legacy"
],
"comments": false,
"compact": "false"
}
\ No newline at end of file
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
src/formsy/jqueryMultiSelect/*
src/components/navigation/noticeTipModal/Parabola.js
src/containers/account/finance/exportCashOrder/html2canvas.js
\ No newline at end of file
module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module'
},
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
extends: 'standard',
// required to lint *.vue files
plugins: [
'react'
],
parser: "babel-eslint",
// add your custom rules here
rules: {
// allow callback-literal
'no-callback-literal': 0,
// allow paren-less arrow functions
'arrow-parens': 0,
// allow async-await
'generator-star-spacing': 0,
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
semi: ['error', 'always'],
'space-before-function-paren': ['error', 'never'],
'no-useless-escape': 0,
'no-extra-boolean-cast': 0,
'no-new': 0,
'react/jsx-uses-vars': 2,
'react/jsx-uses-react': 2,
'prefer-spread': 'error'
},
globals: {
}
};
\ No newline at end of file
node_modules
dist
bower_components
uploads
npm-debug.log
yarn-error.log
yarn.lock
package-lock.json
.vscode
\ No newline at end of file
# 风控管理平台
## 启动项目
```javascript
yarn dev
```
## 发布项目
```javascript
yarn build
```
## 目录结构
``` bash
|____bin
| |____www // node 启动文件
|____dist
|____build
| |____build.js
| |____webpack.dev.conf.js
| |____webpack.prod.conf.js
| |____webpack.base.conf.js
| |____utils.js
|____config // webpack 配置
| |____dev.env.js
| |____index.js
| |____prod.env.js
| |____entry.js
|____mock // mock 数据配置
| |____server
| |____router
|____html // 模板html
| |____index.html
|____static // 静态文件
| |____favicon.ic
|____src
| |____entry
| | |____index.js
| |____styles // 公共样式
| |____components // 公共组件
| | |____footer
| | | |____index.less
| | | |____index.jsx
| | |____loading
| | | |____index.js
| | | |____loading.gif
| | | |____index.less
| | |____menu
| | | |____index.less
| | | |____index.jsx
| | | |____menuData.js // 侧边栏配置文件
| | |____breadcrumb
| | | |____index.less
| | | |____index.jsx
| | |____header
| | | |____index.less
| | | |____index.jsx
| |____lib // 工具库
| | |____permissionTools.js
| | |____dataFormate.js
| | |____common.js // fetch请求相关
| | |____utils.js
| | |____cookie.js
| |____containers // 业务页面
| | |____example // demo
| | | |____index.jsx
| | | |____example.less
| | | |____child
| | | | |____index.jsx
| | | |____store
| | | | |____index.js
| |____routes // 前端路由配置
| | |____nameFilter.js
| | |____index.js
| | |____riskmng.js
| | |____example.js
| | |____App.js
|____.editorconfig
|____README.md
|____yarn.lock
|____.gitignore
|____package.json
|____.eslintrc.js
|____.eslintignore
|____.babelrc
|____app.js
|____postcss.config.js
```
## 环境
```bash
前端项目 tuia-risk-manager-node
后端项目 tuia-risk-manager
开发环境 zhongkui.tuiadev.cn
测试环境 zhongkui.tuiatest.cn
预发环境 zhongkui.tuia.cn(118.31.40.85)
正式环境 zhongkui.tuia.cn
```
## 发布
先发后端系统,再发前端系统
## Jenkins
开发环境Jenkins
地址:http://jenkins.duibar.com
测试环境Jenkins
地址:http://172.16.80.21:8080/job/tiantianquwen-h5-node/
账号密码 http://cf.dui88.com/pages/viewpage.action?pageId=5806560
\ No newline at end of file
const express = require('express');
const path = require('path');
const webpack = require('webpack');
const webpackDevMiddleware = require('webpack-dev-middleware');
const webpackHotMiddleware = require('webpack-hot-middleware');
const config = require('./config');
const utils = require('./build/utils');
const devConfig = require('./build/webpack.dev.conf');
const compiler = webpack(devConfig);
const app = express();
app.use(webpackDevMiddleware(compiler, {
publicPath: devConfig.output.publicPath,
stats: {
colors: true,
chunks: false
},
headers: {
'Access-Control-Allow-Origin': '*'
}
}));
app.use(webpackHotMiddleware(compiler));
app.use(express.static('./'));
app.set('view engine', 'ejs');
app.set('views', path.join(__dirname, './dist/html/'));
app.engine('ejs', require('ejs').__express);
app.engine('html', require('ejs').__express);
require('./mock/router/')(app);
console.log(`<http://${utils.getIPAdress()}:${config.dev.port}> with Chrome`);
module.exports = app;
#!/usr/bin/env node
const config = require('../config');
/**
* Module dependencies.
*/
var app = require('../app');
var debug = require('debug')('epack:server');
var http = require('http');
/**
* Get port from environment and store in Express.
*/
var port = normalizePort(process.env.PORT || config.dev.port);
app.set('port', port);
/**
* Create HTTP server.
*/
var server = http.createServer(app);
/**
* Listen on provided port, on all network interfaces.
*/
server.listen(port);
server.on('error', onError);
server.on('listening', onListening);
/**
* Normalize a port into a number, string, or false.
*/
function normalizePort(val) {
var port = parseInt(val, 10);
if (isNaN(port)) {
// named pipe
return val;
}
if (port >= 0) {
// port number
return port;
}
return false;
}
/**
* Event listener for HTTP server "error" event.
*/
function onError(error) {
if (error.syscall !== 'listen') {
throw error;
}
var bind = typeof port === 'string'
? 'Pipe ' + port
: 'Port ' + port;
// handle specific listen errors with friendly messages
switch (error.code) {
case 'EACCES':
console.error(bind + ' requires elevated privileges');
process.exit(1);
break;
case 'EADDRINUSE':
console.error(bind + ' is already in use');
process.exit(1);
break;
default:
throw error;
}
}
/**
* Event listener for HTTP server "listening" event.
*/
function onListening() {
var addr = server.address();
var bind = typeof addr === 'string'
? 'pipe ' + addr
: 'port ' + addr.port;
debug('Listening on ' + bind);
}
const path = require('path');
const chalk = require('chalk');
const webpack = require('webpack');
const TuiaAutoUpload = require('tuia-auto-upload');
const config = require('../config');
const webpackConfig = require('./webpack.prod.conf');
webpack(webpackConfig, function(err, stats) {
if (err) throw err;
process.stdout.write(stats.toString({
colors: true,
modules: false,
children: false,
chunks: false,
chunkModules: false
}) + '\n\n');
console.log(chalk.cyan(' Build complete.\n'));
if (process.env.NODE_ENV === 'production') {
const uploader = new TuiaAutoUpload({
dir: path.join(__dirname, '../dist/assets/'),
originDir: config.path
});
uploader.start();
}
});
/*
* @Author: 周成
* @Date: 2018-01-16 15:51:14
* @Last Modified by: 周成
* @Last Modified time: 2018-05-28 15:42:14
*/
const path = require('path');
exports.computeEntry = function(entry = []) {
let result = {};
for (let i = 0; i < entry.length; i++) {
const item = entry[i];
const name = item.name;
result[name] = [path.join(__dirname, item.path)];
}
return result;
};
exports.computeTemplate = function(entry = []) {
let result = [];
for (let i = 0; i < entry.length; i++) {
const item = entry[i];
let params = {
name: item.name,
filename: path.join(__dirname, '../dist/html/', `${item.name}.html`),
template: `html-loader?attrs[]=img:src&attrs[]=img:data-src!${path.join(__dirname, item.template)}`,
chunks: ['vendors', item.name],
favicon: path.join(__dirname, '../static/favicon.ico')
};
if (process.env.NODE_ENV === 'production') {
params.minify = {
collapseWhitespace: true,
minifyJS: true,
minifyCSS: true,
removeComments: true
};
}
result.push(params);
}
return result;
};
exports.getIPAdress = function() {
let interfaces = require('os').networkInterfaces();
// 有WLAN先returnWLAN中的IP
if ('WLAN' in interfaces) {
let iface = interfaces['WLAN'];
for (let i = 0; i < iface.length; i++) {
let alias = iface[i];
if (
alias.family === 'IPv4' &&
alias.address !== '127.0.0.1' &&
!alias.internal
) {
return alias.address;
}
}
delete interfaces['WLAN'];
}
for (let devName in interfaces) {
let iface = interfaces[devName];
for (let i = 0; i < iface.length; i++) {
let alias = iface[i];
if (
alias.family === 'IPv4' &&
alias.address !== '127.0.0.1' &&
!alias.internal
) {
return alias.address;
}
}
}
};
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlWebpackHarddiskPlugin = require('html-webpack-harddisk-plugin');
const utils = require('./utils');
const config = require('../config');
const entryConfig = require('../config/entry');
const isProd = process.env.NODE_ENV === 'production';
module.exports = {
entry: Object.assign(utils.computeEntry(entryConfig), {
vendors: ['react', 'react-dom', 'react-router', 'antd']
}),
output: {
path: path.join(__dirname, '../dist/assets/'),
filename: isProd ? '[chunkhash].[name].js' : '[name].js',
publicPath: config[isProd ? 'build' : 'dev'].assetsPublicPath,
chunkFilename: isProd ? '[chunkhash].[name].js' : '[name].js'
},
resolve: {
alias: {
src: path.join(__dirname, '../src/')
},
extensions: ['.js', '.jsx']
},
externals: {
jquery: 'jQuery'
},
module: {
rules: [
{
test: /\.js[x]?$/,
exclude: /node_modules/,
loader: 'eslint-loader',
enforce: 'pre',
options: {
configFile: './.eslintrc.js',
formatter: require('eslint-friendly-formatter')
}
},
{
test: /\.js[x]?$/,
loaders: (isProd ? [] : ['react-hot-loader']).concat(['babel-loader?cacheDirectory=true']),
exclude: /node_modules/
},
{
test: /\.(svg|png|jpg|gif|ttf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/,
loader: 'url-loader',
options: {
limit: 10240
}
}
]
},
node: {
fs: 'empty'
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({
name: 'vendors',
filename: isProd ? '[chunkhash].vendors.js' : 'vendors.js'
}),
...utils.computeTemplate(entryConfig).map(el => {
return new HtmlWebpackPlugin(
Object.assign({}, el, {
alwaysWriteToDisk: true
})
);
}),
new HtmlWebpackHarddiskPlugin()
]
};
const webpack = require('webpack');
const merge = require('webpack-merge');
const FriendlyErrorsWebpackPlugin = require('friendly-errors-webpack-plugin');
const config = require('../config');
const webpackBaseConfig = require('./webpack.base.conf');
Object.keys(webpackBaseConfig.entry).forEach(function(name) {
if (name !== 'verdors') {
webpackBaseConfig.entry[name] = webpackBaseConfig.entry[name].concat('webpack-hot-middleware/client?reload=true');
}
});
module.exports = merge(webpackBaseConfig, {
devtool: config.dev.sourceMap ? '#eval-source-map' : false,
module: {
rules: [
{
test: /(\.less|\.css)$/,
exclude: /node_modules|antd\.less/,
use: ['style-loader?sourceMap', 'css-loader?sourceMap&modules=true&localIdentName=[local]_[hash:base64:5]', 'postcss-loader?sourceMap', 'less-loader?sourceMap&javascriptEnabled=true&modules=true&localIdentName=[local]-[hash:base64:5]']
},
{
test: /(\.less|\.css)$/,
include: /node_modules|antd\.less/,
use: ['style-loader?sourceMap', 'css-loader?sourceMap', 'less-loader?sourceMap&javascriptEnabled=true']
}
]
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: config.dev.env
}
}),
new FriendlyErrorsWebpackPlugin(),
new webpack.HotModuleReplacementPlugin()
]
});
const path = require('path');
const webpack = require('webpack');
const merge = require('webpack-merge');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const ProgressBarPlugin = require('progress-bar-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const ImageminPlugin = require('imagemin-webpack-plugin').default;
const chalk = require('chalk');
const os = require('os');
const config = require('../config/index');
const webpackBaseConfig = require('./webpack.base.conf');
module.exports = merge(webpackBaseConfig, {
module: {
rules: [
{
test: /(\.less|\.css)$/,
exclude: /node_modules|antd\.less/,
use: ExtractTextPlugin.extract({
fallback: {
loader: 'style-loader',
options: {
insertAt: 'top'
}
},
use: [
{
loader: 'css-loader',
options: {
modules: true,
minimize: true,
localIdentName: '[name]__[local]_[hash:base64:5]'
}
},
{
loader: 'postcss-loader'
},
{
loader: 'less-loader',
options: {
outputStyle: 'expanded',
javascriptEnabled: true
}
}
]
})
},
{
test: /(\.less|\.css)$/,
include: /node_modules|antd\.less/,
use: ExtractTextPlugin.extract({
fallback: {
loader: 'style-loader',
options: {
insertAt: 'top'
}
},
use: [
{
loader: 'css-loader',
options: {
minimize: true
}
},
{
loader: 'postcss-loader'
},
{
loader: 'less-loader',
options: {
outputStyle: 'expanded',
javascriptEnabled: true
}
}
]
})
}
]
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: config.build.env
}
}),
new UglifyJsPlugin({
uglifyOptions: {
compress: {
drop_console: true
}
},
cache: true,
parallel: os.cpus().length
}),
new webpack.NoEmitOnErrorsPlugin(),
new webpack.HashedModuleIdsPlugin(),
new webpack.optimize.ModuleConcatenationPlugin(),
new ProgressBarPlugin({
format: chalk.yellow('打包中 [:bar] :current/:total :percent :elapseds :msg'),
complete: '●',
incomplete: '○',
width: 20
}),
new CleanWebpackPlugin(
['dist'], {
root: path.resolve(__dirname, '../'),
verbose: false,
dry: false
}
),
new ExtractTextPlugin({
filename: '[contenthash].index.css',
allChunks: true
}),
new ImageminPlugin({
/**
* Linux依赖于libpng-devel
* yum install libpng-devel
*/
pngquant: {
quality: '95-100'
},
cacheFolder: path.join(__dirname, '../node_modules/.cache/imagemin-webpack-plugin')
})
]
});
const merge = require('webpack-merge');
const prodEnv = require('./prod.env');
module.exports = merge(prodEnv, {
NODE_ENV: '"development"'
});
module.exports = [
{
name: 'index',
path: '../src/entry',
template: '../html/index.html'
}
];
const utils = require('../build/utils');
const packagejson = require('../package.json');
const path = `/tuia/${packagejson.name}/dist/`;
const port = 17790;
module.exports = {
path,
build: {
env: require('./prod.env'),
assetsPublicPath: `//yun.tuia.cn${path}`,
sourceMap: false,
cssSourceMap: false
},
dev: {
env: require('./dev.env'),
assetsPublicPath: `http://${utils.getIPAdress()}:${port}/dist/`,
sourceMap: true,
cssSourceMap: false,
port
}
};
module.exports = {
NODE_ENV: '"production"'
};
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>审核操作台 - 钟馗</title>
</head>
<body>
<div id="app"></div>
<!--[if lte IE 9]>
<img style="width:600px; display:block; margin:250px auto 0;" src="http://yun.duiba.com.cn/tuia/myimg/support.png" alt="推荐使用Chrome最新版,火狐最新版来使用本网站,谢谢。">
<script type="text/javascript">document.getElementById('app').className='hide';</script>
<![endif]-->
</body>
</html>
\ No newline at end of file
const path = require('path');
const fs = require('fs');
// const url = require('url');
const router = require('express').Router();
const httpProxyMiddleware = require('http-proxy-middleware');
// const config = require('../../config');
// const upload = require('../server/upload');
const Router = function(app) {
router.get('/', function(req, res) {
// 根路由
res.render('index.html');
});
router.get(/html/, function(req, res) {
// html路由
res.render(req.path.replace('/', ''));
});
/**
* npm命令中带有process.env.proxy参数,则开启代理到指定服务器
*/
if (process.env.proxy) {
const filter = function(pathname, req) {
return !(pathname.match('html') || pathname === '/');
};
app.use(httpProxyMiddleware(filter, {
target: 'http://' + process.env.proxy + ':17811',
changeOrigin: false
}));
} else {
router.all('*', (req, res) => {
// mock路由,优先查找JS,其次是JSON,找不到返回默认值
const JSFilePath = path.join(__dirname, '../server/', `${req.path}.js`);
const JSONFilePath = path.join(__dirname, '../server/', `${req.path}.json`);
if (fs.existsSync(JSFilePath)) {
const file = fs.readFileSync(JSFilePath);
res.json(JSON.parse(file));
} else if (fs.existsSync(JSONFilePath)) {
const file = fs.readFileSync(JSONFilePath);
res.json(JSON.parse(file));
} else {
res.json({
code: '0',
desc: '成功',
data: '0',
success: true
});
}
});
}
app.use(router);
};
module.exports = Router;
{
"success": true,
"nowVersion": 1522031458229,
"authList": [
"specialADFeeShow",
"/advertMaterial/duibaAuditList",
"/appWhiteList/delete",
"advertMaterialPage",
"rechargePage",
"sellShow",
"advertWeightShow",
"queryAllAccountAuditList",
"/appFlowStrategy/queryAppFlowStrategyList",
"seeAllApplication",
"/landPageAudit/landPageAuditSearch",
"duibaAdvertMaterialPage",
"materialDataPage",
"invoice/refuseInvoice",
"appDataPageShow",
"accountQualificationsPage",
"invoice/exportAgentInvoiceStatisticsData",
"/financeReconciliation/list",
"/export/updateAppData",
"urlTagsShow",
"/phone/update",
"adverts/addPrivilegeAdvert",
"queryAllAdvertiserData",
"appDataShow",
"/advertStatistics/getAppData",
"/advertGroupData/groupDataEnter",
"/advertMaterial/list",
"/couponRecoveryLog/getRecoveryLogData",
"/advertGroupNew/unBindAdvert",
"/appPackage/update",
"tagLibraryNew",
"advertGroupPage",
"advertStatistics/exportAdvertMaterialStatistics",
"recoveryLogPage",
"adManage",
"AdvertSortPage",
"tradeShow",
"tagLibraryPage",
"queryAllMaterialData",
"/specialApp/deleteByAppId",
"invoice/saveCourierNumber",
"appointmentInfoPage",
"/account/changeAccountInfo",
"/qualification/auditQualifications",
"/adverts/updateAdvertPlan",
"appManagerDuibaSource",
"/advertGroupNew/deleteAdvertGroup",
"queryAllOrientPkgData",
"/tag/add",
"queryAllAdvertGroupData",
"appManagePage",
"/advertStatistics/exportLandingPageData",
"queryAllAppPackage",
"OrientPkgDataPage",
"/finance/commitApplication",
"/advertStatistics/getDailyData",
"export/removePrivilegeApp",
"/finance/consumeRecord",
"/advertiser/pageQuery",
"realizeAct",
"/adverts/pageQuery",
"/tag/queryTagLibrary",
"landPage",
"/appWhiteList/AppFlowStrategyDelete",
"/advertStatistics/getLandingAnalysisData",
"materialTagsShow",
"bannedTagShow",
"/qualification/updateQualificationsAuditRemark",
"/export/getAppBannedTags",
"/finance/getRecord",
"appManagerTuiaSource",
"financeManage",
"/advertStatistics/getAdvertiserData",
"appManagerAllSource",
"advertiserDataPage",
"advertiserManage",
"/export/updateSendLuckybag",
"appPackagePage",
"/finance/assistantRefuse",
"/appWhiteList/bindAdvert",
"/specialApp/specialList",
"advertPage",
"financeReconciliation",
"advertStatistics/exportAdvertiserData",
"agentInvoiceStatisticsDataPage",
"/newTag/addAppByNewTagNum",
"/qualification/updateQualifications",
"/advertGroupNew/groupList",
"/qualification/fastAuditQualifications",
"/land/save",
"/adverts/validAdvertSort",
"/finance/managerAgree",
"/appFlowStrategy/findAppFlowStrategyById",
"systemConfig/updateSystemConfig",
"appName",
"appWhiteListPage",
"/finance/recharge",
"/appPackage/list",
"advertOrientPackageShow",
"/advertStatistics/getAdvertMaterialStatistics",
"/appWhiteList/bindAppFlowStrategyAdvert",
"/finance/getFinanceInfo",
"advertMaterialShow",
"appManage",
"coinExRate",
"/appWhiteList/getStrategyAppWhiteList",
"/landPageAudit/auditLandPage",
"/advertGroupNew/insertAdvertGroup",
"/appWhiteList/orderBindAdvert",
"/finance/exportConsumeRecord",
"/finance/managerRefuse",
"cashAudit",
"/land/exportLandData",
"/newTag/addNewTag",
"export/addPrivilegeApp",
"/adverts/queryValidAdverts",
"/advertGroupNew/bindAdvert",
"/newTag/queryNewTagLibrary",
"orientPkgStatistics/exportOrientPkgData",
"advertStatistics/exportAppData",
"/land/query",
"flowStrategyAllSource",
"landingPageEditPage",
"/adverts/updateAdvertDuiBaBannedTag",
"resourceShow",
"/correction/update",
"/advertStatistics/getStatistics",
"/adverts/updateCoupon",
"flowStrategyTuiaSource",
"/adverts/updateCheckAdvert",
"materialTagsEditShow",
"invoice/exportAgentInvoiceRecord",
"test/",
"adverts/removePrivilegeAdvert",
"/advertGroup/bindAdvert",
"matchTagShow",
"advertDuiBaBannedTagShow",
"invoiceRecordPage",
"/advertGroupData/groupDailyData",
"/newTag/addAdvertByNewTagNum",
"/advertiser/updateFreezeStatus",
"SystemConfigPage",
"/advertiser/pageQueryAppointmentInfoReq",
"dataManage",
"/landPageAudit/landPageAuditListSearch",
"/advertGroupNew/updateAdvertGroup",
"/advertiser/updateCheckStatus",
"/orientPkg/updateAdvertOrientPackageBudget",
"urlTagsEditShow",
"advertDiagnosisShow",
"globalShow",
"systemConfig/getSystemConfig",
"tuiaAct",
"/appWhiteList/getAppWhiteList",
"recoveryLogDownload",
"weightwhitelist",
"AEShow",
"/export/findAppData",
"/orientPkgStatistics/getOrientPkgStatistics",
"/specialApp/addApps",
"consumeRecordPage",
"/adverts/saveTagsByAdvertId",
"/landPageAudit",
"appDataPage",
"appFlowStrategyPage",
"advertGroupDataPage",
"phonePage",
"/finance/exportbalanceRecord",
"rechargeRecordPage",
"/advertStatistics/exportAdvertData",
"/land/queryList",
"advertStatistics/exportDailyData",
"balanceRecordPage",
"advertDataPage",
"/appWhiteList/queryAdvertPlan",
"/qualification/pageQueryAccountQualifications",
"privilegeAdvertLibraryPage",
"advertStatistics/exportDailyDataByHour",
"platformManage",
"invoice/queryAgentInvoiceRecord",
"/finance/assistantAgree",
"/finance/balanceRecord",
"/newTag/deleteAllAdvertByNewTagNum",
"/finance/exportExcel",
"advertiserManagePage",
"editAppFlowStrategyPage",
"/advertGroupData/groupDataList",
"invoice/queryAgentInvoiceStatisticsData",
"/advertStatistics/queryDataByHour",
"queryAllAdvertData",
"landManager",
"flowStrategyDuibaSource",
"/phone/get",
"/newTag/deleteAdvertByNewTagNum",
"/adverts/findAdvertInfo",
"tagLibraryManage",
"/newTag/deleteAppByTagNum",
"invoice/passInvoice",
"/qualification/auditQualifications,/qualification/fastAuditQualif",
"displayAeWorkBench",
"accountManager",
"accountManager/weMediaAccount",
"contentConfig",
"contentConfig/stickManager",
"/***risk风控****/",
"riskmng",
"riskmng/auditsys",
"riskmng/auditcase",
"riskmng/innercheck",
"nameFilter",
"/nameFilter/black",
"/nameFilter/white",
"/plan/canAdvertReview",
"ruleEngine",
"ruleEngine/scence",
"ruleEngine/strategy",
"ruleEngine/strategy/rule",
"ruleEngine/report",
"ruleEngine/field"
],
"version": 1522031458229
}
{
"code": "0",
"desc": "修改失败",
"success": false
}
\ No newline at end of file
{
"code": "0",
"desc": "成功",
"success": true,
"data": {
"totalCount": 11,
"totalPage": 2,
"list": [
{
"id": 20,
"dimension": 0,
"val": "测试时间下午15:29",
"stat": 0,
"src": "测试",
"memo": "测试nemo",
"gmtCreate": 1526887770000,
"creator": "舒曼",
"gmtModified": null,
"mender": null
},
{
"id": 19,
"dimension": 0,
"val": "名单",
"stat": 0,
"src": "来源",
"memo": "备注",
"gmtCreate": 1526886808000,
"creator": "徐恒飞",
"gmtModified": null,
"mender": null
},
{
"id": 18,
"dimension": 0,
"val": "名单值是什么2",
"stat": 0,
"src": "名单值是什么2",
"memo": "名单值是什么",
"gmtCreate": 1526875280000,
"creator": "徐恒飞",
"gmtModified": null,
"mender": null
},
{
"id": 17,
"dimension": 0,
"val": "名单值是什么1",
"stat": 0,
"src": "名单值是什么1",
"memo": "名单值是什么",
"gmtCreate": 1526875271000,
"creator": "徐恒飞",
"gmtModified": null,
"mender": null
},
{
"id": 15,
"dimension": 0,
"val": "名单值是什么",
"stat": 0,
"src": "名单值是什么",
"memo": "名单值是什么",
"gmtCreate": 1526875257000,
"creator": "徐恒飞",
"gmtModified": null,
"mender": null
},
{
"id": 14,
"dimension": 2,
"val": "名单值是什么",
"stat": 0,
"src": "奇货",
"memo": "11111",
"gmtCreate": 1526875250000,
"creator": "徐恒飞",
"gmtModified": null,
"mender": null
},
{
"id": 8,
"dimension": 0,
"val": "3",
"stat": 0,
"src": "3",
"memo": "3",
"gmtCreate": 1526869590000,
"creator": "徐恒飞",
"gmtModified": 1526869725000,
"mender": "徐恒飞"
},
{
"id": 4,
"dimension": 0,
"val": "1",
"stat": 0,
"src": "1",
"memo": "1",
"gmtCreate": 1526869513000,
"creator": "徐恒飞",
"gmtModified": 1526869721000,
"mender": "徐恒飞"
},
{
"id": 3,
"dimension": 0,
"val": "22",
"stat": 0,
"src": "22",
"memo": "2222",
"gmtCreate": 1526869090000,
"creator": "徐恒飞",
"gmtModified": 1526871712000,
"mender": "徐恒飞"
},
{
"id": 2,
"dimension": 1,
"val": "1",
"stat": 0,
"src": "推啊",
"memo": "11111",
"gmtCreate": 1526869076000,
"creator": "徐恒飞",
"gmtModified": 1526869700000,
"mender": "徐恒飞"
}
],
"sum": null
}
}
\ No newline at end of file
{
"code": "string",
"data": [
{
"creator": "string",
"description": "string",
"editor": "string",
"gmtCreate": "2018-07-30T01:23:18.895Z",
"gmtModified": "2018-07-30T01:23:18.895Z",
"gmtModifiedView": "string",
"id": 0,
"name": "string",
"sceneId": 1,
"sceneName": "string",
"tableColumn": "string",
"tableName": "string",
"type": "string"
}, {
"creator": "string",
"description": "string",
"editor": "string",
"gmtCreate": "2018-07-30T01:23:18.895Z",
"gmtModified": "2018-07-30T01:23:18.895Z",
"gmtModifiedView": "string",
"id": 1,
"name": "string1",
"sceneId": 1,
"sceneName": "string",
"tableColumn": "string",
"tableName": "string",
"type": "string"
}
],
"desc": "string",
"success": true
}
\ No newline at end of file
{
"code": "string",
"data": {
"list": [
{
"creator": "string",
"editor": "string",
"gmtCreate": "2018-07-25T08:44:52.992Z",
"gmtModified": "2018-07-25T08:44:52.992Z",
"gmtModifiedView": "string",
"id": 0,
"name": "string",
"sceneId": 0,
"sceneNames": [
{
"creator": "string",
"editor": "string",
"gmtCreate": "2018-07-25T08:44:52.992Z",
"gmtModified": "2018-07-25T08:44:52.992Z",
"gmtModifiedView": "string",
"id": 0,
"name": "string",
"sceneId": 0,
"sceneName": "string",
"tableColumn": "string",
"tableName": "string",
"type": "string"
},
{
"creator": "string",
"editor": "string",
"gmtCreate": "2018-07-25T08:44:52.992Z",
"gmtModified": "2018-07-25T08:44:52.992Z",
"gmtModifiedView": "string",
"id": 1,
"name": "string",
"sceneId": 1,
"sceneName": "string1",
"tableColumn": "string",
"tableName": "string",
"type": "数值"
}
],
"tableColumn": "string",
"tableName": "string",
"type": "数值"
}
],
"sum": {
"creator": "string",
"editor": "string",
"gmtCreate": "2018-07-25T08:44:52.992Z",
"gmtModified": "2018-07-25T08:44:52.992Z",
"gmtModifiedView": "string",
"id": 0,
"name": "string",
"sceneId": 0,
"sceneNames": [
{
"creator": "string",
"editor": "string",
"gmtCreate": "2018-07-25T08:44:52.992Z",
"gmtModified": "2018-07-25T08:44:52.992Z",
"gmtModifiedView": "string",
"id": 0,
"name": "string",
"sceneId": 0,
"sceneName": "string",
"tableColumn": "string",
"tableName": "string",
"type": "string"
}
],
"tableColumn": "string",
"tableName": "string",
"type": "string"
},
"totalCount": 0,
"totalPage": 0
},
"desc": "string",
"success": true
}
\ No newline at end of file
{
"code": "string",
"data": [
{
"creator": "string",
"description": "string",
"editor": "string",
"gmtCreate": "2018-07-26T03:44:17.215Z",
"gmtModified": "2018-07-26T03:44:17.215Z",
"gmtModifiedView": "string",
"id": 0,
"sceneKey": "string",
"sceneName": "string",
"sceneType": 0
},
{
"creator": "string",
"description": "string",
"editor": "string",
"gmtCreate": "2018-07-26T03:44:17.215Z",
"gmtModified": "2018-07-26T03:44:17.215Z",
"gmtModifiedView": "string",
"id": 1,
"sceneKey": "string1",
"sceneName": "string1",
"sceneType": 0
}
],
"desc": "string",
"success": true
}
\ No newline at end of file
{
"code": "string",
"data": {
"list": [
{
"creator": "string",
"description": "string",
"editor": "string",
"gmtCreate": "2018-07-25T08:44:53.024Z",
"gmtModified": "2018-07-25T08:44:53.024Z",
"gmtModifiedView": "string",
"id": 0,
"sceneKey": "string",
"sceneName": "string",
"sceneType": 1
}
],
"sum": {
"creator": "string",
"description": "string",
"editor": "string",
"gmtCreate": "2018-07-25T08:44:53.024Z",
"gmtModified": "2018-07-25T08:44:53.024Z",
"gmtModifiedView": "string",
"id": 0,
"sceneKey": "string",
"sceneName": "string",
"sceneType": 0
},
"totalCount": 0,
"totalPage": 0
},
"desc": "string",
"success": true
}
\ No newline at end of file
{
"code": "0",
"data": {"num": 0},
"desc": ""
}
\ No newline at end of file
{
"code": "string",
"data": [
{
"tagName": "哈",
"tagNum": "0"
},
{
"tagName": "哈ha",
"tagNum": "1"
},
{
"tagName": "哈haha",
"tagNum": "2"
}
],
"desc": "string",
"success": true
}
\ No newline at end of file
{
"code": "string",
"data": [
{
"tagName": "啦",
"tagNum": "1"
},
{
"tagName": "啦la",
"tagNum": "2"
},
{
"tagName": "啦lalala",
"tagNum": "3"
}
],
"desc": "string",
"success": true
}
\ No newline at end of file
{
"code": "string",
"data": true,
"desc": "string",
"success": true
}
\ No newline at end of file
{
"code": "string",
"data": true,
"desc": "string",
"success": true
}
\ No newline at end of file
{
"code": "string",
"data": true,
"desc": "string",
"success": true
}
\ No newline at end of file
{
"code": "0",
"desc": "成功",
"success": true,
"data": {
"totalCount": 838,
"totalPage": 84,
"list": [
{
"advertId": 2899,
"advertName": "www",
"advertMaster": "dd",
"agentName": "公司网炸了!",
"source": 0,
"inspectStatus": 3,
"inspectResult": 3,
"inspectCount": 6,
"inspectMemo": "sss",
"inspectTime": 1526539754000,
"firstReviewer": "",
"ae": "",
"sale": "",
"secondReviewer": "徐恒飞",
"lastReviewTime": 1526538473000,
"advertStatusShow": "有效",
"advertStatus": 0
},
{
"advertId": 2901,
"advertName": "testing_jzl_ads",
"advertMaster": "杭州虎妞科技",
"agentName": "兑吧科技网络有限公司",
"source": 0,
"inspectStatus": 3,
"inspectResult": 3,
"inspectCount": 2,
"inspectMemo": "dd",
"inspectTime": 1526540462000,
"firstReviewer": "",
"ae": "",
"sale": "",
"secondReviewer": "徐恒飞",
"lastReviewTime": 1526538468000,
"advertStatusShow": "有效",
"advertStatus": 0
},
{
"advertId": 2900,
"advertName": "105",
"advertMaster": "testtest",
"agentName": "杭州兑吧网络科技有限公司23",
"source": 0,
"inspectStatus": 1,
"inspectResult": 1,
"inspectCount": 1,
"inspectMemo": "",
"inspectTime": 1526539660000,
"firstReviewer": "",
"ae": "zjy",
"sale": "方雄韬",
"secondReviewer": "徐恒飞",
"lastReviewTime": 1526537782000,
"advertStatusShow": "失效",
"advertStatus": 1
},
{
"advertId": 2902,
"advertName": "jzl_testing_ads",
"advertMaster": "杭州虎妞科技",
"agentName": "兑吧科技网络有限公司",
"source": 0,
"inspectStatus": 3,
"inspectResult": 0,
"inspectCount": 0,
"inspectMemo": "",
"inspectTime": null,
"firstReviewer": "",
"ae": "",
"sale": "",
"secondReviewer": "徐恒飞",
"lastReviewTime": 1526537777000,
"advertStatusShow": "失效",
"advertStatus": 1
},
{
"advertId": 2903,
"advertName": "jzl_testing_ad",
"advertMaster": "杭州虎妞科技",
"agentName": "兑吧科技网络有限公司",
"source": 0,
"inspectStatus": 0,
"inspectResult": 0,
"inspectCount": 0,
"inspectMemo": "",
"inspectTime": null,
"firstReviewer": "",
"ae": "",
"sale": "",
"secondReviewer": "徐恒飞",
"lastReviewTime": 1526537695000,
"advertStatusShow": "有效",
"advertStatus": 0
},
{
"advertId": 2904,
"advertName": "106",
"advertMaster": "3级广告主",
"agentName": "二级代理商",
"source": 0,
"inspectStatus": 0,
"inspectResult": 0,
"inspectCount": 0,
"inspectMemo": "",
"inspectTime": null,
"firstReviewer": "",
"ae": "",
"sale": "",
"secondReviewer": "徐恒飞",
"lastReviewTime": 1526537631000,
"advertStatusShow": "有效",
"advertStatus": 0
},
{
"advertId": 2905,
"advertName": "107",
"advertMaster": "3级广告主",
"agentName": "二级代理商",
"source": 0,
"inspectStatus": 0,
"inspectResult": 0,
"inspectCount": 0,
"inspectMemo": "",
"inspectTime": null,
"firstReviewer": "",
"ae": "",
"sale": "",
"secondReviewer": "徐恒飞",
"lastReviewTime": 1526537556000,
"advertStatusShow": "失效",
"advertStatus": 1
},
{
"advertId": 2906,
"advertName": "108",
"advertMaster": "3级广告主2",
"agentName": "二级代理商",
"source": 0,
"inspectStatus": 0,
"inspectResult": 0,
"inspectCount": 0,
"inspectMemo": "",
"inspectTime": null,
"firstReviewer": "",
"ae": "",
"sale": "",
"secondReviewer": "徐恒飞",
"lastReviewTime": 1526537362000,
"advertStatusShow": "有效",
"advertStatus": 0
},
{
"advertId": 2907,
"advertName": "109",
"advertMaster": "3级广告主2",
"agentName": "二级代理商",
"source": 0,
"inspectStatus": 0,
"inspectResult": 0,
"inspectCount": 0,
"inspectMemo": "",
"inspectTime": null,
"firstReviewer": "",
"ae": "",
"sale": "",
"secondReviewer": "徐恒飞",
"lastReviewTime": 1526537289000,
"advertStatusShow": "有效",
"advertStatus": 0
},
{
"advertId": 2908,
"advertName": "110",
"advertMaster": "4级广告主",
"agentName": "3级代理商",
"source": 0,
"inspectStatus": 0,
"inspectResult": 0,
"inspectCount": 0,
"inspectMemo": "",
"inspectTime": null,
"firstReviewer": "",
"ae": "",
"sale": "",
"secondReviewer": "徐恒飞",
"lastReviewTime": 1526537266000,
"advertStatusShow": "有效",
"advertStatus": 0
}
],
"sum": null
}
}
{
"code": "string",
"data": true,
"desc": "string",
"success": true
}
\ No newline at end of file
This diff is collapsed.
{
"code": "string",
"data": [
{
"exampleId": 0,
"id": 0,
"imgUrl": "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
}, {
"exampleId": 0,
"id": 0,
"imgUrl": "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
}
],
"desc": "string",
"success": true
}
\ No newline at end of file
{
"code": "string",
"data": [
{
"exampleId": 0,
"id": 0,
"imgUrl": "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
}, {
"exampleId": 0,
"id": 0,
"imgUrl": "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
}
],
"desc": "string",
"success": true
}
\ No newline at end of file
This diff is collapsed.
{
"code": "0",
"desc": "成功",
"success": true,
"data": [
{
"id": 1,
"name": "徐恒飞",
"account": "xhf",
"enable": true,
"tokenSecret": null,
"superAdmin": true,
"canRecharge": true,
"staffId": 1,
"email": "xhf@duiba.com.cn",
"mobile": "13333333333",
"gmtCreate": 1403090180000,
"gmtModified": 1521100577000,
"systemIdSet": [0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 13, 14, 15, 17],
"isRoleSuperAuth": true,
"sensitiveDataAuth": true,
"dingUserId": null
},
{
"id": 89,
"name": "张舒曼",
"account": "zhangshuman",
"enable": true,
"tokenSecret": null,
"superAdmin": false,
"canRecharge": false,
"staffId": null,
"email": "zhangshuman@duiba.com.cn",
"mobile": "13606632435",
"gmtCreate": 1504233036000,
"gmtModified": 1520423548000,
"systemIdSet": [0, 3, 14],
"isRoleSuperAuth": false,
"sensitiveDataAuth": true,
"dingUserId": null
},
{
"id": 148,
"name": "舒曼",
"account": "5e28c30daad999e6b268a783f6c0cf3d",
"enable": true,
"tokenSecret": null,
"superAdmin": false,
"canRecharge": false,
"staffId": null,
"email": "zsm@duiba.com.cn",
"mobile": "13606632435",
"gmtCreate": 1522304547000,
"gmtModified": 1522304547000,
"systemIdSet": [0, 14],
"isRoleSuperAuth": false,
"sensitiveDataAuth": true,
"dingUserId": null
}
]
}
{
"code": "0",
"data": 111.11,
"desc": "成功",
"success": true
}
\ No newline at end of file
{
"code": "string",
"data": {
"list": [
{
"cheatGrade": "1",
"curDate": "2018-03-26T10:45:59.608Z",
"preResult": 0,
"preRiskReviewer": "string",
"reviewRemarks": "string",
"reviewResult": 0,
"riskReviewer": "string",
"slotId": 0,
"slotName": "string"
},
{
"cheatGrade": "1",
"curDate": "2018-03-26T10:45:59.608Z",
"preResult": 0,
"preRiskReviewer": "string",
"reviewRemarks": "string",
"reviewResult": 0,
"riskReviewer": "string",
"slotId": 0,
"slotName": "string"
},
{
"cheatGrade": "1",
"curDate": "2018-03-26T10:45:59.608Z",
"preResult": 0,
"preRiskReviewer": "string",
"reviewRemarks": "string",
"reviewResult": 0,
"riskReviewer": "string",
"slotId": 0,
"slotName": "string"
}
],
"sum": {
"cheatGrade": "string",
"curDate": "2018-03-26T10:45:59.608Z",
"preResult": 0,
"preRiskReviewer": "string",
"reviewRemarks": "string",
"reviewResult": 0,
"riskReviewer": "string",
"slotId": 0,
"slotName": "string"
},
"totalCount": 88,
"totalPage": 9
},
"desc": "string",
"success": true
}
\ No newline at end of file
{
"code": "string",
"data": {
"cheatGradeFive": 10,
"cheatGradeFour": 110,
"cheatGradeOne": 1110,
"cheatGradeSix": 1110,
"cheatGradeThree": 11110,
"cheatGradeTwo": 110,
"cheatGradeZero": 110,
"toDOCount": 10,
"finalDealMoneySum": "300.00"
},
"desc": "string",
"success": true
}
\ No newline at end of file
This diff is collapsed.
{
"code": "0",
"desc": "成功",
"success": true,
"data": [
{
"id": 28,
"riskAllId": 211111,
"riskReviewer": "徐恒飞",
"reviewResult": 1,
"reviewAction": "初步处理结果",
"reviewTime": "2018-05-22 14:12:54",
"rate": null,
"mediaMemo": null
},
{
"id": 29,
"riskAllId": 211111,
"riskReviewer": "徐恒飞",
"reviewResult": 1,
"reviewAction": "最终处理结果",
"reviewTime": "2018-05-22 14:13:02",
"rate": null,
"mediaMemo": null
},
{
"id": 30,
"riskAllId": 211111,
"riskReviewer": "徐恒飞",
"reviewResult": 2,
"reviewAction": "最终处理结果",
"reviewTime": "2018-05-22 14:14:06",
"rate": null,
"mediaMemo": null
},
{
"id": 35,
"riskAllId": 211111,
"riskReviewer": "徐恒飞",
"reviewResult": 1,
"reviewAction": "初步处理结果",
"reviewTime": "2018-05-22 16:58:21",
"rate": null,
"mediaMemo": null
},
{
"id": 36,
"riskAllId": 211111,
"riskReviewer": "徐恒飞",
"reviewResult": 2,
"reviewAction": "最终处理结果",
"reviewTime": "2018-05-22 16:59:35",
"rate": null,
"mediaMemo": null
},
{
"id": 37,
"riskAllId": 211111,
"riskReviewer": "徐恒飞",
"reviewResult": 1,
"reviewAction": "最终处理结果",
"reviewTime": "2018-05-23 09:37:03",
"rate": null,
"mediaMemo": null
},
{
"id": 43,
"riskAllId": 211111,
"riskReviewer": "徐恒飞",
"reviewResult": 1,
"reviewAction": "初步处理结果",
"reviewTime": "2018-05-23 15:33:27",
"rate": null,
"mediaMemo": null
},
{
"id": 45,
"riskAllId": 211111,
"riskReviewer": "徐恒飞",
"reviewResult": 1,
"reviewAction": "初步处理结果",
"reviewTime": "2018-05-31 09:52:31",
"rate": null,
"mediaMemo": null
},
{
"id": null,
"riskAllId": null,
"riskReviewer": "meida-test",
"reviewResult": null,
"reviewAction": "通知媒体运营",
"reviewTime": "2018-01-01 00:00:01",
"rate": 6000,
"mediaMemo": null
},
{
"id": null,
"riskAllId": null,
"riskReviewer": "meida-test",
"reviewResult": null,
"reviewAction": "媒体运营反馈",
"reviewTime": "",
"rate": 4000,
"mediaMemo": "hello world"
}
]
}
{
"code": "0",
"desc": "成功",
"success": true,
"data": {
"totalCount": 5,
"totalPage": 1,
"list": [
{
"name": "场景1",
"type": "wawaji",
"scence": "wawaji",
"detail": "c端产品",
"user": "前端",
"time": "2018-07-19"
}
],
"sum": null
}
}
{
"code": "0",
"desc": "查询媒体包列表",
"data": {
"totalCount": 5,
"totalPage": 1,
"list": [
{
"id": 3,
"name": "一个被逼疯的测试",
"remark": "一个被逼疯的测试",
"status": "启用"
},
{
"id": 3,
"name": "一个被逼疯的测试",
"remark": "一个被逼疯的测试",
"status": "启用",
"child": 1
},
{
"id": 3,
"name": "一个被逼疯的测试",
"remark": "一个被逼疯的测试",
"status": "启用",
"child": 1
},
{
"id": 3,
"name": "一个被逼疯的测试",
"remark": "一个被逼疯的测试",
"status": "启用",
"child": 1
},
{
"id": 3,
"name": "一个被逼疯的测试",
"remark": "一个被逼疯的测试",
"status": "启用"
}
]
}
}
\ No newline at end of file
{
"code": "0",
"desc": "成功",
"success": true,
"data": {
"totalCount": 5,
"totalPage": 1,
"list": [
{
"name": "场景1",
"sign": "wawaji",
"type": "wawaji",
"detail": "c端产品",
"createUser": "前端",
"updateTime": "2018-07-19"
}
],
"sum": null
}
}
{
"code": "0",
"desc": "成功",
"success": true,
"data": {
"totalCount": 5,
"totalPage": 1,
"list": [
{
"name": "场景1",
"sign": "wawaji",
"scence": "wawaji",
"status": 0,
"detail": "c端产品",
"user": "前端",
"time": "2018-07-19"
}
],
"sum": null
}
}
{
"code": "string",
"data": {
"list": [
{
"conditions": [
{
"creator": "string",
"editor": "string",
"fieldId": 0,
"gmtCreate": "2018-07-25T08:44:53.228Z",
"gmtModified": "2018-07-25T08:44:53.228Z",
"id": 0,
"operation": 0,
"ruleId": 0,
"threshold": "string"
}, {
"creator": "string",
"editor": "string",
"fieldId": 0,
"gmtCreate": "2018-07-25T08:44:53.228Z",
"gmtModified": "2018-07-25T08:44:53.228Z",
"id": 1,
"operation": 0,
"ruleId": 0,
"threshold": "string"
}
],
"creator": "string",
"decision": 0,
"description": "string",
"editor": "string",
"gmtCreate": "2018-07-25T08:44:53.228Z",
"gmtModified": "2018-07-25T08:44:53.228Z",
"id": 0,
"mode": 0,
"name": "string",
"status": 0,
"strategyId": 1,
"type": 0
},
{
"conditions": [
{
"creator": "string",
"editor": "string",
"fieldId": 0,
"gmtCreate": "2018-07-25T08:44:53.228Z",
"gmtModified": "2018-07-25T08:44:53.228Z",
"id": 0,
"operation": 0,
"ruleId": 0,
"threshold": "string"
}
],
"creator": "string",
"decision": 0,
"description": "string",
"editor": "string",
"gmtCreate": "2018-07-25T08:44:53.228Z",
"gmtModified": "2018-07-25T08:44:53.228Z",
"id": 1,
"mode": 1,
"name": "string",
"parentRuleId": 1,
"status": 0,
"strategyId": 2,
"type": 0
},
{
"conditions": [
{
"creator": "string",
"editor": "string",
"fieldId": 0,
"gmtCreate": "2018-07-25T08:44:53.228Z",
"gmtModified": "2018-07-25T08:44:53.228Z",
"id": 0,
"operation": 0,
"ruleId": 0,
"threshold": "string"
}
],
"creator": "string",
"decision": 0,
"description": "string",
"editor": "string",
"gmtCreate": "2018-07-25T08:44:53.228Z",
"gmtModified": "2018-07-25T08:44:53.228Z",
"id": 2,
"mode": 0,
"name": "string",
"parentRuleId": 2,
"status": 0,
"strategyId": 3,
"type": 0
},
{
"conditions": [
{
"creator": "string",
"editor": "string",
"fieldId": 0,
"gmtCreate": "2018-07-25T08:44:53.228Z",
"gmtModified": "2018-07-25T08:44:53.228Z",
"id": 0,
"operation": 0,
"ruleId": 0,
"threshold": "string"
}
],
"creator": "string",
"decision": 0,
"description": "string",
"editor": "string",
"gmtCreate": "2018-07-25T08:44:53.228Z",
"gmtModified": "2018-07-25T08:44:53.228Z",
"id": 3,
"mode": 0,
"name": "string",
"parentRuleId": 3,
"status": 0,
"strategyId": 4,
"type": 0
},
{
"conditions": [
{
"creator": "string",
"editor": "string",
"fieldId": 0,
"gmtCreate": "2018-07-25T08:44:53.228Z",
"gmtModified": "2018-07-25T08:44:53.228Z",
"id": 0,
"operation": 0,
"ruleId": 0,
"threshold": "string"
}
],
"creator": "string",
"decision": 111,
"description": "string",
"editor": "string",
"gmtCreate": "2018-07-25T08:44:53.228Z",
"gmtModified": "2018-07-25T08:44:53.228Z",
"id": 4,
"mode": 0,
"name": "string",
"status": 0,
"strategyId": 5,
"type": 1
}
],
"sum": {
"conditions": [
{
"creator": "string",
"editor": "string",
"fieldId": 0,
"gmtCreate": "2018-07-25T08:44:53.228Z",
"gmtModified": "2018-07-25T08:44:53.228Z",
"id": 0,
"operation": 0,
"ruleId": 0,
"threshold": "string"
}
],
"creator": "string",
"decision": 111,
"description": "string",
"editor": "string",
"gmtCreate": "2018-07-25T08:44:53.228Z",
"gmtModified": "2018-07-25T08:44:53.228Z",
"id": 0,
"mode": 0,
"name": "string",
"status": 0,
"strategyId": 6,
"type": 0
},
"totalCount": 0,
"totalPage": 0
},
"desc": "string",
"success": true
}
\ No newline at end of file
{
"adminName": "徐恒飞",
"success": true,
"adminId": 1,
"email": "xhf@duiba.com.cn",
"code": "SSO:01001"
}
\ No newline at end of file
{
"success": true
}
\ No newline at end of file
{
"system": {
"id": 24,
"appNameAlias": "tuia-news-manager",
"appName": "天天趣闻媒体管理平台",
"icon": null
},
"success": true,
"ssoHomeURL": "http://sso.duibadev.com.cn"
}
\ No newline at end of file
{
"code": "string",
"data": {
"list": [
{
"creator": "string",
"description": "string",
"editor": "string",
"gmtCreate": "2018-07-25T08:44:53.042Z",
"gmtModified": "2018-07-25T08:44:53.042Z",
"id": 0,
"sceneId": 0,
"score1": 1,
"score2": 2,
"score3": 3,
"score4": 4,
"status": 0,
"strategyKey": "string",
"strategyName": "string",
"strategyType": 0
},
{
"creator": "string",
"description": "string",
"editor": "string",
"gmtCreate": "2018-07-25T08:44:53.042Z",
"gmtModified": "2018-07-25T08:44:53.042Z",
"id": 1,
"sceneId": 0,
"score1": 1,
"score2": 2,
"score3": 3,
"score4": 4,
"status": 0,
"strategyKey": "string",
"strategyName": "string",
"strategyType": 0
}
],
"sum": {
"creator": "string",
"description": "string",
"editor": "string",
"gmtCreate": "2018-07-25T08:44:53.042Z",
"gmtModified": "2018-07-25T08:44:53.042Z",
"id": 0,
"sceneId": 0,
"score1": 0,
"score2": 0,
"score3": 0,
"score4": 0,
"status": 0,
"strategyKey": "string",
"strategyName": "string",
"strategyType": 0
},
"totalCount": 0,
"totalPage": 0
},
"desc": "string",
"success": true
}
\ No newline at end of file
{
"code": "0",
"desc": "success",
"data": [
{
"tagId": 2,
"contents": "父标签->字标签1"
},
{
"tagId": 3,
"contents": "父标签->字标签2"
},
{
"tagId": 4,
"contents": "父标签->字标签3"
},
{
"tagId": 5,
"contents": "父标签->字标签4"
},
{
"tagId": 6,
"contents": "父标签->字标5"
},
{
"tagId": 7,
"contents": "父标签->字标签6"
},
{
"tagId": 8,
"contents": "父标签->字标签7"
},
{
"tagId": 9,
"contents": "父标签->字标签8"
},
{
"tagId": 10,
"contents": "父标签->字标签9"
},
{
"tagId": 11,
"contents": "父标签->字标签10"
},
{
"tagId": 12,
"contents": "父标签->字标签11"
}
]
}
\ No newline at end of file
{
"code": "0",
"data": {
"fileName": "string",
"md5": "string",
"url": "string"
},
"desc": "string",
"success": true
}
\ No newline at end of file
{
"success": true,
"data": {
"list": [
{
"creator": "string",
"dimension": 0,
"gmtCreate": "2018-05-11T06:01:10.389Z",
"gmtModified": "2018-05-11T06:01:10.389Z",
"id": 0,
"memo": "string",
"mender": "string",
"src": "string",
"stat": 0,
"val": "string"
}
],
"sum": {
"creator": "string",
"dimension": 0,
"gmtCreate": "2018-05-11T06:01:10.389Z",
"gmtModified": "2018-05-11T06:01:10.389Z",
"id": 0,
"memo": "string",
"mender": "string",
"src": "string",
"stat": 0,
"val": "string"
},
"totalCount": 0,
"totalPage": 0
}
}
{
"name": "tuia-risk-manager-node",
"version": "1.0.0",
"description": "风控管理后台",
"main": "app.js",
"scripts": {
"start": "ncu && yarn install && cross-env NODE_ENV=development node ./bin/www",
"build": "yarn install && cross-env BUILD_TYPE=production NODE_ENV=production node build/build.js",
"lint": "eslint --fix --ext .js,.jsx src test/unit/specs test/e2e/specs"
},
"author": "heyesheng@duiba.com.cn",
"license": "ISC",
"dependencies": {
"antd": "^3.4.1",
"mobx": "^4.2.0",
"mobx-react": "^5.0.0",
"react": "^16.3.2",
"react-dom": "^16.3.2",
"react-router": "^3.2.1"
},
"devDependencies": {
"babel-core": "~6.26.0",
"babel-eslint": "^8.2.3",
"babel-loader": "~7.1.2",
"babel-plugin-import": "^1.7.0",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.6.1",
"babel-preset-react": "~6.24.1",
"babel-preset-stage-1": "^6.24.1",
"chalk": "^2.4.0",
"clean-webpack-plugin": "^0.1.17",
"cross-env": "^5.0.5",
"css-loader": "~0.28.10",
"ejs": "^2.5.9",
"eslint": "^4.19.1",
"eslint-config-standard": "^11.0.0",
"eslint-friendly-formatter": "^4.0.1",
"eslint-loader": "^2.0.0",
"eslint-plugin-import": "^2.11.0",
"eslint-plugin-node": "^6.0.1",
"eslint-plugin-promise": "^3.7.0",
"eslint-plugin-react": "^7.7.0",
"eslint-plugin-standard": "^3.0.1",
"express": "^4.16.2",
"extract-text-webpack-plugin": "^3.0.2",
"file-loader": "^1.1.9",
"formidable": "^1.0.17",
"friendly-errors-webpack-plugin": "^1.7.0",
"html-loader": "^0.5.5",
"html-webpack-harddisk-plugin": "^0.2.0",
"html-webpack-plugin": "^3.1.0",
"http-proxy-middleware": "^0.18.0",
"imagemin-webpack-plugin": "^2.1.1",
"jsx-loader": "~0.13.2",
"less": "^3.0.1",
"less-loader": "^4.1.0",
"postcss-loader": "^2.1.4",
"progress-bar-webpack-plugin": "^1.11.0",
"react-hot-loader": "^2.0.0-alpha-4",
"style-loader": "~0.20.2",
"tuia-auto-upload": "git+ssh://git@gitlab2.dui88.com:frontend/tuia-auto-upload.git#1.1.1",
"uglifyjs-webpack-plugin": "^1.2.5",
"url-loader": "~1.0.1",
"webpack": "^3.11.0",
"webpack-bundle-analyzer": "^2.11.1",
"webpack-dev-middleware": "^2.0.6",
"webpack-hot-middleware": "^2.21.0",
"webpack-merge": "^4.1.2"
},
"repository": {
"type": "git",
"url": "git@gitlab2.dui88.com:frontend/tuia-risk-manager-node.git"
},
"keywords": [
"Webpack",
"React",
"Antd",
"ES6"
]
}
module.exports = {
plugins: [
require('autoprefixer')({
browsers: [
'last 2 versions',
'Firefox ESR',
'> 1%',
'ie >= 9',
'iOS >= 8',
'Android >= 4'
]
}),
require('cssnano')({
preset: 'default',
zindex: false,
reduceTdent: false
})
]
};
import React from 'react';
import {
Link,
hashHistory
} from 'react-router';
import {
Breadcrumb as AntdBreadcrumb
} from 'antd';
import styles from './index.less';
const routes = [{
path: '//',
breadcrumbName: '首页'
}, {
path: 'accountManager/weMediaAccount',
breadcrumbName: '自媒体账号'
}];
class Breadcrumb extends React.Component {
constructor(props) {
super(props);
hashHistory.getCurrentLocation();
}
itemRender = (route, params, routes, paths) => {
const last = routes.indexOf(route) === routes.length - 1;
return last ? <span>{route.breadcrumbName}</span> : <Link to={paths.join('/')}>{route.breadcrumbName}</Link>;
}
render() {
const { show = false } = this.props;
return (
show
? <AntdBreadcrumb
className={styles.container}
itemRender={this.itemRender}
routes={routes}
/>
: <span></span>
);
}
}
export default Breadcrumb;
/**
* 目前因为没有footer需求,用于今后拓展
*/
import React from 'react';
import { Layout } from 'antd';
import styles from './index.less';
const { Footer: AntdFooter } = Layout;
class Footer extends React.Component {
render() {
return (
<AntdFooter className={styles.footer}></AntdFooter>
);
};
};
export default Footer;
.footer {
padding: 0!important;
}
\ No newline at end of file
import React from 'react';
import common from 'src/lib/common';
import utils from 'src/lib/utils';
import {
Layout
} from 'antd';
import Breadcrumb from 'src/components/breadcrumb';
import styles from './index.less';
const { Header: AntdHeader } = Layout;
class Header extends React.Component {
handleQuit = () => {
const _quit = () => {
common.fetch('/sso/outLogin')
.then((res) => {
if (res.success) {
utils.logout();
}
});
};
_quit();
}
render() {
const { accountInfo = {} } = this.props;
const { name = '' } = (accountInfo || {});
return (
<AntdHeader className={styles.header}>
<div
className={styles.logo}
onClick={() => utils.jumpTo('/')}
>
{/* <img src="../../../static/favicon.ico" className={styles.img_wid} alt=""/> */}
<img className = {styles.img_wid} src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFQAAAAmCAMAAABtX0w5AAAArlBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8tivQqAAAAOXRSTlMABhL7Zuy6HNwgCQ8V9zQMq9OeLb5JJuDKfmBP6MGkmYZvxonOkTcxd/Pwsmnk169FKo1WPBlcP5VadjJvAAAFN0lEQVRIx6WU2ZaiMBBAKyC7yKogIpuIKO5La/3/j01CRGXGM/Mw95zuJiHerlSVBZxbiG8KBXocUH7vDFAaQcfExyMw9CU67EyK5Q2ekAg/EJcEPrDmmBp/l1rCBeMfw7gVmCoG/7SwXWPPWt/gjbfDWrkpw79Iz36BGMhyaeLe9z0glnK0O1vQPcx/JsNndCSn+47j2DyALUoVcPTRpcS8qirDDgJVjRFjVQ2CoIJ6Ib8CbO6J2S32yVkHij4LpDAsyzIxtoPBIEpwnUX04Q4wwiez08rzvBrjy4n+HVmALzY0c2Qh4QsBKKvdJlcEiqHhJwmA4soxzps1jmGoaacl7q8aBeAtDaZtZLnal1Z+BBwFxTJN52ge0nQtuu2Wj5WwxzGZ+n65RjMs5r5vAIjIaSqWeFaXpCfVV+NZC1HQzAAijE8AKrbS0xzvmkqlB9xMKdmUtubwJX2wqKOwZv/+LH5IYSvFQRBLkkGlC179t7QQr63URocw4Gy+pKLLBNMYN6xFjVz8kN7Pvoj+8qx/kXqh+ZJCy+IlXdcCVbmsWU17yLpIekuJRVe5YMEX6cqRqqfUVBl7qbv+bqYDeDIPTywqKjo6Lyn1SDgA+CYdqcHqKZXchOI6IpeGHgDM9tTJCX5YyWSxJyVfpdfYOfVySnhO1weBRjbj7bnmDZtRhZ6az+p72QYX1Uj5Ij2avtZJjZZlK82AVYbb9lHI4522dbPaG8bY9QdtqVa6An2HKVBmmAy7nIYtMcspQ1vybPoTGB5MZLgTeKK5BzomyuYwoFJ3tVrgJlrVa5wCJcKFPuHStdwSPKWrhl+9bSuy5Inwr/AikjBqC/XBrmITL6MVfEpLaMnMVnos+ampTpV0nfNRpV4A+oUayow97Q9ZbiKgaLI45tKuT4UGN1T6s+PpZCX3pm0jOMiQctKXQm/08XzvTlzaoFRPKa6JNum+pr7GPqyiumX35Dnu96l+/WNIky0eCJfWTePLjKT2xjMuTSb0yFRi8bECCKn4Kd1KOB3I7h9SpZAGQKV89HFuMHECJjWnN4Cbu+b1SqlrWG/6ke42uPxDOhZlg57d81cdW1GkUunHoumRReSIstfO+56U5nz4u9R4xGOgyLgu5x1+EWMBonolbDJQZ2d1ZkB3wvf1N+VAAUpfOkzPBCgnOxY/2MgrkDVWcBU/aSMYNgZwViOBwEsqxk+pMHsesIQeFoBON3MT+2xynb35CiHwb7oO6rNU4H8QZPxGc4P/QCm+SgsN/odJ+c05ed1EUxSFGBZ7JPRnIrAqsuSyX5rC9tnYUIhlsE22oozKP51e57Qui2xhT7ZHAKM+kePivDgSeFxoMGcwojTLFcivtNiRfokAlEzI78DQkt/L9E4o0arRXB7aOQ3PH8/CizcrZyAFd7irxtQ/Vm5qydEwOSv6IgXwHKUZPPP66DltAT6J6HBNspV3n1/OCV3bS32XFdbV8eQtADmRJnczAazsQaWhYg+6xH3EKj6Ufs6LiEBSJK7tRGlNN+pE2K3Sxcq5y5WxlG3hEKgZUOkS4PSW8hHC2Wz7cQ5TNr7tzJtc/Z80pTuua+0m2jwrR/IFRpdYOzzuYQR65gJUxe0tpfOSt9a8Ij2nXss6UOmWdfTx4nhwDC4Qn2BshsZifgNtpx0imNGBsQ0FWByMA5dyhJ/5pvgxoI+3N9VgN2i2BIbykeROoOYWk1pnB5Tlbr9/6E0EJHKuQh3u7RFQ6Se6pQOnt0khOouftaOhGPwJCFveFINA+9JiTUp7lK5+AQTzAL9if75kAAAAAElFTkSuQmCC" alt=""/>
<span>风控管理平台</span>
</div>
<div className={styles.header_wrap}>
<Breadcrumb show={false}/>
<div className={styles.user_info_wrap}>
<span>{name}</span>
<span onClick={this.handleQuit}>退出</span>
</div>
</div>
</AntdHeader>
);
}
}
export default Header;
.logo {
width:250px;
font-size: 18px;
color: #fff;
float: left;
cursor: pointer;
span{
padding-left:15px;
border-left:1px solid #fff
}
.img_wid{
margin-right:10px;
width:76px;
height:34px;
}
}
.header {
padding: 0 20px!important;
}
.header_wrap {
display: flex;
justify-content: space-between;
align-items: center;
width: calc(100% - 250px);
height: 100%;
padding: 0 4px 0 24px;
float:left;
}
.user_info_wrap {
span {
padding: 5px 10px;
color: #fff;
&:first-child {
border-right: 1px solid rgba(255,255,255,.45);
}
&:last-child {
cursor: pointer;
}
}
}
/**
* 数据加载提示框
*/
import styles from './index.less';
let loadingNum = 0;
const Loading = (function() {
return {
open(text = '正在处理,请稍等...') {
loadingNum++;
if (loadingNum > 1) {
return;
}
// 生成dom
const doc = window.document;
this.node = doc.createElement('div');
this.node.className = styles.my_loading;
let node2 = doc.createElement('div');
node2.className = styles.my_loading_wrap;
this.node.appendChild(node2);
let node3 = doc.createElement('section');
node3.className = styles.my_loading_content;
node2.appendChild(node3);
let node4 = doc.createElement('i');
node4.className = styles.my_loading_img;
let node5 = doc.createElement('span');
node5.className = styles.my_loading_text;
node5.innerHTML = text;
node3.appendChild(node4);
node3.appendChild(node5);
doc.body.appendChild(this.node);
},
close() {
loadingNum--;
if (loadingNum > 0) {
return;
}
this.node && window.document.body.removeChild(this.node);
}
};
})();
export default Loading;
.my_loading
{
position: fixed;
z-index: 9999;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, .8);
.my_loading_wrap
{
position: relative;
top: 50%;
left: 50%;
overflow: hidden;
width: 290px;
height: 108px;
margin-top: -54px;
margin-left: -145px;
border-radius: 10px;
background-color: #fff;
.my_loading_content
{
position: relative;
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
.my_loading_img
{
width: 28px;
height: 28px;
background-image: data-uri('./loading.gif');
background-size: 100% 100%;
}
.my_loading_text
{
margin-left: 5px;
font-size: 16px;
font-weight: bold;
color: #091929;
}
}
}
}
\ No newline at end of file
import React from 'react';
import { Link } from 'react-router';
import PermissionTool from 'src/lib/permissionTools';
import {
Layout,
Menu as AntdMenu,
Icon
} from 'antd';
import MENU from './menuData';
import styles from './index.less';
const { SubMenu } = AntdMenu;
const { Sider } = Layout;
class Menu extends React.Component {
constructor(props) {
super(props);
this.state = {
collapsed: false
};
}
// 菜单伸缩
_toggle = () => {
this.setState((preState, props) => ({
collapsed: !preState.collapsed
}));
}
// 生成一级菜单
_createSubMenu = () => {
return MENU.map((item) => {
const { icon, title, key, auth } = item;
const subMenuTitle = (
<span>
<Icon type={icon} />
<span>{title}</span>
</span>
);
return PermissionTool.ifRender(auth) ? (
<SubMenu
key={key}
title={subMenuTitle}
>
{ this._createItemMenu(item) }
</SubMenu>
) : null;
});
}
// 生成二级菜单
_createItemMenu = (subMenuData) => {
const { children } = subMenuData;
return children.map((subItem) => {
const { auth, key, route, title } = subItem;
return PermissionTool.ifRender(auth) ? (
<AntdMenu.Item key={key}>
<Link to={route}>{title}</Link>
</AntdMenu.Item>
) : null;
});
}
// 获取当前路由
getCurrentPaths = () => {
const { currentLocation = {} } = this.props;
const { pathname = '' } = currentLocation;
let paths = pathname.split('/');
paths.shift();
if (paths.length === 1 && paths[0] === '') {
paths = ['riskmng', 'auditsys', 'ruleEngine'];
}
return paths;
}
render() {
const currentPaths = this.getCurrentPaths();
const defaultOpenKeys = [currentPaths.shift()];
const selectedKeys = [currentPaths.shift()];
const { collapsed } = this.state;
return (
<Sider
width={150}
trigger={null}
className={styles.slider}
collapsible
collapsed={collapsed}
>
<div className={styles.menu_top} onClick={this._toggle}>
<Icon
className="trigger"
type={collapsed ? 'menu-unfold' : 'menu-fold'}
/>
</div>
<AntdMenu
mode="inline"
selectedKeys={selectedKeys}
defaultOpenKeys={defaultOpenKeys}
className={styles.menu}
>
{this._createSubMenu()}
</AntdMenu>
</Sider>
);
}
}
export default Menu;
.menu_top {
width: 100%;
height: 40px;
line-height: 40px;
text-align: center;
cursor: pointer;
}
.slider {
background: #fff!important;
overflow-y: auto;
}
.menu {
border-right: 0;
}
\ No newline at end of file
const MENU = [
{
title: '风险控制',
icon: 'appstore-o',
key: 'riskmng',
auth: 'riskmng',
route: 'riskmng/auditsys',
children: [
{
title: '风控操作台',
key: 'auditsys',
auth: 'riskmng/auditsys',
route: 'riskmng/auditsys'
},
{
title: '案例库',
key: 'auditcase',
auth: 'riskmng/auditcase',
route: 'riskmng/auditcase'
},
{
title: '内控审核',
key: 'innercheck',
auth: 'riskmng/innercheck',
route: 'riskmng/innercheck'
}
]
},
{
title: '名单管控',
icon: 'user',
key: 'nameFilter',
auth: 'nameFilter',
children: [
{
title: '黑名单',
key: 'black',
auth: 'nameFilter/black',
route: 'nameFilter/black'
},
{
title: '白名单',
key: 'white',
auth: 'nameFilter/white',
route: 'nameFilter/white'
}
]
},
{
title: '规则引擎',
icon: 'setting',
key: 'ruleEngine',
auth: 'ruleEngine',
children: [
{
title: '场景管理',
key: 'scence',
auth: 'ruleEngine/scence',
route: 'ruleEngine/scence'
},
{
title: '策略管理',
key: 'strategy',
auth: 'ruleEngine/strategy',
route: 'ruleEngine/strategy'
},
// {
// title: '规则管理',
// key: 'rule',
// auth: 'ruleEngine/rule',
// route: 'ruleEngine/rule'
// },
// {
// title: '风控报告',
// key: 'report',
// auth: 'ruleEngine/report',
// route: 'ruleEngine/report'
// },
{
title: '字段管理',
key: 'field',
auth: 'ruleEngine/field',
route: 'ruleEngine/field'
}
]
}
];
export default MENU;
import React from 'react';
class Child extends React.Component {
render() {
return (
<div>
You got lv3 child!
</div>
);
}
}
export default Child;
.test{
color: red;
}
\ No newline at end of file
import React from 'react';
import { observer } from 'mobx-react';
import { Link } from 'react-router';
import { Button } from 'antd';
import store from './store';
import styles from './example.less';
// 修饰器函数注入store
@observer
class Example extends React.Component {
componentDidMount() {
store.fetch();
}
render() {
// 从store里获取计算属性 data 以及action
const {data, addNum, isMoreThanFive} = store;
return (
<div>
Example! <span className={styles.test}>CSS Modules Go</span>
<br />
<Button><Link to="example/lv3">route to example/lv3</Link></Button>
<span>{data.num}</span>
<span>数字是否大于5{isMoreThanFive}</span>
<Button onClick={ addNum }>点击增加数字</Button>
{this.props.children}
</div>
);
}
}
export default Example;
import { observable, action, computed } from 'mobx';
import common from 'src/lib/common';
class State {
// 默认data
@observable data = {
num: 1
};
// 计算属性
@computed
get isMoreThanFive() {
if (this.data.num > 5) {
return 'true';
} else {
return 'false';
}
}
// 拉取数据action
@action
fetch = () => {
common.fetch('example/getNum').then((res) => {
this.data = res.data;
});
}
// 修改action
@action
addNum = () => {
this.data.num++;
}
}
// 实例化store
const store = new State();
export default store;
import React from 'react';
class Home extends React.Component {
render() {
return (
<div>
You had match Home
</div>
);
}
}
export default Home;
import React from 'react';
import { observer } from 'mobx-react';
import { withRouter } from 'react-router';
import PageSearch from './search';
import Table from './table';
@observer
class NameFilter extends React.Component {
render() {
return (
<div>
<PageSearch/>
<Table/>
</div>
);
}
};
export default withRouter(NameFilter);
import React from 'react';
import { observer } from 'mobx-react';
import store from '../store';
import {
Form,
Input,
Modal,
Select
} from 'antd';
import moment from 'moment';
const FormItem = Form.Item;
const Option = Select.Option;
let TextArea = Input.TextArea;
const dateFormat = 'YYYY-MM-DD HH:mm:ss';
const dimension = [
{ value: 0, text: 'ip' },
{ value: 1, text: 'device_id' },
{ value: 2, text: 'consumer_id' }
];
const riskRankArr = [
{ value: 2, text: '高风险' },
{ value: 1, text: '中风险' },
{ value: 0, text: '低风险' }
];
const stat = [
{ value: 0, text: '启用' },
{ value: 1, text: '禁用' }
];
@observer
class Edit extends React.Component {
handleOk = () => {
this.props.form.validateFields((err, values) => {
if (!err) {
const { blacklistUpdate, blacklistSave } = store;
const { getFieldValue } = this.props.form;
let params = {
dimension: getFieldValue('dimension'),
stat: getFieldValue('stat'),
src: getFieldValue('src'),
memo: getFieldValue('memo'),
val: getFieldValue('val'),
riskRank: getFieldValue('riskRank'),
gmtCreate: this.props.editObj.gmtCreate || '',
creator: this.props.editObj.creator || '',
id: this.props.editObj.id
};
this.props.isEdit ? blacklistUpdate(params) : blacklistSave(params);
this.props.closeModal();
}
});
};
handleCancel = () => {
this.props.closeModal();
};
render() {
const formItemLayout = {
labelCol: {
xs: { span: 24 },
sm: { span: 8 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 }
}
};
const { getFieldDecorator } = this.props.form;
// 名单维度
let dimensionProps = getFieldDecorator('dimension', {
initialValue: this.props.editObj.dimension || 0
});
let valProps = getFieldDecorator('val', {
initialValue: this.props.editObj.val || '',
rules: [{
required: true, message: '请输入!'
}]
});
// 风险等级
let riskRankProps = getFieldDecorator('riskRank', {
initialValue: typeof this.props.editObj.riskRank === 'undefined' ? 2 : this.props.editObj.riskRank
});
// 状态
let statProps = getFieldDecorator('stat', {
initialValue: this.props.editObj.stat || 0
});
// 来源
let srcProps = getFieldDecorator('src', {
initialValue: this.props.editObj.src || ''
});
// 备注
let memoProps = getFieldDecorator('memo', {
initialValue: this.props.editObj.memo || '',
rules: [{
max: 64, message: '最多输入64个字符!'
}]
});
return (
<div>
<Modal
title={ this.props.isEdit ? '修改黑名单' : '添加黑名单'}
width={400}
visible={true}
maskClosable={false}
onOk={this.handleOk}
onCancel={this.handleCancel}
okText="确认"
cancelText="取消"
>
<Form>
<FormItem
{...formItemLayout}
label="名单维度"
>
{
dimensionProps(
<Select
style={{ width: '100%' }}
placeholder="Tags Mode"
disabled={this.props.isEdit}
>
{dimension && dimension.map((d, index) => <Option key={index} value={d.value}>{d.text}</Option>)}
</Select>
)
}
</FormItem>
<FormItem
{...formItemLayout}
label="名单值"
>
{valProps(
<Input type="text" />
)}
</FormItem>
<FormItem
{...formItemLayout}
label="风险等级"
>
{
riskRankProps(
<Select
style={{ width: '100%' }}
placeholder="Tags Mode"
>
{riskRankArr && riskRankArr.map((d, index) => <Option key={index} value={d.value}>{d.text}</Option>)}
</Select>
)
}
</FormItem>
<FormItem
{...formItemLayout}
label="来源"
>
{srcProps(
<Input type="text" />
)}
</FormItem>
<FormItem
{...formItemLayout}
label="状态"
>
{
statProps(
<Select
style={{ width: '100%' }}
placeholder="Tags Mode"
>
{stat && stat.map((d, index) => <Option key={index} value={d.value}>{d.text}</Option>)}
</Select>
)
}
</FormItem>
<FormItem
{...formItemLayout}
label="备注:"
>
{memoProps(
<TextArea rows={3} />
)}
</FormItem>
{this.props.isEdit ? <FormItem
{...formItemLayout}
label="更新人:"
>
<div>{this.props.editObj.mender}</div>
</FormItem> : null }
{this.props.isEdit ? <FormItem
{...formItemLayout}
label="更新时间:"
>
<div>{this.props.editObj.gmtModified ? moment(this.props.editObj.gmtModified).format(dateFormat) : ''}</div>
</FormItem> : null }
</Form>
</Modal>
</div>
);
}
}
const EditModal = Form.create({})(Edit);
export default EditModal;
import React from 'react';
import { observer } from 'mobx-react';
import store from '../store';
import styles from './index.less';
import {
DatePicker,
Form,
Input,
Button,
Select
} from 'antd';
import moment from 'moment';
const FormItem = Form.Item;
const Option = Select.Option;
const { RangePicker } = DatePicker;
const dateFormat = 'YYYY-MM-DD';
const dimension = [
{ value: '', text: '全部' },
{ value: 0, text: 'ip' },
{ value: 1, text: 'device_id' },
{ value: 2, text: 'consumer_id' }
];
const stat = [
{ value: '', text: '全部' },
{ value: 0, text: '启用' },
{ value: 1, text: '禁用' }
];
@observer
class SearchFilter extends React.Component {
constructor(props) {
super(props);
this.state = {
loading: false,
time: [moment().subtract(30, 'days'), moment().subtract(0, 'days')]
};
}
componentDidMount() {
this.search();
}
// 查询
search = () => {
const { updateParams, getDataList } = store;
const { getFieldValue } = this.props.form;
let timeRange = getFieldValue('time');
let params = {
'dateRange.from': (timeRange && timeRange[0] && timeRange[0].format(dateFormat)) || '',
'dateRange.to': (timeRange && timeRange[1] && timeRange[1].format(dateFormat)) || '',
dimension: getFieldValue('dimension'),
stat: getFieldValue('stat'),
src: getFieldValue('src') || '',
currentPage: 1
};
updateParams(params);
getDataList();
}
// 重置
reset = () => {
const { resetFields } = this.props.form;
resetFields();
}
render() {
const { getFieldDecorator } = this.props.form;
const formItemLayout = {
labelCol: {
xs: { span: 24 },
sm: { span: 8 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 }
}
};
// 名单维度
let dimensionProps = getFieldDecorator('dimension', {
initialValue: ''
});
// 状态
let statProps = getFieldDecorator('stat', {
initialValue: 0
});
// 来源
let srcProps = getFieldDecorator('src');
// 日期选择器
let timeProps = getFieldDecorator('time', {
initialValue: this.state.time
});
return (
<div className={styles.search_warp}>
<Form layout="inline" >
<FormItem>
{timeProps(
<RangePicker
format={dateFormat}
/>
)}
</FormItem>
<FormItem
{...formItemLayout}
label="名单维度:"
>
{
dimensionProps(
<Select
style={{ width: '140px' }}
placeholder="Tags Mode"
>
{dimension && dimension.map((d, index) => <Option key={index} value={d.value}>{d.text}</Option>)}
</Select>
)
}
</FormItem>
<FormItem
{...formItemLayout}
label="状态:"
>
{
statProps(
<Select
style={{ width: '80px' }}
placeholder="Tags Mode"
>
{stat && stat.map((d, index) => <Option key={index} value={d.value}>{d.text}</Option>)}
</Select>
)
}
</FormItem>
<FormItem
{...formItemLayout}
label="来源"
>
{srcProps(
<Input type="text" />
)}
</FormItem>
<FormItem>
<Button
type="primary"
htmlType="submit"
onClick={this.search}
>
查询
</Button>
</FormItem>
<FormItem>
<Button
type="primary"
htmlType="submit"
onClick={this.reset}
>
重置
</Button>
</FormItem>
</Form>
</div>
);
}
}
const PageSearch = Form.create({})(SearchFilter);
export default PageSearch;
.search_warp {
margin-bottom: 20px;
}
.ant-form-item-label {
width: 65px;
}
.ant-form-item {
width: 200px;
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
.row_warp {
margin-bottom: 10px;
}
.link {
color:#1890ff;
}
\ No newline at end of file
import React from 'react';
class NameFilter extends React.Component {
render() {
return (
<div>{ this.props.children }</div>
);
};
};
export default NameFilter;
import React from 'react';
import { observer } from 'mobx-react';
import { withRouter } from 'react-router';
import PageSearch from './search';
import Table from './table';
@observer
class NameFilter extends React.Component {
render() {
return (
<div>
<PageSearch/>
<Table/>
</div>
);
}
};
export default withRouter(NameFilter);
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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