sxfad / react-admin Goto Github PK
View Code? Open in Web Editor NEW基于 Ant Design React 的管理系统架构
Home Page: https://sxfad.github.io/react-admin
基于 Ant Design React 的管理系统架构
Home Page: https://sxfad.github.io/react-admin
当打开为二级页面时,刷新浏览器为什么路由会作为一个接口调用呢?
http://localhost:4001/house/_/edit/48
Request Method: GET
Status Code: 200 OK
请问一下,Mock是怎么使用的?文档中写的没怎么看懂。比如说我需要添加一个页面,对应的path为/user/userlist,我想mock一下对应的json数据。
通过configureStore().getState获取到的数据没变化,支持js文件与redux交互吗?
你好,大大,请问下拖动表格支持树形结构如何实现呢
react前端小白望解答下
当前缺省的端口配置是Mysql,不知道是否可以支持Postgres数据库?
1.我在发送请求的时候,根据返回的状态码判断token(会话)是否过期,直接跳转到登录页
,再次登录的时候,就会出现第一个页签就是URL 就是‘/login’ ,却保留了原来保持打开的页签。一共两个标签页,而不是保持原来之前打开多个菜单页签的状态了。经查验loacalstorage 中就保留两个页签,其中一个是登录页(空白页签)
2.本地的loacalstorage是怎么写进去的,我找好久的代码,其中[object Object]-system,[object Object]-menu,[object Object]-side 不知道从那个代码片段写进去的,超时的时候,我想通过这改变这个能改善上诉的问题吗,再次登录保留原来打开的页签,完全退出系统的时候,再次登录不保留当时打开的页签或者也可以保留原来页签。
follow the step:
(1) yarn
(2) yarn start
then the problem shows:
Browserslist: caniuse-lite is outdated. Please run next command yarn upgrade caniuse-lite browserslist
the port 4001 can not be visited
您好,请问如何打包发布,通过build指令打包后 总是找不到login页面,这个是什么原因呢?
多个菜单指向一个页面(组件)
http-proxy-middleware 版本: ^1.0.6 (自己 npm install --save-dev http-proxy-middleware添加的)
setupProxy.js配置
const {createProxyMiddleware} = require('http-proxy-middleware')
const prefix = process.env.AJAX_PREFIX || '/api/fv-admin'
console.info('代理相关', prefix)
module.exports = function (app) {
app.use(createProxyMiddleware(
prefix,
{
target: 'http://localhost:8080/',
pathRewrite: {
'/api': '', // 如果后端接口无前缀,可以通过这种方式去掉
},
changeOrigin: true,
secure: false, // 是否验证证书
ws: true, // 启用websocket
},
))
}
ajax请求
let {pageNum, pageSize} = this.state
this.props.ajax
.get(`/goods/sys-goods/list?currentPage=${pageNum}&offset=${pageSize}`)
.then(res => {
console.log(res)
})
项目启动控制台
实际结果
疑问
代理配置没生效还是怎么回事。。。前端小白,不知如何下手。不用react-admin的时候,这样的配置可以代理成功。react-admin里的东西太多了,还没学完,碰到了这么一个问题,一直没解决。。。还请指点一下
Fatal error in , line 0
#FailureMessage Object: 000000000014D9E0npm ERR! code ELIFECYCLE
npm ERR! errno 3221225477
npm ERR! [email protected] start: node scripts/start.js
npm ERR! Exit status 3221225477
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache_logs\2021-01-15T08_01_20_092Z-debug.log
目前不在menus.js里配置,可实现不显示。但通过上边tabs切换已打开的页面,没有在menus.js里配置的页面,需要点击2次才能切换
请问一下,我新增了一个页面,远端服务器模拟了数据,我修改了setupProxy.js:
mock url为:http://yapi.aeasycredit.net/mock/32/api/loanAccountList
但console中报这个错误,是不是哪个地方需要配置权限?
谢谢~
<QueryItem
collapsed={collapsed}
loadOptions={this.fetchOptions}
items={this.queryItems}
onSubmit={params => this.setState({ params }, this.handleSearch)}
extra={<Button type="primary" icon="user-add" onClick={this.handleAdd}>添加客户</Button>,
<Button type="primary" icon="user-del" onClick={this.handleBatchDel}>批量删除客户</Button>
}
/>
这个代码块都是显示“批量删除客户”按钮,不显示前面一个。
问下这边我iis发布会,总是无法跨域访问后台接口,前端代码中需要哪里做配置吗
dom:
使用yarn安装依赖时发生HTTP 500错误,国内网络,国外代理均出现此现象
yarn-error.log
您好 我想咨询一下为什么每个页面请求都会请求两次?我请求的时候带参数的,但是我点开页面的时候一个同一个接口请求两次一个带参数,一个不带参数? 这是什么原因造成的,是需要哪里配置什么吗?
图片如下
不带参数:https://sm.ms/image/5THWdXONRahESYg
带参数:https://sm.ms/image/1mSI9sXcLOZJRib
在最新拉取的代码中。没有代码生成相关的页面,
请问是剔除了吗?
你好,之前基于ant design pro做了几个页面,继续再做多页面的时候,发现您做的效果很棒,于是想把做好的页面迁移过来。
请问,是否可以直接引入dav并使用?
我尝试了:
`@connect(({ admin, loading }) => ({
admin,
loading: loading.effects['admin/list'],
}))
@config({
path: '/system/BGroup/',
ajax: true,
})
@Form.create()
class TableList extends PureComponent {
...
componentDidMount() {
// console.log(this.dispatch,'hahahah')
// const { dispatch } = this.props;
dispatch({
type: 'admin/list',
});
}
...
却不能运行, 报错内容:
TypeError: subscriber is undefined
dispatch
C:/Users/Lenovo/AppData/Local/Microsoft/TypeScript/3.6/node_modules/rxjs/internal/observable/pairs.js:51
48 | subscription = state.subscription,
49 | obj = state.obj;
50 |
51 | if (!subscriber.closed) {
| ^ 52 | if (index < keys.length) {
53 | var key = keys[index];
54 | subscriber.next([key, obj[key]]);
`
Creating an optimized production build... Browserslist: caniuse-lite is outdated. Please run next command
yarn upgrade
单独定义action 和 reducer,这个可以和现有的redux结合起来使用吗?有demo吧?
请问,异步加载菜单的方法里面该如何引入ajax请求后端菜单?
使用文档中推荐的三种方式,都会报错,只能使用在class上面?
BASE_NAME=/project1 PUBLIC_URL=/project1 yarn build
build目录下没有project1文件夹
1、yarn & yarn start 报错
./src/pages/page-routes.js
Module not found: You attempted to import /Users/wangshubin/workspace/suixingpay/application-dependency/admin-front/src/pages/home/index.jsx which falls outside of the project src/ directory. Relative imports outside of src/ are not supported.
2、手动修改./src/pages/page-routes.js 进入页面,单点击左侧导航菜单,所有路由按钮点击均是404错误页面
大神,请问下从用户列表如何进入edit详情界面,我在Table组件上加上onRow对象新增toEdit(record)方法,在此方法中我该如何实现路由跳转进入到edit界面
Starting the development server...
Browserslist: caniuse-lite is outdated. Please run next command yarn upgrade caniuse-lite browserslist
error Command failed with signal "SIGKILL".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
我在package.ison添加了"homepage": ".",然后yarn build,打包到线上会显示404组件
怎么添加文件上传组件 upload
大佬演示正常为啥下载的有问题
react-admin/scripts/generator/service/index.js第二行应该为引入postgre-sql.js
使用yarn 安装包后,yarn start 没有问题
但是使用npm install 安装的包,antd的Tabs样式错乱。
望解答下
书写的less文件样式,不支持浏览器前缀自动补全,如
下面代码为less文件
.sideContent { flex: 1; }
下面代码为编译后的css
.sideContent { flex: 1; }
没有自动添加浏览器前缀-web-kit.....
设置页面 点击页面保持,然后再次点击页面保持 会有bug
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.