代码拉取完成,页面将自动刷新
同步操作将从 Apache ShenYu/shenyu-dashboard 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import mockjs from 'mockjs';
import { getNotices } from './mock/notices';
import { getUsers } from './mock/user';
import { getPlatform } from './mock/platform'
import { getPlugin } from './mock/plugin'
import { format, delay } from 'roadhog-api-doc';
// 是否禁用代理
const noProxy = process.env.NO_PROXY === 'true';
// 代码中会兼容本地 service mock 以及部署站点的静态数据
const proxy = {
'GET /platform': {
$body: getPlatform,
},
'GET /dashboardUser': {
$params: {
userName: 'ADMIN',
currentPage: 1,
pageSize: 10,
},
$body: getUsers(),
},
'GET /dashboardUser/1': {
"code": 200,
"message": "detail dashboard user success",
"data": {
"id": "1",
"userName": "admin",
"password": "123456",
"role": 1,
"enabled": false,
"dateCreated": "2018-06-23 15:12:22",
"dateUpdated": "2018-06-23 15:12:23"
}
},
'POST /dashboardUser': {
$body: {
code: 200
},
},
'PUT /dashboardUser/1': {
$body: {
code: 200
},
},
'POST /dashboardUser/delete': {
$body: {
code: 200
},
},
'GET /plugin': {
$body: getPlugin,
},
'GET /plugin/1': {
"code": 200,
"message": "detail dashboard user success",
"data": {
"id": "1",
"name": "admin",
"enabled": false,
}
},
'POST /plugin': {
$body: {
code: 200
},
},
'PUT /plugin/1': {
$body: {
code: 200
},
},
'POST /plugin/delete': {
$body: {
code: 200
},
},
'GET /api/notices': getNotices,
'GET /api/500': (req, res) => {
res.status(500).send({
timestamp: 1513932555104,
status: 500,
error: 'error',
message: 'error',
path: '/base/category/list',
});
},
'GET /api/404': (req, res) => {
res.status(404).send({
timestamp: 1513932643431,
status: 404,
error: 'Not Found',
message: 'No message available',
path: '/base/category/list/2121212',
});
},
'GET /api/403': (req, res) => {
res.status(403).send({
timestamp: 1513932555104,
status: 403,
error: 'Unauthorized',
message: 'Unauthorized',
path: '/base/category/list',
});
}
};
export default (noProxy ? {} : delay(proxy, 1000));
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。