Giter Site home page Giter Site logo

rap2-dolores's People

Contributors

502647092 avatar bosn avatar dependabot[bot] avatar ganl avatar ofloxacin avatar xalexec avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rap2-dolores's Issues

登录首页卡住,打开F12报错如下

image

复制代码如下:
uncaught at e Invariant Violation: Minified React error #105; visit http://facebook.github.io/react/docs/error-decoder.html?invariant=105&args[]=f for the full message or use the non-minified dev environment for full errors and additional helpful warnings. at n (http://172.17.8.221:8882/static/js/main.e1326e3e.js:2:27786) at d.mountComponent (http://172.17.8.221:8882/static/js/main.e1326e3e.js:40:3767) at Object.mountComponent (http://172.17.8.221:8882/static/js/main.e1326e3e.js:7:17346) at mountChildren (http://172.17.8.221:8882/static/js/main.e1326e3e.js:41:3240) at m._createInitialChildren (http://172.17.8.221:8882/static/js/main.e1326e3e.js:40:17911) at mountComponent (http://172.17.8.221:8882/static/js/main.e1326e3e.js:40:16055) at Object.mountComponent (http://172.17.8.221:8882/static/js/main.e1326e3e.js:7:17346) at mountChildren (http://172.17.8.221:8882/static/js/main.e1326e3e.js:41:3240) at m._createInitialChildren (http://172.17.8.221:8882/static/js/main.e1326e3e.js:40:17911) at mountComponent (http://172.17.8.221:8882/static/js/main.e1326e3e.js:40:16055)

npm install报错

Binary has a problem: Error: \?\E:\rap2\rap2-dolores\node_modules\node-sass\vendor\win32-x64-57\binding.node is not a valid Win32 application.
\?\E:\rap2\rap2-dolores\node_modules\node-sass\vendor\win32-x64-57\binding.node

Nginx关于后端接口跨域配置问题

前后端代码clone编译之后localhost访问并没有问题,换成ip访问会有跨域问题,所以使用Nginx代理。
修改了config.prod.js

module.exports = {
  serve: '/apis',
  keys: ['some secret hurr'],
  session: {
    key: 'koa:sess'
  }
}

Nginx的配置如下


worker_processes  1;

error_log  logs/error.log debug;
events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on; 
    keepalive_timeout  65;

    server {
        listen       80;
        server_name  192.168.80.1;
		root 	/rap2/rap2-dolores/build;
		location / {
		  try_files $uri /index.html;
		}		
		location /apis {
			rewrite  ^.+apis/?(.*)$ /$1 break;
			proxy_pass   http://localhost:8080;
		}		
    } 

}

后端接口代理到http://localhost:8080
然鹅访问时却是这样的
_20180212123551
第一个接口成功,第二个404,第三个405
有时刷新还会是这样的
qq 20180212124231
第一个接口都404
问:官方有Nginx的标准配置方案么?

点击列出所有仓库会卡主,后端日志报错如下

<-- GET /account/info
SELECT id, fullname, email FROM Users AS User WHERE ((User.deletedAt > '2018-04-27 04:03:05' OR User.deletedAt IS NULL) AND User.id = 100000012); ===========
--> GET /account/info 200 16ms 84b
<-- GET /app/counter
--> GET /app/counter 200 2ms 71b
<-- GET /repository/list?user=&organization=&name=&cursor=1&limit=100

  SELECT COUNT(id) AS num FROM (
    SELECT o.id, o.name
    FROM Organizations o
    WHERE visibility = 1 OR creatorId = 100000012 OR ownerId = 100000012
    UNION
    SELECT o.id, o.name
    FROM Organizations o
    JOIN organizations_members om ON o.id = om.organizationId
    WHERE om.userId = 100000012
  ) as result
  WHERE id =
 ===========

Unhandled rejection SequelizeDatabaseError: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 7
at Query.formatError (/root/rap2-delos/node_modules/sequelize/lib/dialects/mysql/query.js:250:16)
at Query.handler [as onResult] (/root/rap2-delos/node_modules/sequelize/lib/dialects/mysql/query.js:68:23)
at Query.Command.execute (/root/rap2-delos/node_modules/mysql2/lib/commands/command.js:30:12)
at Connection.handlePacket (/root/rap2-delos/node_modules/mysql2/lib/connection.js:504:28)
at PacketParser.onPacket (/root/rap2-delos/node_modules/mysql2/lib/connection.js:82:13)
at PacketParser.executeStart (/root/rap2-delos/node_modules/mysql2/lib/packet_parser.js:77:14)
at Socket. (/root/rap2-delos/node_modules/mysql2/lib/connection.js:91:29)
at Socket.emit (events.js:180:13)
at addChunk (_stream_readable.js:269:12)
at readableAddChunk (_stream_readable.js:256:11)
at Socket.Readable.push (_stream_readable.js:213:10)
at TCP.onread (net.js:578:20)
From previous event:
at Query.run (/root/rap2-delos/node_modules/sequelize/lib/dialects/mysql/query.js:57:12)
at Promise.try.then.connection (/root/rap2-delos/node_modules/sequelize/lib/sequelize.js:558:20)
at runCallback (timers.js:763:18)
at tryOnImmediate (timers.js:734:5)
at processImmediate (timers.js:716:5)
From previous event:
at retryParameters (/root/rap2-delos/node_modules/sequelize/lib/sequelize.js:555:8)
at /root/rap2-delos/node_modules/retry-as-promised/index.js:39:21
at retryAsPromised (/root/rap2-delos/node_modules/retry-as-promised/index.js:29:10)
at Sequelize.query (/root/rap2-delos/node_modules/sequelize/lib/sequelize.js:454:12)
at resolve (/root/rap2-delos/dist/service/organization.js:20:33)
at new Promise ()
at Function.canUserAccessOrganization (/root/rap2-delos/dist/service/organization.js:19:16)
at Function. (/root/rap2-delos/dist/routes/utils/access.js:22:53)
at Generator.next ()
at /root/rap2-delos/dist/routes/utils/access.js:6:71
at new Promise ()
at __awaiter (/root/rap2-delos/dist/routes/utils/access.js:2:12)
at Function.canUserAccess (/root/rap2-delos/dist/routes/utils/access.js:20:16)
at Object. (/root/rap2-delos/dist/routes/repository.js:48:47)
at Generator.next ()
at /root/rap2-delos/dist/routes/repository.js:6:71
at new Promise ()
at __awaiter (/root/rap2-delos/dist/routes/repository.js:2:12)
at router_1.default.get (/root/rap2-delos/dist/routes/repository.js:45:51)
at dispatch (/root/rap2-delos/node_modules/koa-router/node_modules/koa-compose/index.js:44:32)
at next (/root/rap2-delos/node_modules/koa-router/node_modules/koa-compose/index.js:45:18)
at /root/rap2-delos/node_modules/koa-router/lib/router.js:346:16

sql是同事帮我打印出来的,好像是少了个id,但是没找到在哪儿配置。
帮忙解决一下3q =。=

更新仓库名 不成功

/repository/update

POST

{
  "creatorId": 100000000,
  "organizationId": null,
  "memberIds": [],
  "id": 15,
  "collaboratorIds": [],
  "description": "房地产",
  "ownerId": 100000000
}

是不是少了name

RAP2功能建议

我在使用RAP2功能的时候,确实感觉比原RAP好用不少。但也遇到了一些功能上的问题,

1.接口字段能否新增一列,标识该字段是否为必输字段;
2.数据类型能否增加数据长度限制的标注,如String(100)这种,表示最多只能输入100个字符长度的字符串;
3.现在生产的Mock数据都是Jason格式的,是否能够生成XML格式的?
4.修订日志目前只能定位到修改了哪个接口,是否能够精确定位到修改了具体的哪些内容?

目前就遇到以上问题,如果可以的话,我希望能够为RAP的功能开发出一份力。
祝,越做越好!
谢谢!

mock接口url拼接错误

定义地址为:/api/user/login
点击地址后,浏览器地址栏中的mock url为:http://xxx.xxx.xxx.xxx:8080/app/mock/11//api/user/login

mock url中,http://xxx.xxx.xxx.xxx:8080/app/mock/11//api/user/login的拼接没有考虑路径分隔符重复的问题。

无法导入JSON, 提示 Unexpected token I in JSON at position 0

JSON 如下

{
"code": "0",
"result": {
"data": [
{
"businessTypes": null,
"children": [],
"code": "10001",
"createDeptId": 0,
"createDeptName": "",
"createTime": 0,
"creatorId": 0,
"creatorName": "",
"description": "",
"district": "",
"fullName": "测试部门",
"id": 1,
"level": 1,
"name": "测试部门",
"parent": null,
"path": "abcd",
"roles": [],
"sortIndex": 1,
"status": 1,
"updateTime": 0,
"updaterId": null,
"updaterName": ""
},
{
"businessTypes": null,
"children": [],
"code": "1000101",
"createDeptId": 0,
"createDeptName": "",
"createTime": 0,
"creatorId": 0,
"creatorName": "",
"description": "",
"district": "",
"fullName": "测试部门-2",
"id": 2,
"level": 2,
"name": "测试部门-2",
"parent": null,
"path": "abcd-123",
"roles": [],
"sortIndex": 1,
"status": 1,
"updateTime": 0,
"updaterId": null,
"updaterName": ""
},
{
"businessTypes": "BRANCH_OFFICE",
"children": [],
"code": "320204000000",
"createDeptId": 2,
"createDeptName": "",
"createTime": 1525850865696,
"creatorId": 3,
"creatorName": "管理员",
"description": "",
"district": "1",
"fullName": "大队",
"id": 3,
"level": 1,
"name": "大队",
"parent": null,
"path": "nmu4",
"roles": [],
"sortIndex": 1,
"status": 1,
"updateTime": 1525850865696,
"updaterId": 3,
"updaterName": "管理员"
}
],
"pageNo": 0,
"pageSize": 25,
"total": 3,
"totalPages": 1
},
"status": 200,
"timestamp": 1525850935517
}

image

docker容器内部署delos模块在经过nginx反向代理后无法匹配接口

dolores模块页面访问正常,可以成功注册、登录,并可以进行接口新增和修改,但是请求接口时却无法匹配接口

请求例示 http://rest.mock.domain.com/app/mock/16/GET/example/1520095481062
返回结果如下
{
"isOk": false,
"errMsg": "未匹配到任何接口 No matched interface"
}

Docker容器使用官方镜像创建docker.io/node,映射内部8080端口
docker run -it -d -p 39999:8080 993f38da6c6c
直接使用node启动模块
docker exec -d 9603945a7fcd node /home/node/rap2-delos/dist/dispatch.js

反向代理匹配如下
server {
listen 80;
server_name rest.mock.domain.com;
location / {
proxy_pass http://127.0.0.1:39999;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}

dolores模块使用nginx单独部署
server {
listen 80;
server_name rap2.domain.com;
location / {
root /var/www/html/rap2;
index index.html;
}
}

Node Sass does not yet support your current environment: Linux 64-bit with Unsupported runtime (59)

@执行以下命令时报错[root@VM_217_200_centos config]# npm run test

[email protected] test /usr/local/rap2-dolores
npm run linter

[email protected] linter /usr/local/rap2-dolores
standard --fix

[root@VM_217_200_centos config]# npm run dev

[email protected] dev /usr/local/rap2-dolores
npm run start

[email protected] start /usr/local/rap2-dolores
npm-run-all -p watch-css start-js

[email protected] watch-css /usr/local/rap2-dolores
npm run build-css && node-sass src/ -o src/ --watch --recursive

[email protected] start-js /usr/local/rap2-dolores
react-scripts start

[email protected] build-css /usr/local/rap2-dolores
node-sass src/ -o src/

/usr/local/rap2-dolores/node_modules/node-sass/lib/binding.js:13
throw new Error(errors.unsupportedEnvironment());
^

Error: Node Sass does not yet support your current environment: Linux 64-bit with Unsupported runtime (59)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.5.3
at module.exports (/usr/local/rap2-dolores/node_modules/node-sass/lib/binding.js:13:13)
at Object. (/usr/local/rap2-dolores/node_modules/node-sass/lib/index.js:14:35)
at Module._compile (module.js:641:30)
at Object.Module._extensions..js (module.js:652:10)
at Module.load (module.js:560:32)
at tryModuleLoad (module.js:503:12)
at Function.Module._load (module.js:495:3)
at Module.require (module.js:585:17)
at require (internal/module.js:11:18)
at Object. (/usr/local/rap2-dolores/node_modules/node-sass/bin/node-sass:11:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build-css: node-sass src/ -o src/
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build-css 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! /root/.npm/_logs/2017-12-01T05_56_55_022Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] watch-css: npm run build-css && node-sass src/ -o src/ --watch --recursive
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] watch-css 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! /root/.npm/_logs/2017-12-01T05_56_55_043Z-debug.log
ERROR: "watch-css" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: npm-run-all -p watch-css start-js
npm ERR! Exit status 1
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! /root/.npm/_logs/2017-12-01T05_56_55_091Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dev: npm run start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] dev 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! /root/.npm/_logs/2017-12-01T05_56_55_111Z-debug.log

账号登出问题

账号的登出功能没有完成吗,我这边点击登出后账号并没有登出,只是响应的页面返回到了登录页面,我再点击头部菜单的时候就直接登上了我的账号。
004
002
003

nodejs 8.11.1部署失败

npm install之后会无限重复以下内容:

gyp verb install input version string "8.11.1"
gyp verb install installing version: 8.11.1
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 8.11.1
gyp verb ensuring nodedir is created /home/rap2-dolores/node_modules/node-sass/.node-gyp/8.11.1
gyp WARN EACCES user "root" does not have permission to access the dev dir "/home/rap2-dolores/node_modules/node-sass/.node-gyp/8.11.1"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/home/rap2-dolores/node_modules/node-sass/.node-gyp"
gyp verb tmpdir == cwd automatically will remove dev files after to save disk space
gyp verb command install [ '8.11.1' ]

ctrl+C强制结束后,重新npm install成功,但是npm run build报错如下:

fs.js:904
return binding.readdir(pathModule._makeLong(path), options.encoding);
^

Error: ENOENT: no such file or directory, scandir '/home/rap2-dolores/node_modules/node-sass/vendor'
at Object.fs.readdirSync (fs.js:904:18)
at Object.getInstalledBinaries (/home/rap2-dolores/node_modules/node-sass/lib/extensions.js:124:13)
at foundBinariesList (/home/rap2-dolores/node_modules/node-sass/lib/errors.js:20:15)
at foundBinaries (/home/rap2-dolores/node_modules/node-sass/lib/errors.js:15:5)
at Object.module.exports.missingBinary (/home/rap2-dolores/node_modules/node-sass/lib/errors.js:45:5)
at module.exports (/home/rap2-dolores/node_modules/node-sass/lib/binding.js:15:30)
at Object. (/home/rap2-dolores/node_modules/node-sass/lib/index.js:14:35)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build-css: node-sass src/ -o src/
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build-css 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! /root/.npm/_logs/2018-04-16T10_03_51_851Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: npm run build-css && react-scripts build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build 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! /root/.npm/_logs/2018-04-16T10_03_51_864Z-debug.log

相同环境,rap2-delos可以部署成功

rap2是否能添加“页面”的功能?

rap1的关系是 仓库——模块——页面——接口
rap2的关系是 仓库——模块——接口
rap2缺少了页面的功能,如果一个模块的接口很多的话,看起来很不清晰。建议在接口上层新增“页面”,作为树形结构展示

生成的接口地址不能访问-解决方法

页面链接:http://localhost:3000/repository/editor?id=14
点击“地址”:http://127.0.0.1:8080/app/mock/14/GET//example/1523240738732
出现:
{
"isOk": false,
"errMsg": "未匹配到任何接口 No matched interface"
}

原因:链接中传入了接口类型

解决方法1(前端去掉接口类型):
\rap2-dolores\src\components\editor\InterfaceSummary.jsx
42行改为: <Link to={${serve}/app/mock/${repository.id}${itf.url}} target='_blank'>{itf.url}

方法2(后端过滤接口类型):
\rap2-delos\src\routes\utils\url.ts
25行:urlMatchesPattern方法中过滤接口类型
url = url.replace(/^\/?(get|post|put|delete)\//i, '')

个人认为前端去掉接口类型比较好,影响了后台逻辑和效率

README.md有误

配置开发模式后端服务器的地址。 /src/config/config.prod.js , 应该为 /src/config/config.dev.js

导入数据貌似有点问题

试试看,会发现很诡异的事情,会报错,去掉报错后又会发现,无法识别数据的层级,添加后的数据乱了,然后删除字段也无法删除干净

{
	target_url: "/question/getByParams",
	error_infos: [
		{
			code: 500,
			msg: "Failed to convert value of type 'java.lang.String' to required type 'int'; nested exception is java.lang.NumberFormatException: For input string: """,
			details: [],
			validationErrorInfos: null
		}
	],
	result: [
		{
			"analy": "string",
			"answers": {},
			"content": "string",
			"difficultClass": "SoEasy",
			"id": 0,
			"knowledge": "string",
			"num": 0,
			"questionType": "Single",
			"remark": "string",
			"score": 0,
			"tenantId": 0,
			"updatorId": 0
		}
	],
	authorized_request: false,
	success: false
}

前端服务启动报错

[email protected] watch-css /usr/local/rap2-dolores

npm run build-css && node-sass src/ -o src/ --watch --recursive

[email protected] build-css /usr/local/rap2-dolores
node-sass src/ -o src/

fs.js:904
return binding.readdir(pathModule._makeLong(path), options.encoding);
^

Error: ENOENT: no such file or directory, scandir '/usr/local/rap2-dolores/node_modules/node-sass/vendor'
at Object.fs.readdirSync (fs.js:904:18)
at Object.getInstalledBinaries (/usr/local/rap2-dolores/node_modules/node-sass/lib/extensions.js:124:13)
at foundBinariesList (/usr/local/rap2-dolores/node_modules/node-sass/lib/errors.js:20:15)
at foundBinaries (/usr/local/rap2-dolores/node_modules/node-sass/lib/errors.js:15:5)
at Object.module.exports.missingBinary (/usr/local/rap2-dolores/node_modules/node-sass/lib/errors.js:45:5)
at module.exports (/usr/local/rap2-dolores/node_modules/node-sass/lib/binding.js:15:30)
at Object. (/usr/local/rap2-dolores/node_modules/node-sass/lib/index.js:14:35)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build-css: node-sass src/ -o src/
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build-css 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! /root/.npm/_logs/2017-12-13T13_56_29_831Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] watch-css: npm run build-css && node-sass src/ -o src/ --watch --recursive
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] watch-css 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! /root/.npm/_logs/2017-12-13T13_56_29_878Z-debug.log
ERROR: "watch-css" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: npm-run-all -p watch-css start-js

非官方rap2-dolores部署文档

前言

RAP2 包含两个组件 客户端:rap2-dolores服务端:rap2-delos
部署RAP2需要亲具有Node+Linux+MySQL的运维知识,如果亲对此不是很了解,建议用http://rap2.taobao.org 线上版本就可以了。

注意:
该项目的部署是建立在rap2-delos上,因此,需要先部署rap2-delos项目

构建项目

安装基本工具

以上基本工具请根据自身需要,下载对应系统安装包,请自行解决安装配置等问题,这里不做过多说明

获取源代码

git clone https://github.com/thx/rap2-dolores.git

导入VS Code

这里的开发编辑工具推荐,当然你也可以用自己熟悉的开发工具

环境配置

配置文件

目录:rap2-dolores/src/config
文件:config.dev.ts;其中dev,表示开发环境,其他同理
修改:config.dev.ts文件,serve地址是服务端rap2-delos部署成功后的地址,默认:'http://localhost:8080'

启动项目

安装项目依赖包

项目根目录下执行

npm install

如果下载缓慢,请使用淘宝npm镜像

编译启动项目

  • 开发模式
    自动监视改变后重新编译
    npm run dev
    备注:测试用例
    npm run test
  • 生产模式
    编译React生产包
    npm run build
    用serve命令或nginx服务器路由到编译产出的build文件夹作为静态服务器即可
    serve -s ./build -p 80

看到浏览器中出现登录页面,表示部署成功

常见问题

部署问题

  1. 执行npm run dev,提示

    return process.dlopen(module,path._makeLong(filename))
    ...
    ...node_modules\node-sass\vendor\win32-x64-57\binding.node is not a valid Win32 application...

    原因:项目依赖包node-sass没有安装完全
    解决方法:npm install node-sass

  2. 项目运行起来,但一直停留在加载动画那里

    浏览器控制台输出:
    GET http://127.0.0.1:8080/account/info ==>> Failed to load http://127.0.0.1:8080/account/info

    原因:未修改rap2-delos/src/config目录下服务端连接地址,或者修改结果与rap2-dolores实际提供服务地址不匹配
    解决方法:修改config.dev.ts文件serve配置信息

    如果Windows系统修改正确无误后,依旧出错,那么查看hosts(路径:C:\Windows\System32\drivers\etc)中127.0.0.1的IP前是否有#,如果有请取消注释

如何获取更新

目前请选择master分支源码,后续其他分支请看相应分支说明文档。在开发环境中git pull来获取最新的源码更新,每一期更新都会有对应的update.md请关注并按照上面的指示进行升级工作。

更详细的安装部署请移步:https://incoder.org/2018/03/27/rap2

[bug]无法导入特定格式请求参数

  • 参数示例
{
	"params": {
		"userName": "001",
		"page": 1,
		"length": 10
	}
}
  • 导入结果
    rap_fe_bug

  • 接口异常

  SequelizeDatabaseError: Data truncated for column 'type' at row 1
      at Query.formatError (/app/node_modules/[email protected]@sequelize/lib/dialects/mysql/query.js:247:16)
      at Query.handler [as onResult] (/app/node_modules/[email protected]@sequelize/lib/dialects/mysql/query.js:68:23)
      at Query.Command.execute (/app/node_modules/[email protected]@mysql2/lib/commands/command.js:30:12)
      at Connection.handlePacket (/app/node_modules/[email protected]@mysql2/lib/connection.js:502:28)
      at PacketParser.onPacket (/app/node_modules/[email protected]@mysql2/lib/connection.js:81:16)
      at PacketParser.executeStart (/app/node_modules/[email protected]@mysql2/lib/packet_parser.js:77:14)
      at Socket.<anonymous> (/app/node_modules/[email protected]@mysql2/lib/connection.js:89:29)
      at Socket.emit (events.js:182:13)
      at addChunk (_stream_readable.js:280:12)
      at readableAddChunk (_stream_readable.js:265:11)
      at Socket.Readable.push (_stream_readable.js:220:10)
      at TCP.onread (net.js:638:20)

接口导入 JSON 当值存在 null 的时候 type 是空的, 要重新选一遍才能传值给后端.

示例数据:
{
"content": null,
"message": "交易费率过低",
"properties": {},
"status": 9002,
"success": false
}

"content": null
异常 sql

INSERT INTO Properties (id,scope,type,name,rule,value,parentId,priority,interfaceId,moduleId,repositoryId,createdAt,updatedAt) VALUES (DEFAULT,'response','Null','content','','123',-1,1524735754315,140,49,19,'2018-04-26 09:42:34','2018-04-26 09:42:34');
xxx POST /properties/update?itf=140 500 9ms -

SequelizeDatabaseError: Data truncated for column 'type' at row 1

一直报这个错误,已经卸载安装多次,求解答

Error: Cannot find module 'D:\rap2-delos\rap2-dolores\node_modules\node-sass\bin\node-sass'
at Function.Module._resolveFilename (module.js:557:15)
at Function.Module._load (module.js:484:25)
at Function.Module.runMain (module.js:703:10)
at startup (bootstrap_node.js:193:16)
at bootstrap_node.js:660:3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.