Browse Source

Merge branch 'master' of ssh://gitea.anxinyun.cn:2022/free-sun/GovernmentDataResourceCenter

master
Julin 2 years ago
parent
commit
8a39391713
  1. 30
      web/client/src/app.js
  2. 12
      web/client/src/components/Upload/index.js
  3. 2
      web/client/src/index.js
  4. 2
      web/client/src/layout/components/header/index.js
  5. 4
      web/client/src/layout/containers/layout/breadcrumb.js
  6. 4
      web/client/src/layout/containers/layout/index.js
  7. 3
      web/client/src/sections/auth/containers/login.js
  8. 6
      web/client/src/sections/homePage/nav-item.js
  9. 15
      web/client/src/sections/metadataAcquisition/actions/example.js
  10. 7
      web/client/src/sections/metadataAcquisition/actions/index.js
  11. 7
      web/client/src/sections/metadataAcquisition/containers/acquisitionLog.js
  12. 7
      web/client/src/sections/metadataAcquisition/containers/acquisitionTask.js
  13. 7
      web/client/src/sections/metadataAcquisition/containers/adapter.js
  14. 7
      web/client/src/sections/metadataAcquisition/containers/dataSourceManagement.js
  15. 8
      web/client/src/sections/metadataAcquisition/containers/index.js
  16. 15
      web/client/src/sections/metadataAcquisition/index.js
  17. 24
      web/client/src/sections/metadataAcquisition/nav-item.js
  18. 5
      web/client/src/sections/metadataAcquisition/reducers/index.js
  19. 32
      web/client/src/sections/metadataAcquisition/routes.js
  20. 15
      web/client/src/sections/metadataManagement/actions/example.js
  21. 7
      web/client/src/sections/metadataManagement/actions/index.js
  22. 7
      web/client/src/sections/metadataManagement/containers/businessMetadata.js
  23. 9
      web/client/src/sections/metadataManagement/containers/index.js
  24. 24
      web/client/src/sections/metadataManagement/containers/latestMetadata.js
  25. 7
      web/client/src/sections/metadataManagement/containers/metaModelManagement.js
  26. 7
      web/client/src/sections/metadataManagement/containers/metadataDetails.js
  27. 7
      web/client/src/sections/metadataManagement/containers/tagManagement.js
  28. 15
      web/client/src/sections/metadataManagement/index.js
  29. 24
      web/client/src/sections/metadataManagement/nav-item.js
  30. 5
      web/client/src/sections/metadataManagement/reducers/index.js
  31. 38
      web/client/src/sections/metadataManagement/routes.js
  32. 15
      web/client/src/sections/resourceConsumption/actions/example.js
  33. 7
      web/client/src/sections/resourceConsumption/actions/index.js
  34. 7
      web/client/src/sections/resourceConsumption/containers/approve.js
  35. 6
      web/client/src/sections/resourceConsumption/containers/index.js
  36. 7
      web/client/src/sections/resourceConsumption/containers/myApplication.js
  37. 15
      web/client/src/sections/resourceConsumption/index.js
  38. 18
      web/client/src/sections/resourceConsumption/nav-item.js
  39. 5
      web/client/src/sections/resourceConsumption/reducers/index.js
  40. 22
      web/client/src/sections/resourceConsumption/routes.js
  41. 15
      web/client/src/sections/resourceRetrieval/actions/example.js
  42. 7
      web/client/src/sections/resourceRetrieval/actions/index.js
  43. 4
      web/client/src/sections/resourceRetrieval/containers/index.js
  44. 7
      web/client/src/sections/resourceRetrieval/containers/retrieval.js
  45. 15
      web/client/src/sections/resourceRetrieval/index.js
  46. 12
      web/client/src/sections/resourceRetrieval/nav-item.js
  47. 5
      web/client/src/sections/resourceRetrieval/reducers/index.js
  48. 11
      web/client/src/sections/resourceRetrieval/routes.js
  49. 16
      web/config.js
  50. 12
      web/routes/attachment/index.js

30
web/client/src/app.js

@ -4,19 +4,29 @@ import React, { useEffect } from 'react';
import Layout from './layout';
import Auth from './sections/auth';
import homePage from './sections/homePage';
import MetadataManagement from './sections/metadataManagement';
import MetadataAcquisition from './sections/metadataAcquisition';
import resourceConsumption from './sections/resourceConsumption';
import resourceRetrieval from './sections/resourceRetrieval';
const App = props => {
const { projectName } = props
const { projectName } = props
useEffect(() => {
document.title = projectName;
}, [])
useEffect(() => {
document.title = projectName;
}, [])
return (
<Layout
title={projectName}
sections={[homePage, Auth,]}
/>
)
return (
<Layout
title={projectName}
sections={[
homePage,
Auth,
MetadataManagement,
MetadataAcquisition,
resourceConsumption,
resourceRetrieval]}
/>
)
}

12
web/client/src/components/Upload/index.js

@ -9,7 +9,7 @@ import { PlusOutlined, UploadOutlined, CloseOutlined } from '@ant-design/icons';
class Uploads extends Component {
constructor(props) {
super(props);
this.ApiRoot = API_ROOT
this.ApiRoot = FS_API_ROOT
this.state = {
fileUploading: false,
fileList: [],
@ -109,10 +109,10 @@ class Uploads extends Component {
video: ['mp4']
};
/**
* uploadType string 主要区别文件上传路径 以及类型 web/routes/attachment/index.js UploadPath key 值为准默认 project
* uploadType string 主要区别文件上传路径 以及类型 web/routes/attachment/index.js UploadPath key 值为准;默认 project;
* disabled boolean 上传是否可用
* maxFilesNum number 最大上传数量
* fileTypes array[string] 可允许上传的文件类型
* fileTypes array[string] 可允许上传的文件类型;
* maxFileSize number 单个文件最大大小 M
* listType antd upload 组件的属性
* onChange function 文件数量变化时候回调 返回文件
@ -149,13 +149,13 @@ class Uploads extends Component {
return false;
}
if (file.name.length > 60) {
message.warning(`文件名过长(大于60字符)请修改后上传`);
message.warning(`文件名过长(大于60字符),请修改后上传`);
return false;
}
const extNames = file.name.split('.');
var reg = /^[\.\s\u4e00-\u9fa5a-zA-Z0-9_-]{0,}$/;
if (!reg.exec(file.name)) {
message.warning(`文件名包含除字母、汉字、数字、中划线、下划线之外的字符请修改后上传`);
message.warning(`文件名包含除字母、汉字、数字、中划线、下划线之外的字符,请修改后上传`);
return false;
}
let isDAE = false;
@ -210,7 +210,7 @@ class Uploads extends Component {
that.setState({
fileUploading: false
});
message.error(`${info.file.name} 上传失败请重试`);
message.error(`${info.file.name} 上传失败,请重试`);
if (onStateChange) {
onStateChange({ uploading: false });
}

2
web/client/src/index.js

@ -4,4 +4,4 @@ import React from 'react';
import { render } from 'react-dom';
import App from './app';
render((<App projectName="项目运管调度平台" />), document.getElementById('App'));
render((<App projectName="政务数据资源中心" />), document.getElementById('App'));

2
web/client/src/layout/components/header/index.js

@ -39,7 +39,7 @@ const Header = props => {
}
</span>
<div className={styles['header-title']} style={{}}>
<img src='/assets/images/logo.png' style={{ margin: '0 12px 4px 12px', height: 42, borderRadius: 4 }} />项目运管调度平台
<img src='/assets/images/logo.png' style={{ margin: '0 12px 4px 12px', height: 42, borderRadius: 4 }} />政务数据资源中心
</div>
</div>
<div id="nav" className={styles['header-nav']}>

4
web/client/src/layout/containers/layout/breadcrumb.js

@ -11,7 +11,7 @@ const Breadcrumbs = (props) => {
return (
<Breadcrumb separator="/" style={{ height: 25 }}>
{
breadcrumbs.map((bc, index) => {
breadcrumbs.filter(bc => bc.key != '/metadataManagement/latestMetadata/detail').map((bc, index) => {
return (
<Breadcrumb.Item key={index}>
{
@ -34,7 +34,7 @@ const Breadcrumbs = (props) => {
</Breadcrumb>
)
});
return (
<Bread />
);

4
web/client/src/layout/containers/layout/index.js

@ -66,7 +66,7 @@ const LayoutContainer = props => {
dom.scrollTop = 0;
}
})
console.log(API_ROOT);
console.log(FS_API_ROOT);
return (
<Layout id="layout">
<Layout.Header style={{ padding: 0 }}>
@ -115,7 +115,7 @@ const LayoutContainer = props => {
)
}
function mapStateToProps (state) {
function mapStateToProps(state) {
const { global, auth, ajaxResponse } = state;
return {
title: global.title,

3
web/client/src/sections/auth/containers/login.js

@ -116,7 +116,7 @@ const Login = props => {
justifyContent: 'space-around'
}}>
<p style={{ fontSize: 30, fontWeight: 'bold', textAlign: 'center' }}>
项目运管调度平台
政务数据资源中心
</p>
<Tabs defaultActiveKey="1" animated={true} onChange={(k) => {
setCurTabKey(k)
@ -250,7 +250,6 @@ const Login = props => {
function mapStateToProps(state) {
const { auth } = state;
console.log(auth.error);
return {
user: auth.user,
error: auth.error,

6
web/client/src/sections/homePage/nav-item.js

@ -1,10 +1,10 @@
import React from 'react';
import { Link } from 'react-router-dom';
import { Menu } from 'antd';
import { BarChartOutlined } from '@ant-design/icons';
export function getNavItem () {
import { HomeOutlined } from '@ant-design/icons';
export function getNavItem() {
return (
<Menu.Item key="homePage" icon={<BarChartOutlined />}>
<Menu.Item key="homePage" icon={<HomeOutlined />}>
<Link to="/homePage">首页</Link>
</Menu.Item>
);

15
web/client/src/sections/metadataAcquisition/actions/example.js

@ -0,0 +1,15 @@
'use strict';
import { basicAction } from '@peace/utils'
import { ApiTable } from '$utils'
// export function getMembers(orgId) {
// return dispatch => basicAction({
// type: 'get',
// dispatch: dispatch,
// actionType: 'GET_MEMBERS',
// url: `${ApiTable.getEnterprisesMembers.replace('{enterpriseId}', orgId)}`,
// msg: { error: '获取用户列表失败' },
// reducer: { name: 'members' }
// });
// }

7
web/client/src/sections/metadataAcquisition/actions/index.js

@ -0,0 +1,7 @@
'use strict';
import * as example from './example'
export default {
...example,
}

7
web/client/src/sections/metadataAcquisition/containers/acquisitionLog.js

@ -0,0 +1,7 @@
import React, { useEffect, useState } from 'react'
function AcquisitionLog (props) {
return <>采集日志</>
}
export default AcquisitionLog

7
web/client/src/sections/metadataAcquisition/containers/acquisitionTask.js

@ -0,0 +1,7 @@
import React, { useEffect, useState } from 'react'
function AcquisitionTask (props) {
return <>采集任务配置</>
}
export default AcquisitionTask

7
web/client/src/sections/metadataAcquisition/containers/adapter.js

@ -0,0 +1,7 @@
import React, { useEffect, useState } from 'react'
function Adapter (props) {
return <>适配器管理</>
}
export default Adapter

7
web/client/src/sections/metadataAcquisition/containers/dataSourceManagement.js

@ -0,0 +1,7 @@
import React, { useEffect, useState } from 'react'
function MetadataDetails (props) {
return <>数据源管理</>
}
export default MetadataDetails

8
web/client/src/sections/metadataAcquisition/containers/index.js

@ -0,0 +1,8 @@
'use strict';
import Adapter from './adapter';
import DataSourceManagement from './dataSourceManagement';
import AcquisitionTask from './acquisitionTask';
import AcquisitionLog from './acquisitionLog';
export { Adapter, DataSourceManagement, AcquisitionTask, AcquisitionLog };

15
web/client/src/sections/metadataAcquisition/index.js

@ -0,0 +1,15 @@
'use strict';
import reducers from './reducers';
import routes from './routes';
import actions from './actions';
import { getNavItem } from './nav-item';
export default {
key: 'metadataAcquisition',
name: '元数据采集',
reducers: reducers,
routes: routes,
actions: actions,
getNavItem: getNavItem
};

24
web/client/src/sections/metadataAcquisition/nav-item.js

@ -0,0 +1,24 @@
import React from 'react';
import { Link } from 'react-router-dom';
import { Menu } from 'antd';
import { BarChartOutlined } from '@ant-design/icons';
const SubMenu = Menu.SubMenu;
export function getNavItem() {
return (
<SubMenu key="metadataAcquisition" icon={<BarChartOutlined />} title='元数据采集'>
<Menu.Item key="Adapter">
<Link to="/metadataAcquisition/Adapter">适配器管理</Link>
</Menu.Item>
<Menu.Item key="dataSourceManagement">
<Link to="/metadataAcquisition/dataSourceManagement">数据源管理</Link>
</Menu.Item>
<Menu.Item key="acquisitionTask">
<Link to="/metadataAcquisition/acquisitionTask">采集任务配置</Link>
</Menu.Item>
<Menu.Item key="acquisitionLog">
<Link to="/metadataAcquisition/acquisitionLog">采集日志</Link>
</Menu.Item>
</ SubMenu >
);
}

5
web/client/src/sections/metadataAcquisition/reducers/index.js

@ -0,0 +1,5 @@
'use strict';
export default {
}

32
web/client/src/sections/metadataAcquisition/routes.js

@ -0,0 +1,32 @@
'use strict';
import { Adapter, DataSourceManagement, AcquisitionTask, AcquisitionLog } from './containers';
export default [{
type: 'inner',
route: {
path: '/metadataAcquisition',
key: 'metadataAcquisition',
breadcrumb: '元数据采集',
// 不设置 component 则面包屑禁止跳转
childRoutes: [{
path: '/adapter',
key: 'adapter',
component: Adapter,
breadcrumb: '适配器管理'
}, {
path: '/dataSourceManagement',
key: 'dataSourceManagement',
component: DataSourceManagement,
breadcrumb: '数据源管理'
}, {
path: '/acquisitionTask',
key: 'acquisitionTask',
component: AcquisitionTask,
breadcrumb: '采集任务配置'
}, {
path: '/acquisitionLog',
key: 'acquisitionLog',
component: AcquisitionLog,
breadcrumb: '采集日志'
}]
}
}];

15
web/client/src/sections/metadataManagement/actions/example.js

@ -0,0 +1,15 @@
'use strict';
import { basicAction } from '@peace/utils'
import { ApiTable } from '$utils'
// export function getMembers(orgId) {
// return dispatch => basicAction({
// type: 'get',
// dispatch: dispatch,
// actionType: 'GET_MEMBERS',
// url: `${ApiTable.getEnterprisesMembers.replace('{enterpriseId}', orgId)}`,
// msg: { error: '获取用户列表失败' },
// reducer: { name: 'members' }
// });
// }

7
web/client/src/sections/metadataManagement/actions/index.js

@ -0,0 +1,7 @@
'use strict';
import * as example from './example'
export default {
...example,
}

7
web/client/src/sections/metadataManagement/containers/businessMetadata.js

@ -0,0 +1,7 @@
import React, { useEffect, useState } from 'react'
function BusinessMetadata (props) {
return <>业务元数据管理</>
}
export default BusinessMetadata

9
web/client/src/sections/metadataManagement/containers/index.js

@ -0,0 +1,9 @@
'use strict';
import LatestMetadata from './latestMetadata';
import BusinessMetadata from './businessMetadata';
import MetaModelManagement from './metaModelManagement';
import TagManagement from './tagManagement';
import MetadataDetails from './metadataDetails';
export { LatestMetadata, BusinessMetadata, MetaModelManagement, TagManagement, MetadataDetails };

24
web/client/src/sections/metadataManagement/containers/latestMetadata.js

@ -0,0 +1,24 @@
import React, { useEffect, useState } from 'react';
import { connect } from 'react-redux';
import { Button, } from 'antd'
const LatestMetadata = (props) => {
const { user, dispatch, actions, history } = props;
useEffect(() => {
}, [])
return <>最新元数据
<Button type="primary" onClick={() => { history.push(`/metadataManagement/latestMetadata/detail/${1}`) }} >查看详情</Button>
</>
}
function mapStateToProps(state) {
const { global, auth } = state;
return {
clientHeight: global.clientHeight,
user: auth.user,
actions: global.actions,
};
}
export default connect(mapStateToProps)(LatestMetadata)

7
web/client/src/sections/metadataManagement/containers/metaModelManagement.js

@ -0,0 +1,7 @@
import React, { useEffect, useState } from 'react'
function MetaModelManagement (props) {
return <>模型管理</>
}
export default MetaModelManagement

7
web/client/src/sections/metadataManagement/containers/metadataDetails.js

@ -0,0 +1,7 @@
import React, { useEffect, useState } from 'react'
function MetadataDetails (props) {
return <>元数据详情</>
}
export default MetadataDetails

7
web/client/src/sections/metadataManagement/containers/tagManagement.js

@ -0,0 +1,7 @@
import React, { useEffect, useState } from 'react'
function TagManagement (props) {
return <>标签管理</>
}
export default TagManagement

15
web/client/src/sections/metadataManagement/index.js

@ -0,0 +1,15 @@
'use strict';
import reducers from './reducers';
import routes from './routes';
import actions from './actions';
import { getNavItem } from './nav-item';
export default {
key: 'metadataManagement',
name: '元数据管理',
reducers: reducers,
routes: routes,
actions: actions,
getNavItem: getNavItem
};

24
web/client/src/sections/metadataManagement/nav-item.js

@ -0,0 +1,24 @@
import React from 'react';
import { Link } from 'react-router-dom';
import { Menu } from 'antd';
import { SettingOutlined } from '@ant-design/icons';
const SubMenu = Menu.SubMenu;
export function getNavItem() {
return (
<SubMenu key="metadataManagement" icon={<SettingOutlined />} title='元数据管理'>
<Menu.Item key="latestMetadata">
<Link to="/metadataManagement/latestMetadata">最新元数据</Link>
</Menu.Item>
<Menu.Item key="businessMetadata">
<Link to="/metadataManagement/businessMetadata">业务元数据管理</Link>
</Menu.Item>
<Menu.Item key="metaModelManagement">
<Link to="/metadataManagement/metaModelManagement">模型管理</Link>
</Menu.Item>
<Menu.Item key="tagManagement">
<Link to="/metadataManagement/tagManagement">标签管理</Link>
</Menu.Item>
</ SubMenu >
);
}

5
web/client/src/sections/metadataManagement/reducers/index.js

@ -0,0 +1,5 @@
'use strict';
export default {
}

38
web/client/src/sections/metadataManagement/routes.js

@ -0,0 +1,38 @@
'use strict';
import { LatestMetadata, BusinessMetadata, MetaModelManagement, TagManagement, MetadataDetails } from './containers';
export default [{
type: 'inner',
route: {
path: '/metadataManagement',
key: 'metadataManagement',
breadcrumb: '元数据管理',
// 不设置 component 则面包屑禁止跳转
childRoutes: [{
path: '/latestMetadata',
key: 'latestMetadata',
component: LatestMetadata,
breadcrumb: '最新元数据',
childRoutes: [{
path: '/detail/:id',
key: 'detail',
component: MetadataDetails,
breadcrumb: '元数据详情'
}]
}, {
path: '/businessMetadata',
key: 'businessMetadata',
component: BusinessMetadata,
breadcrumb: '业务元数据管理'
}, {
path: '/metaModelManagement',
key: 'metaModelManagement',
component: MetaModelManagement,
breadcrumb: '模型管理'
}, {
path: '/tagManagement',
key: 'tagManagement',
component: TagManagement,
breadcrumb: '标签管理'
}]
}
}];

15
web/client/src/sections/resourceConsumption/actions/example.js

@ -0,0 +1,15 @@
'use strict';
import { basicAction } from '@peace/utils'
import { ApiTable } from '$utils'
// export function getMembers(orgId) {
// return dispatch => basicAction({
// type: 'get',
// dispatch: dispatch,
// actionType: 'GET_MEMBERS',
// url: `${ApiTable.getEnterprisesMembers.replace('{enterpriseId}', orgId)}`,
// msg: { error: '获取用户列表失败' },
// reducer: { name: 'members' }
// });
// }

7
web/client/src/sections/resourceConsumption/actions/index.js

@ -0,0 +1,7 @@
'use strict';
import * as example from './example'
export default {
...example,
}

7
web/client/src/sections/resourceConsumption/containers/approve.js

@ -0,0 +1,7 @@
import React, { useEffect, useState } from 'react'
function Approve (props) {
return <>数据消费审批</>
}
export default Approve

6
web/client/src/sections/resourceConsumption/containers/index.js

@ -0,0 +1,6 @@
'use strict';
import Approve from './approve';
import MyApplication from './myApplication';
export { Approve, MyApplication };

7
web/client/src/sections/resourceConsumption/containers/myApplication.js

@ -0,0 +1,7 @@
import React, { useEffect, useState } from 'react'
function MyApplication (props) {
return <>我的数据消费申请</>
}
export default MyApplication

15
web/client/src/sections/resourceConsumption/index.js

@ -0,0 +1,15 @@
'use strict';
import reducers from './reducers';
import routes from './routes';
import actions from './actions';
import { getNavItem } from './nav-item';
export default {
key: 'resourceConsumption',
name: '资源消费',
reducers: reducers,
routes: routes,
actions: actions,
getNavItem: getNavItem
};

18
web/client/src/sections/resourceConsumption/nav-item.js

@ -0,0 +1,18 @@
import React from 'react';
import { Link } from 'react-router-dom';
import { Menu } from 'antd';
import { CarryOutOutlined } from '@ant-design/icons';
const SubMenu = Menu.SubMenu;
export function getNavItem() {
return (
<SubMenu key="resourceConsumption" icon={<CarryOutOutlined />} title='资源消费'>
<Menu.Item key="approve">
<Link to="/resourceConsumption/approve">数据消费审批</Link>
</Menu.Item>
<Menu.Item key="myApplication">
<Link to="/resourceConsumption/myApplication">我的数据消费申请</Link>
</Menu.Item>
</ SubMenu >
);
}

5
web/client/src/sections/resourceConsumption/reducers/index.js

@ -0,0 +1,5 @@
'use strict';
export default {
}

22
web/client/src/sections/resourceConsumption/routes.js

@ -0,0 +1,22 @@
'use strict';
import { Approve, MyApplication } from './containers';
export default [{
type: 'inner',
route: {
path: '/resourceConsumption',
key: 'resourceConsumption',
breadcrumb: '资源消费',
// 不设置 component 则面包屑禁止跳转
childRoutes: [{
path: '/approve',
key: 'approve',
component: Approve,
breadcrumb: '数据消费审批'
}, {
path: '/myApplication',
key: 'myApplication',
component: MyApplication,
breadcrumb: '我的数据消费申请'
}]
}
}];

15
web/client/src/sections/resourceRetrieval/actions/example.js

@ -0,0 +1,15 @@
'use strict';
import { basicAction } from '@peace/utils'
import { ApiTable } from '$utils'
// export function getMembers(orgId) {
// return dispatch => basicAction({
// type: 'get',
// dispatch: dispatch,
// actionType: 'GET_MEMBERS',
// url: `${ApiTable.getEnterprisesMembers.replace('{enterpriseId}', orgId)}`,
// msg: { error: '获取用户列表失败' },
// reducer: { name: 'members' }
// });
// }

7
web/client/src/sections/resourceRetrieval/actions/index.js

@ -0,0 +1,7 @@
'use strict';
import * as example from './example'
export default {
...example,
}

4
web/client/src/sections/resourceRetrieval/containers/index.js

@ -0,0 +1,4 @@
'use strict';
import Retrieval from './retrieval';
export { Retrieval };

7
web/client/src/sections/resourceRetrieval/containers/retrieval.js

@ -0,0 +1,7 @@
import React, { useEffect, useState } from 'react'
function Retrieval (props) {
return <>数据资源检索</>
}
export default Retrieval

15
web/client/src/sections/resourceRetrieval/index.js

@ -0,0 +1,15 @@
'use strict';
import reducers from './reducers';
import routes from './routes';
import actions from './actions';
import { getNavItem } from './nav-item';
export default {
key: 'resourceRetrieval',
name: '资源检索',
reducers: reducers,
routes: routes,
actions: actions,
getNavItem: getNavItem
};

12
web/client/src/sections/resourceRetrieval/nav-item.js

@ -0,0 +1,12 @@
import React from 'react';
import { Link } from 'react-router-dom';
import { Menu } from 'antd';
import { FileSearchOutlined } from '@ant-design/icons';
export function getNavItem() {
return (
<Menu.Item key="resourceRetrieval" icon={<FileSearchOutlined />}>
<Link to="/resourceRetrieval">资源检索</Link>
</Menu.Item>
);
}

5
web/client/src/sections/resourceRetrieval/reducers/index.js

@ -0,0 +1,5 @@
'use strict';
export default {
}

11
web/client/src/sections/resourceRetrieval/routes.js

@ -0,0 +1,11 @@
'use strict';
import { Retrieval } from './containers';
export default [{
type: 'inner',
route: {
path: '/resourceRetrieval',
key: 'resourceRetrieval',
breadcrumb: '资源消费',
component: Retrieval
}
}];

16
web/config.js

@ -10,8 +10,7 @@ const os = require('os');
const moment = require('moment');
const args = require('args');
const dev = process.env.NODE_ENV == 'development';
dev && console.log('\x1B[33m%s\x1b[0m', '请遵循并及时更新 readme.md,维护良好的开发环境,媛猿有责');
dev && console.log('\x1B[33m%s\x1b[0m', '请遵循并及时更新 readme.md,维护良好的开发环境,媛猿有责');
// // 启动参数
args.option(['p', 'port'], '启动端口');
args.option(['u', 'api-url'], 'webapi的URL');
@ -41,7 +40,7 @@ if (
// || !ANXINCLOUD_QINIU_BUCKET_RESOURCE
// || !ANXINCLOUD_QINIU_DOMAIN_QNDMN_RESOURCE
) {
console.log('缺少启动参数异常退出');
console.log('缺少启动参数,异常退出');
args.showHelp();
process.exit(-1);
}
@ -51,7 +50,7 @@ const product = {
staticDirs: [path.join(__dirname, './client')],
frontParams: {
// 以大写字母命名
API_ROOT: FS_UNIAPP_API
FS_API_ROOT: FS_UNIAPP_API
},
mws: [
{
@ -116,6 +115,15 @@ const product = {
maxRetries: 1
}
};
if (product.frontParams) {
const patt = /[^A-Z|_]+/
for (let k in product.frontParams) {
if (!k.startsWith('FS_') || patt.test(k)) {
console.warn(`参数 ${k} 当以大写字母和下划线组成 且以 FS_ 开头`);
process.exit(-1);
}
}
}
let config;
if (dev) {

12
web/routes/attachment/index.js

@ -172,12 +172,12 @@ module.exports = {
const filename = file.filename || path.basename(file);
const client = new OSS({
// yourRegion填写Bucket所在地域。以华东1(杭州)为例,Region填写为oss-cn-hangzhou。
// yourRegion填写Bucket所在地域.以华东1(杭州)为例,Region填写为oss-cn-hangzhou.
region: aliOss.region,
// 阿里云账号AccessKey拥有所有API的访问权限,风险很高。强烈建议您创建并使用RAM用户进行API访问或日常运维,请登录RAM控制台创建RAM用户。
// 阿里云账号AccessKey拥有所有API的访问权限,风险很高.强烈建议您创建并使用RAM用户进行API访问或日常运维,请登录RAM控制台创建RAM用户.
accessKeyId: aliOss.accessKey,
accessKeySecret: aliOss.secretKey,
// 填写Bucket名称,例如examplebucket。
// 填写Bucket名称,例如examplebucket.
bucket: aliOss.bucket,
});
@ -206,12 +206,12 @@ module.exports = {
const { aliOss } = opts
const { path, filename } = ctx.query
const client = new OSS({
// yourRegion填写Bucket所在地域。以华东1(杭州)为例,Region填写为oss-cn-hangzhou。
// yourRegion填写Bucket所在地域.以华东1(杭州)为例,Region填写为oss-cn-hangzhou.
region: aliOss.region,
// 阿里云账号AccessKey拥有所有API的访问权限,风险很高。强烈建议您创建并使用RAM用户进行API访问或日常运维,请登录RAM控制台创建RAM用户。
// 阿里云账号AccessKey拥有所有API的访问权限,风险很高.强烈建议您创建并使用RAM用户进行API访问或日常运维,请登录RAM控制台创建RAM用户.
accessKeyId: aliOss.accessKey,
accessKeySecret: aliOss.secretKey,
// 填写Bucket名称,例如examplebucket。
// 填写Bucket名称,例如examplebucket.
bucket: aliOss.bucket,
});

Loading…
Cancel
Save