编译routerr时,namespaces下的index.json的path不一定配置,这里判断下
This commit is contained in:
parent
2b43b36c26
commit
4e11d40e3c
|
|
@ -101,9 +101,15 @@ function makeWebAllRouters(namespaceDir, projectDir, routerFileDir) {
|
|||
let notFound2 = '', first2 = '';
|
||||
if ((0, fs_extra_1.existsSync)(nsIndexJsonFile)) {
|
||||
const { path, notFound, first } = require(nsIndexJsonFile);
|
||||
path2 = path.replace(/\\/g, '/');
|
||||
notFound2 = notFound.replace(/\\/g, '/');
|
||||
first2 = first.replace(/\\/g, '/');
|
||||
if (path) {
|
||||
path2 = path.replace(/\\/g, '/');
|
||||
}
|
||||
if (notFound) {
|
||||
notFound2 = notFound.replace(/\\/g, '/');
|
||||
}
|
||||
if (first) {
|
||||
first2 = first.replace(/\\/g, '/');
|
||||
}
|
||||
}
|
||||
const children = Object.values(pages).filter((ele) => ele.hasWeb).map(({ path, oakDisablePulldownRefresh }) => {
|
||||
const properties = [
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class SimpleConnector {
|
|||
}
|
||||
catch (err) {
|
||||
// fetch返回异常一定是网络异常
|
||||
throw new types_1.OakNetworkException();
|
||||
throw new types_1.OakNetworkException(`请求[${this.serverAspectUrl}],发生网络异常`);
|
||||
}
|
||||
if (response.status > 299) {
|
||||
const err = new types_1.OakServerProxyException(`网络请求返回status是${response.status}`);
|
||||
|
|
|
|||
|
|
@ -162,9 +162,15 @@ function makeWebAllRouters(namespaceDir: string, projectDir: string, routerFileD
|
|||
let notFound2 = '', first2 = '';
|
||||
if (existsSync(nsIndexJsonFile)) {
|
||||
const { path, notFound, first } = require(nsIndexJsonFile);
|
||||
path2 = path.replace(/\\/g, '/');
|
||||
notFound2 = notFound.replace(/\\/g, '/');
|
||||
first2 = first.replace(/\\/g, '/');
|
||||
if (path) {
|
||||
path2 = path.replace(/\\/g, '/');
|
||||
}
|
||||
if (notFound) {
|
||||
notFound2 = notFound.replace(/\\/g, '/');
|
||||
}
|
||||
if (first) {
|
||||
first2 = first.replace(/\\/g, '/');
|
||||
}
|
||||
}
|
||||
const children = Object.values(pages).filter(
|
||||
(ele) => ele.hasWeb
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ export class SimpleConnector<ED extends EntityDict, FrontCxt extends SyncContext
|
|||
});
|
||||
} catch (err) {
|
||||
// fetch返回异常一定是网络异常
|
||||
throw new OakNetworkException();
|
||||
throw new OakNetworkException(`请求[${this.serverAspectUrl}],发生网络异常`);
|
||||
}
|
||||
if (response.status > 299) {
|
||||
const err = new OakServerProxyException(
|
||||
|
|
|
|||
Loading…
Reference in New Issue