“slc loopback”不会创建“common”目录

时间:2015-11-29 17:26:16

标签: json command-line-interface loopback

我找不到用户,acl等json文件,因为该工具没有创建属于它们的“公共”目录。

这是我用slc --version获得的:

├── strong-arc@1.8.4 (b7b568d)
├── strong-build@2.0.6 (d008a3e)
├── strong-deploy@3.1.2 (be6180a)
├── strong-mesh-models@8.1.0 (62e539b)
├── strong-pm@5.0.1 (b96f806)
├── strong-registry@1.1.5 (f46e58f)
├── strong-start@1.3.2 (1327018)
├─┬ strong-supervisor@3.3.1 (1e39220)
│ └── strong-agent@2.0.2 (4ea7ee9)
├── generator-loopback@1.13.0 (a884c0b)
├── node-inspector@0.7.4
└── nodefly-register@0.3.3

这是“slc loopback”生成的package.json文件:

{
  "name": "asd",
  "version": "1.0.0",
  "main": "server/server.js",
  "scripts": {
    "pretest": "jshint ."
  },
  "dependencies": {
    "compression": "^1.0.3",
    "cors": "^2.5.2",
    "loopback": "^2.22.0",
    "loopback-boot": "^2.6.5",
    "loopback-component-explorer": "^2.1.0",
    "loopback-datasource-juggler": "^2.39.0",
    "serve-favicon": "^2.0.1"
  },
  "devDependencies": {
    "jshint": "^2.5.6"
  },
  "repository": {
    "type": "",
    "url": ""
  },
  "description": "asd"
}

1 个答案:

答案 0 :(得分:0)

一旦开始创建自己的模型和ACL,Loopback将生成所需的jsonjs文件。它会创建common目录

运行以下命令:

slc loopback:model 

允许您扩展User模型,然后您就可以通过以下方式添加正确的ACL权限:

slc loopback:acl