Browse Source

获取apiroot

release_0.0.4
巴林闲侠 2 years ago
parent
commit
7cb54cc3dd
  1. 4
      api/log/development.log
  2. 4
      web/client/index.ejs
  3. 2
      web/client/index.html
  4. 6
      web/client/src/layout/actions/global.js
  5. 8
      web/config.js
  6. 2
      web/routes/attachment/index.js

4
api/log/development.log

@ -10008,3 +10008,7 @@
2022-07-27 15:49:28.071 - error: path: /vehicle/3/specific, error: TypeError: Cannot read property 'destroy' of undefined 2022-07-27 15:49:28.071 - error: path: /vehicle/3/specific, error: TypeError: Cannot read property 'destroy' of undefined
2022-07-27 15:50:36.847 - error: path: /vehicle/3/specific, error: TypeError: Cannot read property 'destroy' of undefined 2022-07-27 15:50:36.847 - error: path: /vehicle/3/specific, error: TypeError: Cannot read property 'destroy' of undefined
2022-07-27 15:51:05.608 - error: path: /vehicle/3/specific, error: TypeError: Cannot read property 'destroy' of undefined 2022-07-27 15:51:05.608 - error: path: /vehicle/3/specific, error: TypeError: Cannot read property 'destroy' of undefined
2022-07-28 10:56:48.597 - debug: [FS-LOGGER] Init.
2022-07-28 10:56:48.738 - info: [FS-ATTACHMENT] Inject attachment mw into router.
2022-07-28 10:56:48.738 - info: [FS-AUTH] Inject auth and api mv into router.
2022-07-28 11:01:45.098 - error: path: /department, error: 部门名称重复

4
web/client/index.ejs

@ -18,12 +18,12 @@
</head> </head>
<body style="background: transparent"> <body style="background: transparent">
<link <!-- <link
rel="stylesheet/less" rel="stylesheet/less"
type="text/css" type="text/css"
href="/assets/color.less" href="/assets/color.less"
rel="external nofollow" rel="external nofollow"
/> /> -->
<script> <script>
window.less = { window.less = {

2
web/client/index.html

@ -18,7 +18,7 @@
</head> </head>
<body> <body>
<link rel="stylesheet/less" type="text/css" href="/assets/color.less" rel="external nofollow" /> <!-- <link rel="stylesheet/less" type="text/css" href="/assets/color.less" rel="external nofollow" /> -->
<script> <script>
window.less = { window.less = {
async: false, async: false,

6
web/client/src/layout/actions/global.js

@ -3,7 +3,7 @@ import { RouteRequest } from '@peace/utils';
import { RouteTable } from '$utils' import { RouteTable } from '$utils'
export const INIT_LAYOUT = 'INIT_LAYOUT'; export const INIT_LAYOUT = 'INIT_LAYOUT';
export function initLayout(title, copyright, sections, actions) { export function initLayout (title, copyright, sections, actions) {
return { return {
type: INIT_LAYOUT, type: INIT_LAYOUT,
payload: { payload: {
@ -16,7 +16,7 @@ export function initLayout(title, copyright, sections, actions) {
} }
export const RESIZE = 'RESIZE'; export const RESIZE = 'RESIZE';
export function resize(clientHeight, clientWidth) { export function resize (clientHeight, clientWidth) {
return { return {
type: RESIZE, type: RESIZE,
payload: { payload: {
@ -27,7 +27,7 @@ export function resize(clientHeight, clientWidth) {
} }
export const INIT_API_ROOT = 'INIT_API_ROOT'; export const INIT_API_ROOT = 'INIT_API_ROOT';
export function initApiRoot() { export function initApiRoot () {
return dispatch => { return dispatch => {
RouteRequest.get(RouteTable.apiRoot).then(res => { RouteRequest.get(RouteTable.apiRoot).then(res => {
localStorage.setItem('tyApiRoot', res.root); localStorage.setItem('tyApiRoot', res.root);

8
web/config.js

@ -41,16 +41,16 @@ const product = {
host: 'https://report.amap.com', host: 'https://report.amap.com',
match: /^\/_godTrans\//, match: /^\/_godTrans\//,
} }
}, {
entry: require('./client').entry,// 静态信息
opts: {}
}, { }, {
entry: require('./routes').entry, entry: require('./routes').entry,
opts: { opts: {
apiUrl: FS_UNIAPP_API, apiUrl: FS_UNIAPP_API,
staticRoot: './client', staticRoot: './client',
} }
},], }, {
entry: require('./client').entry,// 静态信息
opts: {}
}],
logger: { logger: {
level: 'debug', level: 'debug',
json: false, json: false,

2
web/routes/attachment/index.js

@ -17,10 +17,8 @@ const ext = {
module.exports = { module.exports = {
entry: function (app, router, opts) { entry: function (app, router, opts) {
const getApiRoot = async function (ctx) { const getApiRoot = async function (ctx) {
const { apiUrl } = opts; const { apiUrl } = opts;
ctx.status = 200; ctx.status = 200;
ctx.body = { root: apiUrl }; ctx.body = { root: apiUrl };
}; };

Loading…
Cancel
Save