Commit 412cdc85 authored by 郭志伟's avatar 郭志伟

build: apollo调试

parent 22e4e0a7
......@@ -11,7 +11,8 @@ export default class EditorController extends Controller {
public async home(ctx: Context) {
const { api, qiniu } = await import(path.resolve('./config/apollo.json'));
await ctx.renderClient('editor.js', {
apollo: process.env.NODE_ENV === 'production' ? `var apollo = ${JSON.stringify({...api, ...qiniu})};` : 'var apollo = {};'
apollo: process.env.NODE_ENV === 'production' ? JSON.stringify({...api, ...qiniu}) : {}
// apollo: {...api, ...qiniu}
});
}
......
const protocol = EASY_ENV_IS_BROWSER ? window.location.protocol : 'https';
export default {
apiHost: `https://quantum-blocks.q-gp.com/`,
h5Host: 'https://quantum-h5.q-gp.com/',
qiniuHost: `https://appsync.lkbang.net/`,
const hostMap = {
apiHost: `${protocol}//quantum-blocks.q-gp.com/`,
h5Host: '${protocol}//quantum-h5.q-gp.com/',
qiniuHost: `${protocol}//appsync.lkbang.net/`,
shenceUrl: `${protocol}//bn.xyqb.com/sa?project=production`,
opapiHost: `${protocol}//opapi.q-gp.com`,
qiniuUpHost: `${protocol}//up-z0.qiniup.com`,
};
if (EASY_ENV_IS_BROWSER) {
const apolloCfg = window.apollo || window.__INITIAL_STATE__.apollo;
if (!apolloCfg) {
for (const key in apolloCfg) {
if (Object.hasOwnProperty.call(apolloCfg, key)) {
hostMap[key] = apolloCfg[key];
}
}
}
}
export default hostMap;
\ No newline at end of file
const protocol = EASY_ENV_IS_BROWSER ? window.location.protocol : 'https';
export default {
apiHost: `https://quantum-blocks-test1.liangkebang.net/`,
h5Host: 'https://quantum-h5-test1.liangkebang.net/',
opapiHost: 'https://opapi-test1.liangkebang.net',
qiniuHost: `https://appsync.lkbang.net/`,
shenceUrl: `${protocol}//bn.xyqb.com/sa?project=production`,
qiniuUpHost: `${protocol}//up-z0.qiniup.com`,
};
// const protocol = EASY_ENV_IS_BROWSER ? window.location.protocol : 'https';
// export default {
// ...(EASY_ENV_IS_BROWSER ? window.apollo : {}),
// shenceUrl: `${protocol}//bn.xyqb.com/sa?project=production`,
// };
const hostMap = {
apiHost: `${protocol}//quantum-blocks-test1.liangkebang.net/`,
h5Host: '${protocol}//quantum-h5-test1.liangkebang.net/',
opapiHost: '${protocol}//opapi-test1.liangkebang.net',
qiniuHost: `${protocol}//appsync.lkbang.net/`,
shenceUrl: `${protocol}//bn.xyqb.com/sa?project=production`,
qiniuUpHost: `${protocol}//up-z0.qiniup.com`,
};
if (EASY_ENV_IS_BROWSER) {
const apolloCfg = window.apollo || window.__INITIAL_STATE__.apollo;
if (!apolloCfg) {
for (const key in apolloCfg) {
if (Object.hasOwnProperty.call(apolloCfg, key)) {
hostMap[key] = apolloCfg[key];
}
}
}
}
export default hostMap;
......@@ -30,7 +30,5 @@
<script src="https://activitystatic.lkbang.net/sa-sdk-javascript/1.15.16/sensorsdata.min.js"></script>
<script src="https://activitystatic.lkbang.net/swiper/4.5.1/swiper.min.js"></script>
<script src="https://activitystatic.lkbang.net/axios/0.19.2/axios.min.js"></script>
<script v-html="apollo" ignore>
</script>
</body>
</html>
\ No newline at end of file
{
"api": {
"apiHost": "https://quantum-blocks-vcc2.liangkebang.net/",
"h5Host": "https://quantum-h5-vcc2.liangkebang.net/",
"opapiHost": "https://opapi-vcc2.liangkebang.net/",
"passportHost": "https://passportapi-vcc2.liangkebang.net",
"kdspHost": "https://talos-vcc2.liangkebang.net"
"apiHost": "https://quantum-blocks-test1.liangkebang.net/",
"h5Host": "https://quantum-h5-test1.liangkebang.net/",
"opapiHost": "https://opapi-test1.liangkebang.net/",
"passportHost": "https://passportapi-test1.liangkebang.net",
"kdspHost": "https://talos-test1.liangkebang.net"
},
"mysql": {
"low_code": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment