• Monthly Archives: 7月 2022

Restful 返回数据格式

返回数据的一般格式:

{
“code”: 1,
“mssage”: “返回的信息”,
“data”: {
“list”:[
{
“title”:”xxx”,
“contents”:”xxx”,
},{
“title”:”xxx”,
“contents”:”xxx”,
}
]
“total”:21,
},
“extra”: {},
“pageNum”: 3,
“pageSize”: 20,
“totalSize”: 235
}

code的一般含义

public enum ResultCode {

  /* 成功状态码 */
  SUCCESS(0, "成功"),

  /* 令牌失效 */
  TOKEN_INVALID(401,"令牌失效"),

  SERVER_ERROR(400, "服务器错误"),

  /*参数错误 10001-19999 */

  PARAM_IS_INVALID(10001, "参数无效"),
  PARAM_IS_BLANK(10002, "参数为空"),
  PARAM_TYPE_BIND_ERROR(10003, "参数类型错误"),
  PARAM_NOT_COMPLETE(10004, "参数缺失"),

  /* 用户错误:20001-29999*/
  USER_NOT_LOGGED_IN(20001, "用户未登录"),
  USER_LOGIN_ERROR(20002, "账号不存在或密码错误"),
  USER_ACCOUNT_FORBIDDEN(20003, "账号已被禁用"),
  USER_NOT_EXIST(20004, "用户不存在"),
  USER_HAS_EXISTED(20005, "用户已存在"),
  Cert_HAS_EXISTED(20006, "认证已存在"),


  /* 业务错误:30001-39999 */
  CREATE_FAIL(30001, "创建失败"),

  /* 系统错误:40001-49999 */
  SYSTEM_INNER_ERROR(40001, "系统繁忙,请稍后重试"),

  /* 数据错误:50001-599999 */
  RESULE_DATA_NONE(50001, "数据未找到"),
  DATA_IS_WRONG(50002, "数据有误"),
  DATA_ALREADY_EXISTED(50003, "数据已存在"),

  /* 接口错误:60001-69999 */
  INTERFACE_INNER_INVOKE_ERROR(60001, "内部系统接口调用异常"),
  INTERFACE_OUTTER_INVOKE_ERROR(60002, "外部系统接口调用异常"),
  INTERFACE_FORBID_VISIT(60003, "该接口禁止访问"),
  INTERFACE_ADDRESS_INVALID(60004, "接口地址无效"),
  INTERFACE_REQUEST_TIMEOUT(60005, "接口请求超时"),
  INTERFACE_EXCEED_LOAD(60006, "接口负载过高"),

  /* 权限错误:70001-79999 */
  PERMISSION_NO_ACCESS(70001, "只有标签 Owner ,才具备删除权限"),
  PERMISSION_NO_PHONE_ACCESS(70002,"此认证标签已有员工认证,不可以进行删除");
  
}

 

Vue3-cli/Ant-design-pro-vue修改运行在子路径上

版本依赖情况:

PS D:\suidian-yuexi\admin> npm list vue
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
vue-antd-pro@3.0.2 D:\suidian-yuexi\admin
+-- @ant-design-vue/pro-layout@1.0.13
| +-- vue-container-query@0.1.0
| | `-- vue@2.7.3 deduped
| +-- vue-copy-to-clipboard@1.0.3
| | `-- vue@2.7.3 deduped
| `-- vue@2.7.3 deduped
+-- @vue/cli-plugin-babel@4.5.19
| `-- @vue/babel-preset-app@4.5.19
|   +-- @vue/babel-preset-jsx@1.3.0
|   | `-- vue@2.7.3 deduped
|   `-- vue@2.7.3 deduped
+-- @vue/cli-plugin-unit-jest@4.5.19
| `-- vue-jest@3.0.7
|   `-- vue@2.7.3 deduped
+-- @vue/test-utils@1.3.0
| `-- vue@2.7.3 deduped
+-- ant-design-vue@1.7.8
| +-- @ant-design/icons-vue@2.0.0
| `-- vue@2.7.3 deduped
+-- viser-vue@2.4.8
| `-- vue@2.7.3 deduped
+-- vue-svg-component-runtime@1.0.1
| `-- vue@2.7.3 deduped
+-- vue-svg-icon-loader@2.1.1
| +-- vue-svg-component-builder@2.0.3
| | `-- vue@2.7.3 deduped
| `-- vue@2.7.3 deduped
+-- vue@2.7.3
`-- vuex@3.6.2
  `-- vue@2.7.3 deduped

PS D:\suidian-yuexi\admin> npm run serve
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.

> vue-antd-pro@3.0.2 serve
> vue-cli-service serve

 

1、修改项目运行路径,打开vue.config.js文件,在vueConfig的json中增加:

publicPath: "/admin2/",

2、修改路由的基础路径,打开index.js文件,在createRouter的new Router对象时传入的json增加:

base: '/admin2',

3、重启服务即可

安装RabbitMQ

一、安装ERLANG

RabbitMQ依赖语言开发包ErLang,到http://www.erlang.org/downloads下载windows版本并安装,安装后需要配置环境变量:

1、增加系统变量:ERLANG_HOME=C:\Program Files\erl-23.0

2、在Path系统变量中增加:%ERLANG_HOME%\bin

然后在CMD中输入指令“erl”即可验证是否配置成功:

111

 

 

二、安装RabbitMQ

到https://www.rabbitmq.com/download.html下载windows版本病安装,安装后需要配置环境变量:

1、增加系统变量:RABBITMQ_SERVER=C:\Program Files\RabbitMQ Server\rabbitmq_server-3.8.3

2、在Path系统变量中增加:%RABBITMQ_SERVER%\sbin

三、激活RabbitMQ的WEB管理界面(可选)

打开CMD执行命令:rabbitmq-plugins.bat enable rabbitmq_management

222

执行成功后重启RabbitMQ服务(可到“服务”中重启,或在任务栏中也能找到相关菜单),然后访问网址:http://localhost:15672/

333

默认用户名/密码:guest/guest

登录后出现如下界面:

444

close