midwayjs

lrf d499e7ce05 update 10 months ago
src d499e7ce05 update 10 months ago
test 3d187af848 init 11 months ago
.editorconfig 3d187af848 init 11 months ago
.eslintrc.json 3d187af848 init 11 months ago
.gitignore 3d187af848 init 11 months ago
.prettierrc.js 3d187af848 init 11 months ago
README.md d499e7ce05 update 10 months ago
README.zh-CN.md 3d187af848 init 11 months ago
bootstrap.js 3d187af848 init 11 months ago
ecosystem.config.js 3d187af848 init 11 months ago
jest.config.js 3d187af848 init 11 months ago
package-lock.json 0141f6a38c 修改 11 months ago
package.json 0e299fa6c6 update 10 months ago
pnpm-lock.yaml 0e299fa6c6 update 10 months ago
tsconfig.json 3d187af848 init 11 months ago

README.md

vue3js-template-service

1.单点登录

  • 1.不需要登录就可以使用的接口: 请求函数的方法注解参数添加 description: 'ignore'即可

2.注解

  • checkPermissionCode |注解名|类型|说明| |:-:|:-:|:-:| |roleCode|string|该接口权限所需标识 ${路由名称}.${功能}|

  • dataRecord |注解名|类型|说明| |:-:|:-:|:-:| |before|string|获取原数据的函数名;该service下的函数名,纯自定义| |after|string|获取新数据的函数名;该service下的函数名,纯自定义|

3.mongodb开启副本集

  • 1.conf配置文件中添加 replication:   replSetName: rs0
  • 2.重启服务,进入mongodb控制台 ```rsconf = { _id: "rs0", members: [ { _id: 0, host: "localhost:27018" }, { _id: 1, host: "localhost:27019" }, { _id: 2, host: "localhost:27020" } ] }

rs.initiate( rsconf )

* 3.重置副本集

1.停止所有实例,使用非主从复制模式启动,注释 replication 设置 2.sh进入每个数据库后删除local库 use local db.dropDatabase() 3.停止所有实例,使用主从复制模式启动,打开注释 4.初始化配置,sh连接1个库 rs.initate() 不输入参数 conf=rs.conf() conf.members[0].host='xxx.xxx.xxx.xxx:xxx' rs.reconfig(conf) rs.status() 查看配置 5.添加从节点 从节点: rs.add({ _id: x, host: 'xxx.xxx.xxx.xxx:xxx' }) 选举节点: rs.add({ _id: x, host: 'xxx.xxx.xxx.xxx:xxx', priority: 1, arbiterOnly: true }) 隐藏节点: 添加 hidden: true 延迟节点: slaveDelay: int(s秒) 非选举节点: priority: 0 仲裁节点: rs.addArb('xxx.xxx.xxx.xxx:xxx') ```