Commit 11f5a69e authored by 郭志伟's avatar 郭志伟

Merge branch 'feature/tenant' into 'master'

Feature/tenant

See merge request !59
parents a06261ca 49aa723b
......@@ -3,23 +3,22 @@ export default class ActivityController extends Controller {
public async home(ctx: Context) {
// 开发环境不走redis缓存
const apollo = ctx.app.config.apollo || {};
let body = '';
if (process.env.NODE_ENV === 'development') {
ctx.body = await ctx.renderToHtml('activity.js', { url: ctx.url });
return;
}
body = await ctx.renderToHtml('activity.js', { url: ctx.url, apollo });
} else {
const redisKey = `quantum-blocks:page:${ctx.params.id}`;
let body = await ctx.service.redis.get(redisKey);
body = await ctx.service.redis.get(redisKey);
if (body) {
ctx.logger.info('请求redis成功 key: %j', redisKey);
}
if (!body) {
let apollo = {};
if (process.env.NODE_ENV === 'production' && process.env.EGG_SERVER_ENV === 'sit') {
apollo = ctx.app.config.apollo || {};
}
body = await ctx.renderToHtml('activity.js', { url: ctx.url, apollo });
await ctx.service.redis.set(redisKey, body);
}
}
ctx.body = body;
}
}
......@@ -3,18 +3,26 @@ import config from '../config';
export default {
getPageById(params) {
return http.get(`${config.apiHost}/editor/get/${params.pageId}`);
return http.get(`${config.apiHost}/editor/get/${params.pageId}?lite=1`);
},
getShopCartCount() {
return http.get(`${config.kdspHost}/api/kdsp/shop-cart/count`);
},
getMpSchema(params) {
return http.post(`${config.kdspHost}/api/kdsp/ka/info/getShareMiniUrl`, params, { emulateJSON: true });
getMpSchema(params, appId, tenantId) {
return http.post(`${config.kdspHost}/api/kdsp/ka/info/getShareMiniUrl`, params, {
emulateJSON: true,
hideToast: true,
headers: {
'mini-app-id': appId,
'qg-tenant-id': tenantId
}
});
},
getWxConfig(url = window.location.href.split('#')[0]) {
return http.post(`${config.kdspHost}/api/kdsp/wx/mp/getJsapiSign`, {
url,
appId: 'wx2f44c7fe7b08458d'
appId: 'wx2f44c7fe7b08458d',
hideLoading: true
});
}
};
\ No newline at end of file
......@@ -9,6 +9,7 @@ import SaDirective from '@qg/citrus-ui/src/helper/directives/saTrack.directive.j
import config from '@qg/citrus-ui/src/config/index.js';
import { EventBus } from '@qg/citrus-ui/src/helper/service/eventBus';
import { getParameterByName } from '../../../service/utils.service';
import localStorage from '../../../service/localStorage.service';
import lazyload from '@qg/cherry-ui/src/lazyload/index';
// 初始化sentry
......@@ -71,16 +72,19 @@ export default class Layout extends Vue {
`<script src="https://activitystatic.lkbang.net/axios/0.19.2/axios.min.js"></script>`
];
talosHost: string = config.kdspHost;
get title() {
return this.pageInfo.title || '羊小咩';
return this.pageInfo.title || this.defaultTitle();
}
get description() {
return this.pageInfo.description || '羊小咩';
return this.pageInfo.description || this.defaultTitle();
}
get keywords() {
return this.pageInfo.keywords || '羊小咩';
return this.pageInfo.keywords || this.defaultTitle();
}
defaultTitle() {
return +localStorage.get('tenantId') === 560671 ? '羊小咩' : '活动页';
}
}
\ No newline at end of file
......@@ -6,8 +6,20 @@
<meta name="description" :content="description">
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="data:image/png;base64" type="image/x-icon" />
<link rel="dns-prefetch" :href="talosHost" />
<link rel="preconnect" href="https://appsync.lkbang.net">
<link rel="dns-prefetch" href="//misc.lkbang.net">
<link rel="dns-prefetch" href="//appsync.lkbang.net">
<link rel="dns-prefetch" href="//img.lkbang.net">
<link rel="dns-prefetch" href="//img10.360buyimg.com">
<link rel="dns-prefetch" href="//img11.360buyimg.com">
<link rel="dns-prefetch" href="//img12.360buyimg.com">
<link rel="dns-prefetch" href="//img13.360buyimg.com">
<link rel="dns-prefetch" href="//img14.360buyimg.com">
<link rel="dns-prefetch" href="//img20.360buyimg.com">
<link rel="dns-prefetch" href="//img30.360buyimg.com">
<link rel="dns-prefetch" href="//kdspstatic.q-gp.com">
<!-- <link rel="stylesheet" href="/public/asset/css/reset.css"> -->
<!-- <link rel="stylesheet" type="text/css" href="https://activitystatic.lkbang.net/swiper/4.5.1/css/swiper.min.css"> -->
</head>
......
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 = {
apiHost: `${protocol}//quantum-blocks-bfe.liangkebang.net`,
kdspHost: `${protocol}//talos-bfe.liangkebang.net`,
apiHost: `${protocol}//quantum-blocks-tob.liangkebang.net`,
kdspHost: `${protocol}//talos-tob.liangkebang.net`,
shenceUrl: `${protocol}//bn.xyqb.com/sa?project=default`,
mallHost: `${protocol}://mall-bfe.liangkebang.net`,
test: true
mallHost: `${protocol}//mall-tob.liangkebang.net`,
test: true,
yxmTenantId: 560761,
appIdMap: {
560761: 'wxe16bf9293671506c',
560867: 'wxccb8435d68e8c7d6',
},
};
if (EASY_ENV_IS_BROWSER) {
......
......@@ -58,6 +58,7 @@ export default {
},
request(cfg) {
const { method, hideVccChannel } = cfg;
cfg.headers['qg-tenant-id'] = localStorage.get('tenantId') || '';
cfg.headers['X-Auth-Token'] = localStorage.get('vccToken') || '';
cfg.headers['version'] = '8.2.00';
if (cfg.customHeader) {
......
// const protocol = EASY_ENV_IS_BROWSER ? window.location.protocol : 'https';
import apolloSsr from '../../../config/apollo.ssr.json';
const protocol = EASY_ENV_IS_BROWSER ? window.location.protocol : 'https:';
export default {
apiHost: `https://quantum-blocks.q-gp.com`,
kdspHost: `https://talos.q-gp.com`,
shenceUrl: `https://bn.xyqb.com/sa?project=production`,
mallHost: `https://mall.q-gp.com`,
test: false
const hostMap = {
apiHost: `${protocol}//quantum-blocks.q-gp.com`,
kdspHost: `${protocol}//talos.q-gp.com`,
shenceUrl: `${protocol}//bn.xyqb.com/sa?project=production`,
mallHost: `${protocol}//mall.q-gp.com`,
test: false,
yxmTenantId: 560761,
appIdMap: {
560761: 'wxb3e6270e1b1e0bc7',
560867: 'wxbd0bc68b270a1dab',
},
};
if (EASY_ENV_IS_BROWSER) {
const apolloWin = window.apollo || window.__INITIAL_STATE__.apollo;
if (apolloWin) {
for (const key in apolloWin) {
if (apolloWin[key]) {
hostMap[key] = apolloWin[key];
}
}
}
}
if (EASY_ENV_IS_NODE) {
if (apolloSsr) {
for (const key in apolloSsr) {
if (apolloSsr[key]) {
hostMap[key] = apolloSsr[key];
}
}
}
}
export default hostMap;
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 = {
apiHost: `${protocol}//quantum-blocks-test1.liangkebang.net`,
kdspHost: `${protocol}//talos-test1.liangkebang.net`,
shenceUrl: `${protocol}//bn.xyqb.com/sa?project=default`,
mallHost: `${protocol}://mall-test1.liangkebang.net`,
test: true
mallHost: `${protocol}//mall-test1.liangkebang.net`,
test: true,
yxmTenantId: 560761,
appIdMap: {
560761: 'wxe16bf9293671506c',
560867: 'wxccb8435d68e8c7d6',
},
};
if (EASY_ENV_IS_BROWSER) {
......
......@@ -5,7 +5,8 @@ import { isWechat } from '@/service/utils.service';
import initService from '@/service/init.service';
export default class App {
config: any;
constructor(config) {
aysnc; constructor(config) {
this.config = config;
}
......@@ -16,7 +17,6 @@ export default class App {
}
return this.client();
}
create(initState) {
const { entry, createStore, createRouter } = this.config;
// console.log('initState', initState);
......
......@@ -6,3 +6,4 @@ interface Window {
xyqbNativeEvent: any;
}
declare var apollo: any;
declare var tenantId: any;
......@@ -24,7 +24,7 @@ import api from '@/api/editor.api';
import cfg from '@/config/index';
import localStorage from '@/service/localStorage.service';
import DisableTouchMixin from '../../../mixins/disableTouch.mixin';
import { navToDlApp } from '@qg/citrus-ui/src/helper/service/utils';
import { navToDlApp, getParameterByName } from '@qg/citrus-ui/src/helper/service/utils';
import { EventBus } from '@qg/citrus-ui/src/helper/service/eventBus';
const WEAPP_PATH = 'pages/webview/webview';
......@@ -48,12 +48,15 @@ export default {
mpSchema: '',
link: '',
shareInfo: {},
showShareOverlay: ((isWechat && !isWxMp) || isH5Normal) && !localStorage.get('vccChannel'),
showShareOverlay: ((isWechat && !isWxMp) || isH5Normal) && !(localStorage.get('vccChannel') || (localStorage.get('tenantId') && getParameterByName('fromHost', window.location.href))),
isWechat
};
},
computed: {
...mapGetters(['pageData', 'pageInfo']),
wxAppId() {
return cfg.appIdMap[this.pageInfo.tenantId] || '';
},
backTopList() {
const btAttachVal = this.pageData.props?.btAttachVal || [];
if (isDef(this.cartIndex) && this.cartIndex !== -1 && btAttachVal.length) {
......@@ -105,12 +108,13 @@ export default {
methods: {
async getMpSchema() {
if (isH5Normal && EASY_ENV_IS_BROWSER) {
if (isH5Normal && EASY_ENV_IS_BROWSER && this.wxAppId) {
try {
console.log(this.pageInfo.tenantId);
const [schema] = await api.getMpSchema({
miniUrl: WEAPP_PATH,
params: `url=${encodeURIComponent(JSON.stringify(this.link))}`
});
}, this.wxAppId, this.pageInfo.tenantId);
this.mpSchema = schema;
} catch (error) {
......@@ -124,7 +128,9 @@ export default {
return;
}
if (isH5Normal) {
window.location.href = this.shareOpenMethod === 1 ? this.mpSchema : this.appSchema;
const fromHost = getParameterByName('fromHost', window.location.href);
const loginUrl = `${fromHost}/login?redirectUrl=${window.location.href}`;
window.location.href = fromHost ? loginUrl : this.shareOpenMethod === 1 ? this.mpSchema : this.appSchema;
setTimeout(() => {
this.shareOpenMethod === 2 && navToDlApp();
}, 2000);
......@@ -153,14 +159,15 @@ export default {
initShareInfo() {
if (EASY_ENV_IS_NODE) return;
const { coverImage, pageName, pageDescribe, shareCoverImage } = this.pageInfo;
const link = `${window.location.origin}${window.location.pathname}?vccToken={token}`;
const link = `${window.location.origin}${window.location.pathname}?vccToken={token}&tenantId=${localStorage.get('tenantId') || ''}`;
this.link = link;
const defaultTitle = +localStorage.get('tenantId') === 560671 ? '羊小咩' : '活动页';
this.shareInfo = {
event: "showShareView",
data: {
platform: ["weChat", "timeLine"],
shareDic: {
title: pageName || '羊小咩',
title: pageName || defaultTitle,
desc: pageDescribe || '美好生活更从容',
link,
imgUrl: shareCoverImage || coverImage // 图片地址
......@@ -183,7 +190,7 @@ export default {
this.jsBridge.showShareView(this.shareInfo);
},
postMpShareInfo() {
if (EASY_ENV_IS_NODE) return;
if (EASY_ENV_IS_NODE || !this.wxAppId) return;
const wx = require('weixin-js-sdk');
const { shareInfo } = this;
wx.miniProgram.postMessage({ data: shareInfo });
......
......@@ -9,10 +9,12 @@
export default {
name: 'EmptyState',
mounted() {
if (!this.$isServer) {
const loadingEle = document.querySelector('.mainload');
if (!loadingEle) { return; }
loadingEle.style.display = 'none';
}
}
}
</script>
<style lang="less" scoped>
......
......@@ -13,6 +13,8 @@ import DisableTouchMixin from '@/page/mixins/disableTouch.mixin';
import { setAppTitleColor } from '@/service/color.service';
import { EventBus } from '@qg/citrus-ui/src/helper/service/eventBus';
import localStorage from '@/service/localStorage.service';
import basicConfig from '@/config';
@Component({ components: { FreedomContainer, GridLayout, GridItem, PageBottomTip, BackTop, EmptyState }, name: 'Activity'})
export default class Activity extends Mixins(TransformStyleMixin, SaMixin, DisableTouchMixin) {
......@@ -20,6 +22,7 @@ export default class Activity extends Mixins(TransformStyleMixin, SaMixin, Disab
@State(state => state.activity.pageInfo.pageName) pageName;
@State(state => state.activity.noPageData) noPageData;
@State(state => state.activity.pageInfo.appLoginState) appLoginState;
@State(state => state.activity.pageInfo.tenantId) tenantId;
@State(state => state.activity.gridLayout.rowHeight) rowHeight;
@Mutation('SET_PAGE_ELEMENTS') setPageElement;
@Mutation('UPDATE_APP_LOGIN_STATE') updateAppLoginState;
......@@ -44,6 +47,13 @@ export default class Activity extends Mixins(TransformStyleMixin, SaMixin, Disab
}
return this.pageData && this.pageData.elements.map(v => v.point) || [];
}
get tenantIdCorrect() {
if (EASY_ENV_IS_NODE) {
return true;
}
// TODO
return +this.tenantId ? (+this.tenantId === +(localStorage.get('tenantId') || 560761)) : true;
}
@Watch('pageData', { deep: true })
onPageDataChange(val) {
......
<template>
<div class="activity" :style="transformStyle(pageData.commonStyle)">
<template v-if="!noPageData">
<template v-if="!noPageData && tenantIdCorrect">
<div class="layout">
<div :style="transformStyle(item.commonStyle, item.point, item.name)" v-for="(item, index) in pageData.elements"
:key="fixGridKey(item)"
......
......@@ -99,7 +99,7 @@ instance.interceptors.response.use(
!config.hideLoading && afterRequest();
let message = '';
let showToast = true;
let showToast = !config.hideToast;
if (err.message === 'Network Error' && !err.response) {
// 网络异常: 错误域名,
......
......@@ -3,7 +3,7 @@ import { isWechat, isApp, errorQueryValues } from './utils.service';
import Cookies from './cookieStorage.service';
import localStorage from './localStorage.service';
// formXcxPage:标识是从小程序跳转过来的;
const localStorageParams = ['creditToken', 'vccToken', 'vccChannel', 'sonVccChannel', 'formXcxPage'];
const localStorageParams = ['creditToken', 'vccToken', 'vccChannel', 'sonVccChannel', 'formXcxPage', 'tenantId'];
const cookiesParams = ['h'];
export default {
......
......@@ -4,11 +4,11 @@ import Storage from '@/service/localStorage.service';
import { getParameterByName, isWxMp, isApp } from '@/service/utils.service';
export function initSa(router) {
if (process.env.NODE_ENV === 'development') { return; }
const sa = require('sa-sdk-javascript');
const activityId = window.location.pathname.split('/')?.[2] || '';
const vccChannel = getParameterByName('vccChannel') || getParameterByName('registerFrom');
const sonVccChannel = getParameterByName('sonVccChannel');
const tenantId = +(getParameterByName('tenantId') || config.yxmTenantId);
sa.init({
server_url: config.shenceUrl,
heatmap: {
......@@ -28,7 +28,8 @@ export function initSa(router) {
platformType: isWxMp ? 'MP' : isApp ? 'APP' : 'H5',
activity_id: activityId,
parent_channel_id: vccChannel || '',
channel_id: sonVccChannel || ''
channel_id: sonVccChannel || '',
tenantId,
});
router.afterEach(() => {
Vue.nextTick(() => {
......
......@@ -11,7 +11,7 @@ export const chunk = function(array, size) {
};
export const getParameterByName = function(name, url) {
if (!url) {
if (!url && !EASY_ENV_IS_NODE) {
url = window.location.href;
}
name = name.replace(/[\[\]]/g, '\\$&');
......
<!DOCTYPE html>
<html lang="en" style="font-size: 37.5px;">
<head>
<title>羊小咩</title>
<title>活动页</title>
<meta name="keywords">
<meta name="description">
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no,viewport-fit=cover">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="data:image/png;base64" type="image/x-icon" />
<link rel="preconnect" href="https://appsync.lkbang.net">
<link rel="dns-prefetch" href="//misc.lkbang.net">
<link rel="dns-prefetch" href="//appsync.lkbang.net">
<link rel="dns-prefetch" href="//img.lkbang.net">
<link rel="dns-prefetch" href="//img10.360buyimg.com">
<link rel="dns-prefetch" href="//img11.360buyimg.com">
<link rel="dns-prefetch" href="//img12.360buyimg.com">
<link rel="dns-prefetch" href="//img13.360buyimg.com">
<link rel="dns-prefetch" href="//img14.360buyimg.com">
<link rel="dns-prefetch" href="//img20.360buyimg.com">
<link rel="dns-prefetch" href="//img30.360buyimg.com">
<link rel="dns-prefetch" href="//kdspstatic.q-gp.com">
<!-- <link rel="stylesheet" type="text/css" href="https://activitystatic.lkbang.net/swiper/4.5.1/css/swiper.min.css"> -->
<style>
/* stylelint-disable */
......
module.exports = {
extends: ['@commitlint/config-angular'],
};
{
"api": {
"apiHost": "https://quantum-blocks-bfe.liangkebang.net",
"h5Host": "https://quantum-h5-bfe.liangkebang.net",
"opapiHost": "https://opapi-bfe.liangkebang.net",
"passportHost": "https://passportapi-bfe.liangkebang.net",
"kdspHost": "https://talos-bfe.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",
"loginUrl": "",
"mallHost": "https://mall-bfe.liangkebang.net",
"h5ShopHost": "https://tenet-bfe.liangkebang.net/#"
"h5ShopHost": "https://tenet-test1.liangkebang.net/#",
"yxmTenantId": 560761,
"appIdMap": {
"560761": "wxe16bf9293671506c",
"560867": "wxccb8435d68e8c7d6"
}
},
"mysql": {
"low_code": {
"host": "172.17.5.17",
"port": "31548",
"host": "172.17.5.45",
"port": "32696",
"username": "qa",
"password": "qatest",
"database": "low_code"
}
},
"redis": {
"port": "172.17.5.14",
"host": "31226",
"host": "172.17.5.48",
"port": "32625",
"password": "",
"db": 0
},
......
{
"apiHost": "https://quantum-blocks-bfe.liangkebang.net",
"h5Host": "https://quantum-h5-bfe.liangkebang.net",
"opapiHost": "https://opapi-bfe.liangkebang.net",
"passportHost": "https://passportapi-bfe.liangkebang.net",
"kdspHost": "https://talos-bfe.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",
"loginUrl": "",
"mallHost": "https://mall-bfe.liangkebang.net",
"h5ShopHost": "https://tenet-bfe.liangkebang.net/#",
"qiniuUpHost": "https://up-z0.qiniup.com",
"qiniuHost": "https://appsync.lkbang.net"
"h5ShopHost": "https://tenet-test1.liangkebang.net/#",
"yxmTenantId": 560761,
"appIdMap": {
"560761": "wxe16bf9293671506c",
"560867": "wxccb8435d68e8c7d6"
}
}
\ No newline at end of file
......@@ -2,12 +2,12 @@ import { EggAppConfig } from 'egg';
import * as fs from 'fs';
import * as path from 'path';
import wxVertify from './wxVertify';
const { redis, api, qiniu } = require(path.resolve(__dirname, './apollo.json'));
export default (appInfo: EggAppConfig) => {
const config: any = {};
const siteFile = wxVertify;
siteFile['/favicon.ico'] = fs.readFileSync(path.join(appInfo.baseDir, 'app/web/asset/images/favicon.ico'));
config.siteFile = siteFile;
config.view = {
......@@ -48,5 +48,11 @@ export default (appInfo: EggAppConfig) => {
enable: false
}
};
config.redis = {
client: redis
};
config.apollo = {
...api, ...qiniu
};
return config;
};
......@@ -27,14 +27,6 @@ export default (appInfo: EggAppConfig) => {
browser: 'http://localhost:7001/'
};
exports.redis = {
client: {
port: 31226, // Redis port
host: '172.17.5.14', // Redis host
password: '',
db: 0
}
};
return exports;
};
......@@ -3,7 +3,6 @@
*
* prod + default(override)
*/
import { Application, EggAppConfig } from 'egg';
export default (appInfo: EggAppConfig) => {
......@@ -13,14 +12,5 @@ export default (appInfo: EggAppConfig) => {
dir: '/home/quant_group/logs',
};
exports.redis = {
client: {
port: 6379, // Redis port
host: 'front-redis.quantgroups.com', // Redis host
password: 'ln4^ESq80j4nrTMZ',
db: 0
}
};
return {...exports, apollo: {}};
return exports;
};
import { Application, EggAppConfig } from 'egg';
const path = require('path');
const { redis, api, qiniu } = require(path.resolve(__dirname, './apollo.json'));
export default (appInfo: EggAppConfig) => {
const exports: any = {};
exports.logger = {
dir: '/home/quant_group/logs',
};
exports.redis = {
client: redis
};
return {...exports, apollo: { ...api, ...qiniu }};
return exports;
};
This diff is collapsed.
......@@ -4,13 +4,15 @@
"description": "低代码平台",
"scripts": {
"start": "cross-env NODE_ENV=production APOLLO_CLUSTER=3C egg-scripts start --port 9050",
"start:pre": "cross-env NODE_ENV=production APOLLO_CLUSTER=3PRE egg-scripts start --port 9050",
"test": "cross-env NODE_ENV=production EGG_SERVER_ENV=sit DEBUG=apollo APOLLO_CLUSTER=k8s NAMESPACE=qa2 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",
"debug": "egg-bin debug -r egg-ts-helper/register",
"apollo": "node bin/apollo.js",
"build": "npm run apollo && cross-env COS_ENV=production easy build --devtool",
"build": "cross-env NODE_ENV=production APOLLO_CLUSTER=3C npm run apollo && cross-env COS_ENV=production easy build --devtool",
"build:pre": "cross-env NODE_ENV=production APOLLO_CLUSTER=3PRE npm run apollo && cross-env COS_ENV=production easy build --devtool",
"build:test": "cross-env COS_ENV=test easy build --devtool",
"tsc": "ets && tsc -p tsconfig.json",
"clean": "ets clean",
......@@ -24,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.16-bata2",
"@qg/citrus-ui": "0.3.22",
"@qg/js-bridge": "^1.1.12",
"babel-plugin-transform-vue-jsx": "^4.0.1",
"cos-nodejs-sdk-v5": "^2.9.12",
......@@ -65,7 +67,11 @@
"tslint-eslint-rules": "^5.4.0",
"tslint-loader": "^3.5.3",
"typescript": "^3.9.2",
"webpack-sentry-plugin": "^2.0.3"
"webpack-sentry-plugin": "^2.0.3",
"husky": "^4.2.5",
"lint-staged": "^10.2.11",
"@commitlint/cli": "^13.2.1",
"@commitlint/config-angular": "^13.2.0"
},
"egg": {
"typescript": true
......@@ -87,5 +93,17 @@
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
"lint-staged": {
"src/**/*.{js,vue}": [
"tslint --fix --project . -c tslint.json 'app/web/**/*{.ts}'",
"git add"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"commit-msg": "commitlint -e $HUSKY_GIT_PARAMS"
}
}
}
#!/bin/sh
source /etc/profile
NODE_ENV=production APOLLO_CLUSTER=3PRE pm2 start bin/server.js --node-args=\"--harmony\" -n quantum-block-h5
#!/bin/sh
source /etc/profile
pm2 start bin/server.js --node-args=\"--harmony\" -n quantum-block-h5
#!/bin/sh
source /etc/profile
pm2 stop quantum-block-h5
pm2 stop quantum-blocks-h5
\ No newline at end of file
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