GithubHelp home page GithubHelp logo

neiapi / nei Goto Github PK

View Code? Open in Web Editor NEW
320.0 17.0 75.0 17.4 MB

NEI 接口管理平台 源代码

Home Page: https://nei.netease.com

License: MIT License

JavaScript 95.28% TypeScript 0.07% Shell 0.01% CSS 0.57% FreeMarker 0.04% HTML 3.87% Smarty 0.01% EJS 0.10% Dockerfile 0.01% PEG.js 0.05%
api api-mock api-specs api-documentation nei api-server

nei's People

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

nei's Issues

导入Postman失败

Bug 描述
解析Postman接口文件错误
接口为空!

导入文件

{
  "info":{
    "_postman_id":"b29b6952-3371-4276-a1ce-6111cafec135",
    "name":"lz2392504 的项目",
    "schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
  },
  "item":[
    {
      "name":"测试接口-获取用户信息接口",
      "request":{
        "auth":{
          "type":"noauth"
        },
        "method":"GET",
        "header":[
          
        ],
        "url":{
          "raw":"{{baseUrl}}/getUserInfo?userId=<string>",
          "host":[
            "{{baseUrl}}"
          ],
          "path":[
            "getUserInfo"
          ],
          "query":[
            {
              "key":"userId",
              "value":"<string>",
              "description":"(Required) 用户编号"
            }
          ]
        }
      },
      "response":[
        {
          "name":"成功",
          "originalRequest":{
            "method":"GET",
            "header":[
              
            ],
            "url":{
              "raw":"{{baseUrl}}/getUserInfo?userId=<string>",
              "host":[
                "{{baseUrl}}"
              ],
              "path":[
                "getUserInfo"
              ],
              "query":[
                {
                  "key":"userId",
                  "value":"<string>"
                }
              ]
            }
          },
          "status":"OK",
          "code":200,
          "_postman_previewlanguage":"text",
          "header":[
            {
              "key":"Content-Type",
              "value":"*/*"
            }
          ],
          "cookie":[
            
          ],
          "body":""
        }
      ]
    },
    {
      "name":"测试mock接口",
      "request":{
        "auth":{
          "type":"noauth"
        },
        "method":"GET",
        "header":[
          
        ],
        "url":{
          "raw":"{{baseUrl}}/testMock?name=<string>",
          "host":[
            "{{baseUrl}}"
          ],
          "path":[
            "testMock"
          ],
          "query":[
            {
              "key":"name",
              "value":"<string>",
              "description":"(Required) 测试使用的传参参数姓名"
            }
          ]
        }
      },
      "response":[
        {
          "name":"成功",
          "originalRequest":{
            "method":"GET",
            "header":[
              
            ],
            "url":{
              "raw":"{{baseUrl}}/testMock?name=<string>",
              "host":[
                "{{baseUrl}}"
              ],
              "path":[
                "testMock"
              ],
              "query":[
                {
                  "key":"name",
                  "value":"<string>"
                }
              ]
            }
          },
          "status":"OK",
          "code":200,
          "_postman_previewlanguage":"text",
          "header":[
            {
              "key":"Content-Type",
              "value":"*/*"
            }
          ],
          "cookie":[
            
          ],
          "body":""
        }
      ]
    }
  ],
  "variable":[
    {
      "id":"baseUrl",
      "key":"baseUrl",
      "value":"/",
      "type":"string"
    }
  ],
  "protocolProfileBehavior":{
    
  }
}

本地部署登录无响应

Bug 描述
使用源码打包,npm run dev 登录无响应
代码执行到yield this.next();就没有返回了,接口一直处于pending状态

重现步骤

期望结果
正常登录

截图
image

软件环境

  • 操作系统及版本:mac
  • Node及版本: v14.18.0
  • 浏览器及版本: chrome

其他信息
其他信息可以填这里。

导入swagger文件失败,格式经过swagger.editor验证

Bug 描述
Uncaught (in promise) TypeError: Cannot convert undefined or null to object
at Function.keys ()
at importDataTypes (/src/lib/NEI_import/dist/NEISwagger.js:13399)
at /src/lib/NEI_import/dist/NEISwagger.js:13436

预期期望
如果是文件格式错误,希望能有个demo参照;
如果格式没有错误,我应该如何使用导入swagger这个功能

导入文件
swagger: '2.0'
info:
version: 1.0.0
title: Simple Artist API
description: A simple API to understand the Swagger Specification in greater detail
schemes:

  • https
    host: example.io
    basePath: /v1
    securityDefinitions:
    UserSecurity:
    type: basic
    security:

    • UserSecurity: []
      paths:
      /artists:
      get:
      description: Returns a list of artists
      parameters:
      - name: limit
      in: query
      type: integer
      description: Limits the number of items on a page
      - name: offset
      in: query
      type: integer
      description: Specifies the page number of the artists to be displayed

      responses:
      200:
      description: Successfully returned a list of artists
      schema:
      type: array
      items:
      type: object
      required:
      - username
      properties:
      artist_name:
      type: string
      artist_genre:
      type: string
      albums_recorded:
      type: integer
      username:
      type: string

      400:
        description: Invalid request 
        schema:
          type: object
          properties:   
            message:
              type: string
      

      post:
      description: Lets a user post a new artist
      parameters:
      - name: artist
      in: body
      description: creates a new artist in our database
      schema:
      type: object
      required:
      - username
      properties:
      artist_name:
      type: string
      artist_genre:
      type: string
      albums_recorded:
      type: integer
      username:
      type: string

      responses:
      200:
      description: Successfully created a new artist

      400:
        description: Invalid request 
        schema:
          type: object
          properties:   
            message:
              type: string
      

    ----- Added lines ----------------------------------------

    /artists/{username}:
    get:
    description: Obtain information about an artist from his or her unique username
    parameters:
    - name: username
    in: path
    type: string
    required: true

    responses:
      200:
        description: Successfully returned an artist
        schema:
          type: object
          properties:
            artist_name:
              type: string
            artist_genre:
              type: string
            albums_recorded:
              type: integer
              
      400:
        description: Invalid request
        schema:
          type: object 
          properties:           
            message:
              type: string
    

    ---- /Added lines ----------------------------------------

进行到npm run build的时候遇到 Cannot read properties of undefined (reading 'sprite')

Bug 描述
精简的 Bug 描述。

重现步骤

  1. ...按照部署方式二 前两步都正常
  2. ...npm run build 时发生Cannot read properties of undefined (reading 'sprite')
  3. bug 重现

期望结果
精简的期望描述。

截图
有截图就是最好的。

软件环境

  • 操作系统及版本: windows10
  • Node及版本: node v16.15.1 nej 1.7.8
  • 浏览器及版本:

其他信息
其他信息可以填这里。

[email protected] nej
nej build ./deploy/release.conf -m online -l info

[I] 2022-06-10 17:35:24.334 - node version is v16.15.1, toolkit version is 1.7.8
[I] 2022-06-10 17:35:24.338 - parse config file D:/@@Learner/hupun/NEI/nei/deploy/release.conf
[D] 2022-06-10 17:35:24.344 - config result -> {"DIR_CONFIG":"D:/@@Learner/hupun/NEI/nei/deploy/","DIR_WEBROOT":"D:/@@Learner/hupun/NEI/nei/public/","DIR_SOURCE":"D:/@@Learner/hupun/NEI/nei/public/src/module/","DIR_SOURCE_SUB":["D:/@@Learner/hupun/NEI/nei/public/src/module/layout/"],"DIR_OUTPUT":"D:/@@Learner/hupun/NEI/nei/public/m/","DIR_SOURCE_TP":"D:/@@Learner/hupun/NEI/nei/view/","DIR_OUTPUT_TP":"D:/@@Learner/hupun/NEI/nei/template/","DIR_OUTPUT_STATIC":"D:/@@Learner/hupun/NEI/nei/public/r/","DIR_STATIC":"D:/@@Learner/hupun/NEI/nei/public/res/","ALIAS_MATCH":{},"ALIAS_DICTIONARY":{},"DM_STATIC":["/"],"DM_STATIC_CS":["/"],"DM_STATIC_JS":["/"],"DM_STATIC_RS":["/"],"FILE_FILTER":{},"FILE_CHARSET":"utf-8","VERSION_MODE":"[FILENAME]_[VERSION]","VERSION_STATIC":true,"VERSION_STATIC_MODE":0,"CORE_MERGE_FLAG":0,"CORE_NOPARSE_FLAG":3,"WRP_INLINE_SOURCE":"%s","CPRS_FLAG":0,"CPRS_KEEP_COMMENT":false,"NEJ_CONFIG":{},"NEJ_REGULAR":"regularjs","NEJ_PLATFORM":"","NEJ_PROCESSOR":{},"NEJ_INJECTOR":"I$","NEJ_MODULE_ROOT":"/","NEJ_MODULE_VERSION":0,"NEI_PROJECT_ID":0,"OPT_IMAGE_FLAG":false,"OPT_IMAGE_QUALITY":100,"OPT_IMAGE_BASE64":0,"MANIFEST_OUTPUT":"D:/@@Learner/hupun/NEI/nei/public/cache.manifest","MANIFEST_TEMPLATE":"CACHE MANIFEST\n#VERSION = #\n\nCACHE:\n#<CACHE_LIST>\n\nNETWORK:\n*\n\nFALLBACK:\n","OBF_LEVEL":0,"OBF_NAME_BAGS":"D:/@@Learner/hupun/NEI/nei/deploy/names.json","OBF_COMPATIBLE":true,"DIR_SOURCE_MAP":"D:/@@Learner/hupun/NEI/nei/public/r/s/","OBF_SOURCE_MAP":true,"OBF_MAX_CS_INLINE_SIZE":100,"OBF_MAX_JS_INLINE_SIZE":100,"OBF_CORE_INLINE_FLAG":0,"OBF_DROP_CONSOLE":false,"CORE_FREQUENCY_JS":2,"CORE_FREQUENCY_CS":2,"CORE_IGNORE_ENTRY":false,"WRP_SCRIPT_SOURCE":"%s","WRP_INLINE_CS":"<textarea name="css">%s</textarea>","WRP_EXLINE_CS":"<textarea name="css" data-src="%s"></textarea>","WRP_INLINE_JS":"<textarea name="js">%s</textarea>","WRP_EXLINE_JS":"<textarea name="js" data-src="%s"></textarea>","WRP_INLINE_TP":"<textarea id="%s" name="%s">%s</textarea>","WRP_INLINE_STYLE":"<style type="text/css">\n%s\n</style>","WRP_EXLINE_STYLE":"<link rel="stylesheet" href="%s"/>","WRP_INLINE_SCRIPT":"<script>\n%s\n</script>","WRP_EXLINE_SCRIPT":"<script src="%s"></script>","WCS_UPLOAD_URL":"","WCS_UPLOAD_TOKEN":"","WCS_APP_ID":"","WCS_NATIVE_ID":"","WCS_FILE_INCLUDE":"","WCS_FILE_EXCLUDE":"","WCS_CONFIG_FILE":"D:/@@Learner/hupun/NEI/nei/deploy/cache.json","DATA_LOG_API":"","X_AUTO_EXLINK_PATH":false,"X_AUTO_EXLINK_SCRIPT":false,"X_RELEASE_MODE":"online","X_LOGGER_LEVEL":"ALL","X_LOGGER_FILE":"D:/@@Learner/hupun/NEI/nei/deploy/20220610173524344.log","":""}
[D] 2022-06-10 17:35:24.345 - overwrite X_RELEASE_MODE to online
[D] 2022-06-10 17:35:24.345 - overwrite X_LOGGER_LEVEL to INFO
[I] 2022-06-10 17:35:24.345 - cache nej config
[I] 2022-06-10 17:35:24.346 - prepare merge config
[I] 2022-06-10 17:35:24.348 - dump template files
[I] 2022-06-10 17:35:24.427 - dump html files
[I] 2022-06-10 17:35:24.428 - parse input files
[W] 2022-06-10 17:35:25.733 - D:/@@Learner/hupun/NEI/nei/public/src/lib/editor-md/images/loading.gif is not in DIR_STATIC[D:/@@Learner/hupun/NEI/nei/public/src/lib/editor-md/css/editormd.css]
[W] 2022-06-10 17:35:25.734 - D:/@@Learner/hupun/NEI/nei/public/src/lib/editor-md/images/[email protected] is not in DIR_STATIC[D:/@@Learner/hupun/NEI/nei/public/src/lib/editor-md/css/editormd.css]
[W] 2022-06-10 17:35:25.735 - D:/@@Learner/hupun/NEI/nei/public/src/lib/editor-md/images/[email protected] is not in DIR_STATIC[D:/@@Learner/hupun/NEI/nei/public/src/lib/editor-md/css/editormd.css]
[W] 2022-06-10 17:35:25.736 - D:/@@Learner/hupun/NEI/nei/public/src/lib/editor-md/fonts/fontawesome-webfont.eot?v=4.3.0 is not in DIR_STATIC[D:/@@Learner/hupun/NEI/nei/public/src/lib/editor-md/css/editormd.css]
[W] 2022-06-10 17:35:25.737 - D:/@@Learner/hupun/NEI/nei/public/src/lib/editor-md/fonts/fontawesome-webfont.eot?#iefix&v=4.3.0 is not in DIR_STATIC[D:/@@Learner/hupun/NEI/nei/public/src/lib/editor-md/css/editormd.css]
[W] 2022-06-10 17:35:25.738 - D:/@@Learner/hupun/NEI/nei/public/src/lib/editor-md/fonts/fontawesome-webfont.woff2?v=4.3.0 is not in DIR_STATIC[D:/@@Learner/hupun/NEI/nei/public/src/lib/editor-md/css/editormd.css]
[W] 2022-06-10 17:35:25.739 - D:/@@Learner/hupun/NEI/nei/public/src/lib/editor-md/fonts/fontawesome-webfont.woff?v=4.3.0 is not in DIR_STATIC[D:/@@Learner/hupun/NEI/nei/public/src/lib/editor-md/css/editormd.css]
[W] 2022-06-10 17:35:25.741 - D:/@@Learner/hupun/NEI/nei/public/src/lib/editor-md/fonts/fontawesome-webfont.ttf?v=4.3.0 is not in DIR_STATIC[D:/@@Learner/hupun/NEI/nei/public/src/lib/editor-md/css/editormd.css]
[W] 2022-06-10 17:35:25.741 - D:/@@Learner/hupun/NEI/nei/public/src/lib/editor-md/fonts/fontawesome-webfont.svg?v=4.3.0#fontawesomeregular is not in DIR_STATIC[D:/@@Learner/hupun/NEI/nei/public/src/lib/editor-md/css/editormd.css]
[W] 2022-06-10 17:35:25.742 - D:/@@Learner/hupun/NEI/nei/public/src/lib/editor-md/fonts/editormd-logo.eot?-5y8q6h is not in DIR_STATIC[D:/@@Learner/hupun/NEI/nei/public/src/lib/editor-md/css/editormd.css]
[W] 2022-06-10 17:35:25.743 - resource D:/@@Learner/hupun/NEI/nei/public/src/lib/editor-md/css/.../fonts/editormd-logo.eot in file D:/@@Learner/hupun/NEI/nei/public/src/lib/editor-md/css/editormd.css not exist
[W] 2022-06-10 17:35:25.743 - D:/@@Learner/hupun/NEI/nei/public/src/lib/editor-md/fonts/editormd-logo.woff?-5y8q6h is not in DIR_STATIC[D:/@@Learner/hupun/NEI/nei/public/src/lib/editor-md/css/editormd.css]
[W] 2022-06-10 17:35:25.744 - D:/@@Learner/hupun/NEI/nei/public/src/lib/editor-md/fonts/editormd-logo.ttf?-5y8q6h is not in DIR_STATIC[D:/@@Learner/hupun/NEI/nei/public/src/lib/editor-md/css/editormd.css]
[W] 2022-06-10 17:35:25.744 - D:/@@Learner/hupun/NEI/nei/public/src/lib/editor-md/fonts/editormd-logo.svg?-5y8q6h#icomoon is not in DIR_STATIC[D:/@@Learner/hupun/NEI/nei/public/src/lib/editor-md/css/editormd.css]
[I] 2022-06-10 17:35:27.134 - merge core list
[I] 2022-06-10 17:35:27.182 - sort input files by module dependency
[I] 2022-06-10 17:35:27.188 - split core from input files
[I] 2022-06-10 17:35:27.236 - minify script
[I] 2022-06-10 17:35:32.599 - embed resources to input files
[I] 2022-06-10 17:35:35.827 - prepare sprite images dimension
[I] 2022-06-10 17:35:37.030 - layout sprite images
[I] 2022-06-10 17:35:37.034 - generate sprite image sprite
[I] 2022-06-10 17:35:37.046 - output sprite image to D:/@@Learner/hupun/NEI/nei/public/res/sprite_a499c0aa4797bef857d42eef8a156217.png
[I] 2022-06-10 17:35:37.123 - output files
TypeError: Cannot read properties of undefined (reading 'sprite')
at Klass.URLHANDLER.sp (D:\tools\npm\node_modules\node_global\node_modules\nej\lib\meta\html.js:80:40)
at D:\tools\npm\node_modules\node_global\node_modules\nej\lib\meta\html.js:861:29
at D:\tools\npm\node_modules\node_global\node_modules\nej\lib\util\path.js:156:16
at String.replace ()
at Object.exports.unwrapURI (D:\tools\npm\node_modules\node_global\node_modules\nej\lib\util\path.js:155:20)
at Klass.pro._formatContent (D:\tools\npm\node_modules\node_global\node_modules\nej\lib\meta\html.js:857:18)
at Klass.pro._formatRSURI (D:\tools\npm\node_modules\node_global\node_modules\nej\lib\meta\html.js:814:24)
at Klass.cs (D:\tools\npm\node_modules\node_global\node_modules\nej\lib\meta\html.js:94:21)
at D:\tools\npm\node_modules\node_global\node_modules\nej\lib\meta\html.js:861:29
at D:\tools\npm\node_modules\node_global\node_modules\nej\lib\util\path.js:156:16

自己电脑使用容器部署的,但界面显示不完整

Bug 描述
自己使用虚拟机,使用docker-compose up -d 安装,全部都使用默认值。安装后可以注册了登录
登录进去后的界面显示不正常。如下图
image

软件环境

  • 操作系统及版本:Centos7
  • Node及版本:15.8.0
  • 浏览器及版本:谷歌浏览器 76.0.3809.132

项目运行后, 有管理员账户吗?

您好, 我想问一下, 用docker部署项目后, 在mysql的user表中, 看到有一个admin初始账户, 但是没有密码, 只能注册新账户进行登录
想问一下.
这个项目有管理员账户吗, 是怎么登录的呢?

开源预告

NEI 是一款接口管理平台的产品,相信对本文有兴趣的朋友已经对接口管理平台的功能、价值、国内外竞品等等有所了解,所以本文也不会在这些地方展开讲解。今天我们只讲为什么 NEI 会选择开源。

可以毫不谦虚的说,NEI 在同类产品中做得还算是比较成功的。截止目前,NEI 的注册用户超过 2万2千(包括网易公司内部用户以及外部公司用户,NEI 一直对外开放免费使用),接口数量超过 23 万,数据模型数量超过 28 万,内部产品(NEI 中接口数量超过 100 个的项目组)有 140 个之多,外部产品有 270 个之多。

NEI 的成功离不开公司的大力支持。要知道,NEI 不是一款商业软件,它并不以赢利为目标,能在这样的项目上持续投入开发资源,放眼国内外公司并不多见。之前在和公司外部的 NEI 用户聊,有人说 NEI 的 UI 比较好看,国内竞品的界面好看的确实不多,毕竟 NEI 的初始版本邀请了专业设计师参与设计。还有人说羡慕网易这样的大公司,基础设施完善,大家可以在同个平台上协同作业,我想他是已经遇到了接口管理方面的难题了。类似的聊天场景还有很多,相信他们或多或少都遇到了或者是意识到了接口管理对于研发团队的意义。

几乎所有的外部用户都在询问 NEI 是否可以私有部署。不管是什么类型的产品,它的 API 接口相对来说都是私密数据,因为其中会涉及到业务逻辑。NEI 一直没有提供免费或者是付费的私有部署版本,这也让非常多的外部公司用户望而却步。

那么今天 NEI 为什么要选择直接开源呢?下面说说我们的看法。

首先,目前 NEI 功能完备运行稳定,该有的功能基本上都有了,产品迭代速度放缓,主要以公司内部用户的需求为主。所以,当外部用户提了需求后,除非是影响使用的或者公司内部也有相同的需求,否则很难保证能及时响,这一点相信会让所有技术人员自责。

其次,个性化需求永远存在,作为一款非商业软件,没有必要也不太可能一直投入资源去开发特定场景下的功能,我们决定把这个权力交给用户自己,让他们去定制符合自己的功能。

第三,网易内部研发团队的实践已经证明,NEI 确实可以提升研发团队的工作效率,好的软件要共享给所有开发人员。

第四,NEI 的设计**更多地是为了满足网易公司内部的研发习惯,开源之后,我们相信会有很多有才的工程师来给 NEI 添砖加瓦,这对于 NEI 软件本身的发展以及接口管理的最佳实践都是非常有利的。

基于上述考虑,我们决定将 NEI 开源,因为要将项目开源还有一定的改造工作和必需的文档,具体的开源时间请关注后续的公告,请各位同行朋友拭目以待。

如果大家有什么需求或者疑问,请在下方留言,谢谢。

—— 网易云音乐前端研发团队 2020.3.11

【测试中】线上数据的导出方式

数据导出

导出接口为

https://nei.netease.com/api/exportjson?key=:key

其中 key 是项目的 key,可以在项目的 设置 页面找到,比如官方的 Todo Demo,设置页面是 https://nei.netease.com/project/tool/?pid=18754,key 为 87d651ed3ddf6e54b675a7c56f6d3003 ,所以这个项目的导出数据地址为:

https://nei.netease.com/api/exportjson?key=87d651ed3ddf6e54b675a7c56f6d3003

数据导入

可以自己编写脚本批量导入,也可以使用NEI页面的导入功能,导入接口地址和请求参数可以参考NEI页面的导入功能:

https://neires.nos-eastchina1.126.net/nei_import_step1.png

https://neires.nos-eastchina1.126.net/nei_import_step2.png

数据格式说明

请参考这个文档

注意

  1. 目前对于导入数据模型的覆写场景还未处理。
  2. 另外,由于开发时间仓促,测试还不够充分,有问题请留言,后续会根据实际情况进行优化。

导入json后,数据模型中 Array Object 中字段错误(偏移)

Bug 描述
导入json后,”数据模型“中 Array Object 中字段错误(偏移),在私有化部署和nei.netease.com上都会复现。
而数据模型中数据出错,导致了所有引用该数据类型的字段全部错误。

重现步骤
导出前:
image
image
一个随意的 http post 接口包含了这两个数据类型。
导入后:
image
image

其他信息
获取改测试用json的url为:https://nei.netease.com/api/exportjson?key=117b5e88d87451856464436ae7717efa

数据表interface_header的default_value字段限定长度错误

Bug 描述
default_value字段预设255字节,会报错
ER_DATA_TOO_LONG: Data too long for column 'default_value' at row 1

重现步骤

  1. 接口使用请求头Authorization时,其默认值会超过255字节

期望结果
初始部署SQL修改该表中字段限定为500字节

docker 部署出错 (安装 nej 时 )

Bug 描述
精简的 Bug 描述。
The command '/bin/sh -c npm install nej -g' returned a non-zero code: 1
重现步骤

  1. docker-compose up -d
  2. bug 重现

期望结果
精简的期望描述。
期望能通过 docker 部署成功
截图
有截图就是最好的。
image

软件环境

  • 操作系统及版本:
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description: Ubuntu 20.04 LTS
    Release: 20.04
    Codename: focal
  • Node及版本: 无需
  • 浏览器及版本: 无需

其他信息
其他信息可以填这里。
单独安装 nej 时也会报以下错误
image

私有化部署并对 nei 进行个性化修改,那如何与 nei 之后发布的 feature 进行合并

你提的 Feature 是否和某个问题有关?
是这样的场景,目前 NEI 里提供的一些功能例如工程规范、客户端在我们公司中是不会用上的,于是想通过源码来进行个性化修改,但这样就会产生一个问题,之后 NEI 官方发布的 features,我本地想要使用,那应该要怎么合并呢?

请描述你想要的解决方案
除了手动去 merge 时剔除掉不需要的功能,是否有更简单的方式去处理 feature 之间的合并呢?

请描述你能接受的其他方案
如果有的话,可以精简的描述一下。

其他信息
其他信息可以填这里。

隐藏模型中某字段(必填字段)后,在接口测试中会报错说该字段为必填

Bug 描述
隐藏模型中某字段(下拉框选择的必填字段)后,在接口测试中会报错说该字段为必填。个人认为 NEI 在这里的判断优先级应该是判断是否隐藏 > 判断是否为必/选填
重现步骤

  1. 定义一个模型 UserInfo ,里面有 age sex 字段
  2. 在某个接口中引用此模型,并都设置为必填字段,并隐藏 age 字段
  3. 去到接口测试界面测试刚刚的接口

期望结果
精简的期望描述。

截图
image

image

软件环境

  • 操作系统及版本:
  • Node及版本:
  • 浏览器及版本:

其他信息
其他信息可以填这里。

nei.netease.com 停服通告

大家好:

最近几天NEI线上站点一直遭受DDOS攻击,为此,NEI开发团队已经申请了公司多个部门的资源来解决,投入了很多人力,但发现成本比想像中要大很多。综合考虑,我们做了一个艰难的决定,准备停止NEI线上服务,不再向公司申请更多的资源投入到这件事情上来,给大家带来的不便深表歉意。

NEI开发团队目前已经不是一个实体组织,是一些对NEI保持热情的同事一起在研发和维护。

NEI目前的主要费用是容器费用,是我们每年向网易云的领导申请的,在此感谢网易云领导的慷慨支持。

NEI只是遭受了DDOS攻击,大家的数据都完好无损。接下来,请大家尽快按照项目的说明文档私有化部署NEI,然后联系我们(加qq群453281988)来帮助大家导出和导入数据

由于NEI没有现成的导入和导出功能,接下来我们会开发脚本帮助大家完成数据的导出和导入。

如果大家还想使用线上版本,目前来看只能起用新域名,后续的维护成本也有增无减,而且治标不治本,一旦被攻击发现新域名,仍旧会被攻击。

大家有什么意见或者建议可以留言。

导入swagger失败

Bug 描述
ono.js:64 Uncaught (in promise) SyntaxError: [object Object] is not a valid Swagger API definition
at index.js:65

** 导入文件**

{
  "openapi": "3.0.1",
  "info": {
    "title": "lz2392504 的项目",
    "description": "",
    "version": "1.0.0"
  },
  "tags": [
    {
      "name": "测试分组"
    }
  ],
  "paths": {
    "/getUserInfo": {
      "get": {
        "summary": "测试接口-获取用户信息接口",
        "description": "",
        "tags": [
          "未命名"
        ],
        "parameters": [
          {
            "name": "userId",
            "in": "query",
            "description": "用户编号",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "*/*": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "description": ""
                    },
                    "msg": {
                      "type": "string",
                      "description": ""
                    },
                    "data": {
                      "type": "array",
                      "description": "",
                      "items": {
                        "type": "object",
                        "description": "",
                        "properties": {
                          "userName": {
                            "type": "string",
                            "description": ""
                          },
                          "userAge": {
                            "type": "number",
                            "description": ""
                          },
                          "userSex": {
                            "type": "number",
                            "description": ""
                          }
                        },
                        "required": [
                          "userName",
                          "userAge",
                          "userSex"
                        ]
                      }
                    }
                  },
                  "required": [
                    "code",
                    "msg",
                    "data"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/testMock": {
      "get": {
        "summary": "测试mock接口",
        "description": "",
        "tags": [
          "未命名"
        ],
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "description": "测试使用的传参参数姓名",
            "required": true,
            "example": "测试姓名",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "*/*": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "description": ""
                    },
                    "msg": {
                      "type": "string",
                      "description": ""
                    },
                    "data": {
                      "type": "string",
                      "description": ""
                    }
                  },
                  "required": [
                    "code",
                    "msg",
                    "data"
                  ]
                }
              }
            }
          }
        }
      }
    }
  }
}

(二次开发)关于在数据模型保存时新增弹窗的问题

Bug 描述
如何在数据模型res_datatype_create.js保存时,引入弹窗?在其他js如param_editor_core.js中点击事件可以通过new MessageBox({
data: {
}
}).$inject(document.body);引入弹窗

重现步骤

  1. 定义一个组件,类似于public\src\module\poplayer\profile_bind_layer.js
  2. 在res_datatype_create.js中引入
    NEJ.define(['pro/poplayer/messagebox'],function (message)
    创建组件
    pro.__handleSubmit = function () {
    // 正在提交当中, 不用再次提交
    if (this.__submit) {
    return;
    }
    if (this.__formObj.
    $checkValidity()) {
    this.__disableBtn(this.__formElem['save'], '提交中...', true);
    var options = this.__getSubmitOptions();
    new MessageBox({
    data: {
    }
    }).$inject(document.body);
    .......
    };
  3. bug 重现

期望结果
期望在保存后出现弹窗

截图
有截图就是最好的。
image
Uploading image.png…

软件环境

  • 操作系统及版本win10:
  • Node及版本:v10.14.2
  • 浏览器及版本:google

其他信息
其他信息可以填这里。

私有部署使用exportjson数据无法导入,服务端报错ER_NO_DEFAULT_FOR_FIELD

  1. 在NEI公有地址把项目exportjson下载下来
  2. 本地私有化部署了NEI,docker-compose 启动
  3. 创建项目并且导入json失败,显示了待导入的接口,但最终报了错,导入失败。
[E] [2021-07-21 04:33:49.964] - ER_NO_DEFAULT_FOR_FIELD: Field 'type' doesn't have a default value
[E] [2021-07-21 04:33:50.406] -
meta -> {"message":"domain is not defined","stack":"ReferenceError: domain is not defined\n    at dumpName (/appops/server/service/helper/notification.js:140:32)\n    at dumpTextAndToUsers (/appops/server/service/helper/notification.js:175:18)\n    at dumpTextAndToUsers.next (<anonymous>)\n    at onFulfilled (/appops/node_modules/co/index.js:65:19)\n    at /appops/node_modules/co/index.js:54:5\n    at new Promise (<anonymous>)\n    at co (/appops/node_modules/co/index.js:50:10)\n    at toPromise (/appops/node_modules/co/index.js:118:63)\n    at next (/appops/node_modules/co/index.js:99:29)\n    at onFulfilled (/appops/node_modules/co/index.js:69:7)"}

因为这个导入页面没有权限限制,我没办法公开提供我的key作为输入数据。

接口导入信息补全

Bug 描述
1.导入接口标签部分缺失
2.导入接口状态信息全部为“未开始”
3.导入接口请求信息的请求头缺失

重现步骤

  1. 导出线上数据
    https://nei.netease.com/api/exportjson?key=********c640ca4fab424cf94e******
  2. 在私有化环境导入接口数据
  3. 查看私有化导入结果

期望结果
1.可以同步线上标签数据
2.可以同步线上接口状态信息
3.可以同步线上接口请求信息的请求头数据

截图
部分私有化截图
siyouhua-1
siyouhua-2
部分线上截图
xianshang-1
xianshang-2

软件环境

  • 操作系统及版本:服务器 debain7
  • Node及版本: node6.9.2
  • 浏览器及版本: Google Chrome版本 75.0.3770.100(正式版本) (64 位)

其他信息

Swagger中的定义的tags导入后会丢失

Bug 描述
Swagger中的定义的tags导入后会丢失

重现步骤

  1. 在代码中用@Api(tags ="标签")对类进行注解
  2. 导出swagger json文件
  3. 通过NEI中的“新建接口-导入swagger文件”进行导入
  4. bug 重现

期望结果
导入的接口包含代码中定义的swagger tags

涉及文件
public/src/lib/NEI_import/src/NEISwagger.ts
public/src/lib/NEI_import/src/NEIInterfaceBean.ts

问题原因
NEI_Import的代码中�给把标签赋值给了NEIInterfaceBean.tags属性,但是在NEI中标签属性是tag,没有s,故导致丢失标签数据。

postman批量导入接口时无header信息

Bug 描述
postman 批量导入接口时无header信息

重现步骤

{
	"info": {
		"_postman_id": "5fe34b83-6000-4468-9e25-be7c1fd8f00c",
		"name": "Test",
		"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
	},
	"item": [
		{
			"name": "01",
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "x-api-key",
						"value": "123456",
						"description": "asdsad",
						"type": "text"
					},
					{
						"key": "Max-Forwards",
						"value": "5",
						"description": "asdadssa",
						"type": "text"
					},
					{
						"key": "X-Forward-For",
						"value": "3",
						"description": "asdasdsad",
						"type": "text"
					}
				],
				"url": "/path/to/something"
			},
			"response": []
		}
	],
	"protocolProfileBehavior": {}
}

Postman方式导入以上JSON

期望结果

有Header信息

软件环境

Postman导出格式版本:v2.0

私有部署中文乱码

Bug 描述
接口的状态是乱码的,但是如果改变状态,会出现中文,刷新后又回到乱码状态

截图
image

image

image

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.