Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
quantum-blocks-h5
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ui
quantum-blocks-h5
Commits
a2b960ef
Commit
a2b960ef
authored
May 28, 2021
by
郭志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 问题修复
parent
09fa2065
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
30 additions
and
26 deletions
+30
-26
.gitignore
.gitignore
+1
-0
activity.ts
app/controller/activity.ts
+3
-4
editor.api.ts
app/web/api/editor.api.ts
+1
-1
prod.config.ts
app/web/config/prod.config.ts
+0
-11
test.config.ts
app/web/config/test.config.ts
+15
-5
typings.d.ts
app/web/config/typings.d.ts
+4
-0
app.ts
app/web/framework/app.ts
+0
-1
server.js
bin/server.js
+3
-1
config.sit.ts
config/config.sit.ts
+3
-3
No files found.
.gitignore
View file @
a2b960ef
...
@@ -18,6 +18,7 @@ config/plugin.local.js
...
@@ -18,6 +18,7 @@ config/plugin.local.js
config/plugin.js
config/plugin.js
config/config.*.js
config/config.*.js
config/apollo.json
config/apollo.json
config/apollo.ssr.json
index.js
index.js
config/manifest.json
config/manifest.json
app/view/*
app/view/*
...
...
app/controller/activity.ts
View file @
a2b960ef
...
@@ -10,10 +10,9 @@ export default class ActivityController extends Controller {
...
@@ -10,10 +10,9 @@ export default class ActivityController extends Controller {
}
}
if
(
!
body
)
{
if
(
!
body
)
{
let
apollo
=
{};
let
apollo
=
{};
// if (process.env.NODE_ENV === 'production') {
if
(
process
.
env
.
NODE_ENV
===
'
production
'
&&
process
.
env
.
EGG_SERVER_ENV
===
'
sit
'
)
{
// const { api, qiniu } = ctx.app.config.apollo || {};
apollo
=
ctx
.
app
.
config
.
apollo
||
{};
// apollo = { ...api, ...qiniu };
}
// }
body
=
await
ctx
.
renderView
(
'
activity.js
'
,
{
url
:
ctx
.
url
,
apollo
});
body
=
await
ctx
.
renderView
(
'
activity.js
'
,
{
url
:
ctx
.
url
,
apollo
});
await
ctx
.
service
.
redis
.
set
(
redisKey
,
body
);
await
ctx
.
service
.
redis
.
set
(
redisKey
,
body
);
}
}
...
...
app/web/api/editor.api.ts
View file @
a2b960ef
...
@@ -3,6 +3,6 @@ import config from '../config';
...
@@ -3,6 +3,6 @@ import config from '../config';
export
default
{
export
default
{
getPageById
(
params
)
{
getPageById
(
params
)
{
return
http
.
get
(
`
${
config
.
apiHost
}
editor/get/
${
params
.
pageId
}
`
);
return
http
.
get
(
`
${
config
.
apiHost
}
/
editor/get/
${
params
.
pageId
}
`
);
}
}
};
};
\ No newline at end of file
app/web/config/prod.config.ts
View file @
a2b960ef
...
@@ -6,15 +6,4 @@ const hostMap = {
...
@@ -6,15 +6,4 @@ const hostMap = {
test
:
false
test
:
false
};
};
if
(
EASY_ENV_IS_BROWSER
)
{
const
apolloCfg
=
window
.
apollo
||
window
.
__INITIAL_STATE__
.
apollo
;
if
(
apolloCfg
)
{
for
(
const
key
in
apolloCfg
)
{
if
(
apolloCfg
[
key
])
{
hostMap
[
key
]
=
apolloCfg
[
key
];
}
}
}
}
export
default
hostMap
;
export
default
hostMap
;
app/web/config/test.config.ts
View file @
a2b960ef
import
apolloSsr
from
'
../../../config/apollo.ssr.json
'
;
const
protocol
=
EASY_ENV_IS_BROWSER
?
window
.
location
.
protocol
:
'
https
'
;
const
protocol
=
EASY_ENV_IS_BROWSER
?
window
.
location
.
protocol
:
'
https
'
;
const
hostMap
=
{
const
hostMap
=
{
...
@@ -7,11 +8,20 @@ const hostMap = {
...
@@ -7,11 +8,20 @@ const hostMap = {
};
};
if
(
EASY_ENV_IS_BROWSER
)
{
if
(
EASY_ENV_IS_BROWSER
)
{
const
apolloCfg
=
window
.
apollo
||
window
.
__INITIAL_STATE__
.
apollo
;
const
apolloWin
=
window
.
apollo
||
window
.
__INITIAL_STATE__
.
apollo
;
if
(
apolloCfg
)
{
if
(
apolloWin
)
{
for
(
const
key
in
apolloCfg
)
{
for
(
const
key
in
apolloWin
)
{
if
(
apolloCfg
[
key
])
{
if
(
apolloWin
[
key
])
{
hostMap
[
key
]
=
apolloCfg
[
key
];
hostMap
[
key
]
=
apolloWin
[
key
];
}
}
}
}
if
(
EASY_ENV_IS_NODE
)
{
if
(
apolloSsr
)
{
for
(
const
key
in
apolloSsr
)
{
if
(
apolloSsr
[
key
])
{
hostMap
[
key
]
=
apolloSsr
[
key
];
}
}
}
}
}
}
...
...
app/web/config/typings.d.ts
0 → 100644
View file @
a2b960ef
declare
module
"
*.json
"
{
const
value
:
any
;
export
default
value
;
}
\ No newline at end of file
app/web/framework/app.ts
View file @
a2b960ef
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
{
sync
}
from
'
vuex-router-sync
'
;
import
{
sync
}
from
'
vuex-router-sync
'
;
import
initService
from
'
@/service/init.service
'
;
import
initService
from
'
@/service/init.service
'
;
export
default
class
App
{
export
default
class
App
{
config
:
any
;
config
:
any
;
constructor
(
config
)
{
constructor
(
config
)
{
...
...
bin/server.js
View file @
a2b960ef
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
"
use strict
"
;
"
use strict
"
;
const
path
=
require
(
'
path
'
);
const
path
=
require
(
'
path
'
);
const
fs
=
require
(
'
fs
'
);
const
apollo
=
require
(
'
@qg/apollo-nodejs
'
);
const
apollo
=
require
(
'
@qg/apollo-nodejs
'
);
const
npm
=
require
(
"
npm
"
);
const
npm
=
require
(
"
npm
"
);
...
@@ -10,7 +11,8 @@ npm.load(() => {
...
@@ -10,7 +11,8 @@ npm.load(() => {
appId
:
'
quantum-block-h5
'
,
appId
:
'
quantum-block-h5
'
,
configPath
:
path
.
resolve
(
__dirname
,
'
../config
'
),
configPath
:
path
.
resolve
(
__dirname
,
'
../config
'
),
}).
then
(()
=>
{
}).
then
(()
=>
{
console
.
log
(
"
>>> apollo file
"
,
require
(
path
.
resolve
(
'
./config/apollo.json
'
)));
const
{
api
,
qiniu
}
=
require
(
path
.
resolve
(
'
./config/apollo.json
'
));
fs
.
writeFileSync
(
path
.
resolve
(
'
./config/apollo.ssr.json
'
),
JSON
.
stringify
({
...
api
,
...
qiniu
}));
if
(
process
.
env
.
NODE_ENV
===
'
production
'
)
{
if
(
process
.
env
.
NODE_ENV
===
'
production
'
)
{
npm
.
run
(
"
start
"
);
npm
.
run
(
"
start
"
);
}
else
{
}
else
{
...
...
config/config.sit.ts
View file @
a2b960ef
import
{
Application
,
EggAppConfig
}
from
'
egg
'
;
import
{
Application
,
EggAppConfig
}
from
'
egg
'
;
const
path
=
require
(
'
path
'
);
const
path
=
require
(
'
path
'
);
const
{
redis
,
api
,
qiniu
}
=
require
(
path
.
resolve
(
'
./config/apollo.json
'
));
export
default
(
appInfo
:
EggAppConfig
)
=>
{
export
default
(
appInfo
:
EggAppConfig
)
=>
{
const
exports
:
any
=
{};
const
exports
:
any
=
{};
exports
.
logger
=
{
exports
.
logger
=
{
dir
:
'
/home/quant_group/logs
'
,
dir
:
'
/home/quant_group/logs
'
,
};
};
const
{
redis
}
=
require
(
path
.
resolve
(
'
./config/apollo.json
'
));
exports
.
redis
=
{
exports
.
redis
=
{
client
:
redis
client
:
redis
};
};
return
exports
;
return
{...
exports
,
apollo
:
{
...
api
,
...
qiniu
}}
;
};
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment