Commit 9f058c84 authored by 郭志伟's avatar 郭志伟

feat: 调整接口传参

parent 41eefa03
......@@ -6,7 +6,7 @@ export default class ActivityController extends Controller {
const apollo = ctx.app.config.apollo || {};
let body = '';
if (process.env.NODE_ENV === 'development') {
body = await ctx.renderToHtml('activity.js', { url: ctx.url, apollo });
body = await ctx.renderToHtml('activity.js', { url: ctx.url, apollo });
} else {
const redisKey = `quantum-blocks:page:${ctx.params.id}`;
body = await ctx.service.redis.get(redisKey);
......
......@@ -2,8 +2,9 @@ import apolloSsr from '../../../config/apollo.ssr.json';
const protocol = EASY_ENV_IS_BROWSER ? window.location.protocol : 'https:';
const hostMap = {
apiHost: `${protocol}//quantum-blocks-test1.liangkebang.net`,
kdspHost: `${protocol}//talos-test1.liangkebang.net`,
apiHost: `${protocol}//localhost:7002`,
talosHost: `${protocol}//talos-test1.liangkebang.net`,
kdspHost: `${protocol}//kdsp-api-test1.liangkebang.net`,
shenceUrl: `${protocol}//bn.xyqb.com/sa?project=default`,
mallHost: `${protocol}//mall-test1.liangkebang.net`,
test: true,
......
// tslint:disable
import { isAndroid, isIOS, isWxMp } from '@/service/utils.service';
import { isAndroid, isIOS, isWxMp, isApp } from '@/service/utils.service';
import localStorage from '@/service/localStorage.service';
import Toast from '@qg/cherry-ui/src/toast';
......@@ -68,7 +68,20 @@ export default {
cfg.headers['X-Auth-Token'] = localStorage.get('creditToken');
}
if (!cfg.hideTerminal) {
cfg.headers['x-user-terminal'] = isWxMp ? 'MINI-APP' : 'H5'; // 全局暂定H5
let terminal = '';
if (isApp) {
terminal = isAndroid ? 'ANDROID' : 'IOS';
} else if (isWxMp) {
terminal = 'MINI-APP';
} else if (
window.__INITIAL_STATE__.isEditor &&
cfg.hideTerminalInEditor
) {
terminal = '';
} else {
terminal = 'H5';
}
cfg.headers['x-user-terminal'] = terminal;
}
if (!hideVccChannel) {
cfg.headers['vccChannel'] = getVccChannel();
......
......@@ -4,7 +4,8 @@ const protocol = EASY_ENV_IS_BROWSER ? window.location.protocol : 'https:';
const hostMap = {
apiHost: `${protocol}//quantum-blocks.q-gp.com`,
kdspHost: `${protocol}//talos.q-gp.com`,
talosHost: `${protocol}//talos.q-gp.com`,
kdspHost: `${protocol}//kdsp-api.q-gp.com`,
shenceUrl: `${protocol}//bn.xyqb.com/sa?project=production`,
mallHost: `${protocol}//mall.q-gp.com`,
test: false,
......
......@@ -3,7 +3,8 @@ const protocol = EASY_ENV_IS_BROWSER ? window.location.protocol : 'https:';
const hostMap = {
apiHost: `${protocol}//quantum-blocks-test1.liangkebang.net`,
kdspHost: `${protocol}//talos-test1.liangkebang.net`,
talosHost: `${protocol}//talos-test1.liangkebang.net`,
kdspHost: `${protocol}//kdsp-api-test1.liangkebang.net`,
shenceUrl: `${protocol}//bn.xyqb.com/sa?project=default`,
mallHost: `${protocol}//mall-test1.liangkebang.net`,
test: true,
......
......@@ -24,6 +24,7 @@ export default class App {
const router = createRouter();
sync(store, router);
if (EASY_ENV_IS_BROWSER) {
window.QUANTUM_BLOCKS_IS_EDITTOR = false;
const { initSa } = require('@/service/sa.service');
initService.init(router);
initSa(router);
......
{
"api": {
"apiHost": "https://quantum-blocks-undefined.liangkebang.net",
"h5Host": "https://quantum-h5-undefined.liangkebang.net",
"opapiHost": "https://opapi-undefined.liangkebang.net",
"passportHost": "https://passportapi-undefined.liangkebang.net",
"kdspHost": "https://talos-undefined.liangkebang.net",
"apiHost": "http://localhost:7002",
"h5Host": "https://quantum-h5-test1.liangkebang.net",
"opapiHost": "https://opapi-test1.liangkebang.net",
"passportHost": "https://passportapi-test1.liangkebang.net",
"talosHost": "https://talos-test1.liangkebang.net",
"kdspHost": "https://kdsp-api-test1.liangkebang.net",
"loginUrl": "",
"h5ShopHost": "https://tenet-undefined.liangkebang.net/#",
"mallHost": "https://mall-undefined.liangkebang.net",
"h5ShopHost": "https://tenet-test1.liangkebang.net/#",
"mallHost": "https://mall-test1.liangkebang.net",
"yxmTenantId": 560761,
"appIdMap": {
"560761": "wxe16bf9293671506c",
......@@ -15,8 +16,8 @@
}
},
"redis": {
"port": "undefined",
"host": "undefined",
"port": "32625",
"host": "172.17.5.3",
"password": "",
"db": 0
},
......
{"apiHost":"https://quantum-blocks-undefined.liangkebang.net","h5Host":"https://quantum-h5-undefined.liangkebang.net","opapiHost":"https://opapi-undefined.liangkebang.net","passportHost":"https://passportapi-undefined.liangkebang.net","kdspHost":"https://talos-undefined.liangkebang.net","loginUrl":"","h5ShopHost":"https://tenet-undefined.liangkebang.net/#","mallHost":"https://mall-undefined.liangkebang.net","yxmTenantId":560761,"appIdMap":{"560761":"wxe16bf9293671506c","560867":"wxccb8435d68e8c7d6"},"qiniuUpHost":"https://up-z0.qiniup.com","qiniuHost":"https://appsync.lkbang.net"}
\ No newline at end of file
{"apiHost":"http://localhost:7002","h5Host":"https://quantum-h5-test1.liangkebang.net","opapiHost":"https://opapi-test1.liangkebang.net","passportHost":"https://passportapi-test1.liangkebang.net","talosHost":"https://talos-test1.liangkebang.net","kdspHost":"https://kdsp-api-test1.liangkebang.net","loginUrl":"","h5ShopHost":"https://tenet-test1.liangkebang.net/#","mallHost":"https://mall-test1.liangkebang.net","yxmTenantId":560761,"appIdMap":{"560761":"wxe16bf9293671506c","560867":"wxccb8435d68e8c7d6"},"qiniuUpHost":"https://up-z0.qiniup.com","qiniuHost":"https://appsync.lkbang.net"}
\ No newline at end of file
......@@ -2367,9 +2367,9 @@
}
},
"@qg/citrus-ui": {
"version": "0.3.38",
"resolved": "http://npmprivate.quantgroups.com/@qg%2fcitrus-ui/-/citrus-ui-0.3.38.tgz",
"integrity": "sha512-3192nZfqeW5sD35+tpUZvI2CseCKTFmc2bBkwDtZ65iINekRl+HrrO7E2WeiaYQCVjbC5Hac0UaSRI42zob5LQ==",
"version": "0.3.39-beta1",
"resolved": "http://npmprivate.quantgroups.com/@qg%2fcitrus-ui/-/citrus-ui-0.3.39-beta1.tgz",
"integrity": "sha512-Nh3vhO/EkDUkOrp08J4e6VgmwaNKp+2Edw2WhRm0s5VKRTkH7V/1tzYW0AoTTlT4G8T3ACOzVBhJ5Y+V5d5i7A==",
"requires": {
"@better-scroll/core": "^2.1.1",
"@qg/cherry-ui": "^2.23.9",
......@@ -23150,9 +23150,9 @@
}
},
"sa-sdk-javascript": {
"version": "1.21.11",
"resolved": "http://npmprivate.quantgroups.com/sa-sdk-javascript/-/sa-sdk-javascript-1.21.11.tgz",
"integrity": "sha512-KBX9Uddl6M91ZHbUaBGcB3JJE/wnYi7AfGGv3XBgdO2MpdQ7UNRsQ6g+11/qMme2J464DsUJcmz85Ey9L7RI2A=="
"version": "1.22.2",
"resolved": "http://npmprivate.quantgroups.com/sa-sdk-javascript/-/sa-sdk-javascript-1.22.2.tgz",
"integrity": "sha512-vRFycoUvtTxCRBVgO2J+CnoDcf4OyZ3AjKoWhb8cmXLYv/sjRH/VEjhKv5Z99tC7whx2eU4brXZ3HrFnxMTRAA=="
},
"safe-buffer": {
"version": "5.2.1",
......@@ -8,7 +8,7 @@
"test": "cross-env NODE_ENV=production EGG_SERVER_ENV=sit egg-scripts start --port 80 --workers 1",
"stop": "egg-scripts stop",
"backend": "nohup egg-scripts start --port 7001 --workers 4",
"dev": "egg-bin dev -r egg-ts-helper/register",
"dev": "cross-env NODE_ENV=test APOLLO_CLUSTER=k8s NAMESPACE=test1 npm run apollo && egg-bin dev -r egg-ts-helper/register",
"debug": "egg-bin debug -r egg-ts-helper/register",
"apollo": "node bin/apollo.js",
"build": "cross-env NODE_ENV=production APOLLO_CLUSTER=3C npm run apollo && cross-env COS_ENV=production easy build --devtool",
......@@ -26,7 +26,7 @@
"@better-scroll/core": "^2.0.5",
"@qg/apollo-nodejs": "^2.1.2",
"@qg/cherry-ui": "2.23.10",
"@qg/citrus-ui": "0.3.38",
"@qg/citrus-ui": "0.3.39-beta1",
"@qg/js-bridge": "^1.1.12",
"babel-plugin-transform-vue-jsx": "^4.0.1",
"cos-nodejs-sdk-v5": "^2.9.12",
......
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