Browse Source

ccmq type page

master
zhizhi wu 4 years ago
parent
commit
6090f81cca
  1. 9
      page/src/main/java/com/ccsens/page/persist/IMessageDao.java
  2. 18
      page/src/main/java/com/ccsens/page/persist/MessageDao.java
  3. 155
      page/src/main/java/com/ccsens/page/util/RestTemplateUtil.java
  4. 3
      scheduler/vue-element-admin-master/.env.development
  5. 1
      scheduler/vue-element-admin-master/.env.staging
  6. 256
      scheduler/vue-element-admin-master/src/views/task/index.vue
  7. 4
      scheduler/vue-element-admin-master/vue.config.js

9
page/src/main/java/com/ccsens/page/persist/IMessageDao.java

@ -1,9 +0,0 @@
package com.ccsens.page.persist;
/**
* @author wei
*/
public interface IMessageDao {
}

18
page/src/main/java/com/ccsens/page/persist/MessageDao.java

@ -1,18 +0,0 @@
package com.ccsens.page.persist;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Repository;
/**
* @author wei
*/
@Repository
public class MessageDao implements IMessageDao {
private static final String COLLECTION_RAW_MESSAGE = "col_message_raw";
private static final String COLLECTION_MESSAGE = "col_message";
@Autowired
private MongoTemplate mongoTemplate;
}

155
page/src/main/java/com/ccsens/page/util/RestTemplateUtil.java

@ -1,155 +0,0 @@
package com.ccsens.page.util;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.ccsens.page.exception.BaseException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Map;
@Slf4j
@Component
public class RestTemplateUtil {
@Resource
private RestTemplate restTemplate;
private static RestTemplateUtil util;
@PostConstruct
public void init(){
util = this;
util.restTemplate = this.restTemplate;
}
public static Object getForEntity(String url, Map<String, Object> params, Class<?> returnClass) {
if (params != null && !params.isEmpty()) {
String questionMark = "?";
String assignMark = "=";
String andMark = "&";
if (!url.contains(questionMark)) {
url += questionMark;
}
for (String key : params.keySet()) {
if (url.endsWith(questionMark)) {
url += key + assignMark +params.get(key);
} else {
url += andMark + key + assignMark +params.get(key);
}
}
}
log.info("url:{}, params:{}", url, params);
ResponseEntity<String> entity = util.restTemplate.getForEntity(url, String.class);
log.info("entity:{}",entity);
return JSONObject.parseObject(entity.getBody(), returnClass);
}
public static String postBody(String url, Object params) {
log.info("路径:{}, 参数:{}", url, params);
HttpHeaders httpHeaders = new HttpHeaders();
MediaType type= MediaType.parseMediaType("application/json;charset=UTF-8");
httpHeaders.setContentType(type);
JSONObject json = JSON.parseObject(JSON.toJSONString(params));
HttpEntity<Map<String, Object>> objectHttpEntity = new HttpEntity<>(json,httpHeaders);
URI uri;
try {
uri = new URI(url);
}catch (URISyntaxException e) {
log.error("转换路径异常", e);
throw new BaseException(CodeEnum.URL_ERROR);
}
ResponseEntity<String> response = util.restTemplate.postForEntity(uri, objectHttpEntity, String.class);
log.info("返回:{}", response);
return response.getBody();
}
public static String postBody(String url, List<? extends Object> params) {
log.info("路径:{}, 参数:{}", url, params);
HttpHeaders httpHeaders = new HttpHeaders();
MediaType type= MediaType.parseMediaType("application/json;charset=UTF-8");
httpHeaders.setContentType(type);
HttpEntity<List<? extends Object>> objectHttpEntity = new HttpEntity<>(params,httpHeaders);
URI uri;
try {
uri = new URI(url);
}catch (URISyntaxException e) {
log.error("转换路径异常:{}", e);
throw new BaseException(CodeEnum.URL_ERROR);
}
ResponseEntity<String> response = util.restTemplate.postForEntity(uri, objectHttpEntity, String.class);
log.info("返回:{}", response);
return response.getBody();
}
public static String postUrlEncode(String url, Object params) {
log.info("请求路径:{},请求参数:{}", url, params);
MultiValueMap<String, Object> paramMap;
if (params == null) {
paramMap = new LinkedMultiValueMap<>();
} else {
JSONObject json = JSON.parseObject(JSON.toJSONString(params));
paramMap = transMultiValueMap(json);
}
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
HttpEntity<MultiValueMap> formEntity = new HttpEntity<>(paramMap, headers);
ResponseEntity<String> result = util.restTemplate.postForEntity(url, formEntity, String.class);
log.info("接口返回结果:{}", result);
return result.getBody();
}
/**
* 发送multipart/form-data
* @author whj
* @date 2019/8/20
* @param url 路径
* @param params 参数
* @return com.alibaba.fastjson.JSONObject
*/
public static JSONObject postImg(String url, JSONObject params) {
log.info("请求路径:{},请求参数:{}", url, params);
HttpHeaders headers = new HttpHeaders();
headers.add("Accept", MediaType.APPLICATION_JSON.toString());
headers.setContentType(MediaType.MULTIPART_FORM_DATA);
MultiValueMap<String, Object> paramMap = transMultiValueMap(params);
HttpEntity<MultiValueMap> formEntity = new HttpEntity<>(paramMap, headers);
JSONObject result = util.restTemplate.postForObject(url, formEntity, JSONObject.class);
log.info("接口返回结果:{}", result);
return result;
}
/**
* 将参数封装成MultiValueMap对象
* @author whj
* @date 2019/8/20
* @param params 参数
* @return org.springframework.util.MultiValueMap<java.lang.String,java.lang.Object>
*/
private static MultiValueMap<String, Object> transMultiValueMap(JSONObject params) {
MultiValueMap<String, Object> paramMap = new LinkedMultiValueMap<>();
for (String key: params.keySet()) {
paramMap.add(key, params.get(key));
}
return paramMap;
}
}

3
scheduler/vue-element-admin-master/.env.development

@ -5,4 +5,5 @@ ENV = 'development'
VUE_APP_BASE_API = 'https://test.tall.wiki'
VUE_APP_MOCK_API = '/dev-api'
VUE_APP_TALL_API = 'https://test.tall.wiki/gateway/tall/v1.0'
VUE_APP_SCHEDULER_API = 'https://test.tall.wiki/scheduler'
VUE_APP_SCHEDULER_API = 'https://test.tall.wiki/scheduler'
PUBLIC_PATH = '/'

1
scheduler/vue-element-admin-master/.env.staging

@ -9,3 +9,4 @@ VUE_APP_BASE_API = 'https://test.tall.wiki'
VUE_APP_MOCK_API = '/dev-api'
VUE_APP_TALL_API = 'https://test.tall.wiki/gateway/tall/v1.0'
VUE_APP_SCHEDULER_API = 'https://test.tall.wiki/scheduler'
PUBLIC_PATH = '/scheduler/static/'

256
scheduler/vue-element-admin-master/src/views/task/index.vue

@ -2,30 +2,50 @@
<div class="app-container">
<!--搜索条件-->
<div class="filter-container">
<el-input v-model="listQuery.jobName" placeholder="任务名称" style="width: 200px;" class="filter-item" @keyup.enter.native="handleFilter" />
<el-input v-model="listQuery.jobGroupName" placeholder="任务组名称" style="width: 200px;" class="filter-item" @keyup.enter.native="handleFilter" />
<el-input v-model="listQuery.triggerName" placeholder="触发器名称" style="width: 200px;" class="filter-item" @keyup.enter.native="handleFilter" />
<el-input v-model="listQuery.triggerGroupName" placeholder="触发器组名" style="width: 200px;" class="filter-item" @keyup.enter.native="handleFilter" />
<el-date-picker v-model="listQuery.startTime" type="datetime" placeholder="开始时间" @change="changeTime($event, 0)" />
<el-date-picker v-model="listQuery.endTime" type="datetime" placeholder="结束时间" @change="changeTime($event, 1)" />
<el-select v-model="listQuery.misfirePolicy" placeholder="失火策略" clearable style="width: 130px" class="filter-item">
<el-input
v-model="listQuery.jobName"
class="filter-item"
placeholder="任务名称"
style="width: 200px;"
@keyup.enter.native="handleFilter"
/>
<el-input
v-model="listQuery.jobGroupName"
class="filter-item"
placeholder="任务组名称"
style="width: 200px;"
@keyup.enter.native="handleFilter"
/>
<el-input
v-model="listQuery.triggerName"
class="filter-item"
placeholder="触发器名称"
style="width: 200px;"
@keyup.enter.native="handleFilter"
/>
<el-input
v-model="listQuery.triggerGroupName"
class="filter-item"
placeholder="触发器组名"
style="width: 200px;"
@keyup.enter.native="handleFilter"
/>
<el-date-picker v-model="listQuery.startTime" placeholder="开始时间" type="datetime" @change="changeTime($event, 0)" />
<el-date-picker v-model="listQuery.endTime" placeholder="结束时间" type="datetime" @change="changeTime($event, 1)" />
<el-select v-model="listQuery.misfirePolicy" class="filter-item" clearable placeholder="失火策略" style="width: 130px">
<el-option v-for="item in misfirePolicyArr" :key="item" :label="item.value" :value="item.key" />
</el-select>
<el-select v-model="listQuery.job" placeholder="执行任务" clearable class="filter-item" style="width: 130px">
<el-select v-model="listQuery.job" class="filter-item" clearable placeholder="执行任务" style="width: 130px">
<el-option v-for="item in jobArr" :key="item.key" :label="item.value" :value="item.key" />
</el-select>
<el-select v-model="listQuery.notifyWay" placeholder="通知方式" clearable style="width: 140px" class="filter-item" @change="handleFilter">
<el-select v-model="listQuery.notifyWay" class="filter-item" clearable placeholder="通知方式" style="width: 140px" @change="handleFilter">
<el-option v-for="item in notifyWayArr" :key="item.key" :label="item.value" :value="item.key" />
</el-select>
<el-select v-model="listQuery.appId" placeholder="appId" style="width: 140px" class="filter-item" @change="handleFilter">
<el-select v-model="listQuery.appId" class="filter-item" placeholder="appId" style="width: 140px" @change="handleFilter">
<el-option v-for="item in appIdArr" :key="item.key" :label="item.value" :value="item.key" />
</el-select>
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter">
Search
</el-button>
<el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-edit" @click="handleCreate">
Add
</el-button>
<el-button v-waves class="filter-item" icon="el-icon-search" type="primary" @click="handleFilter">Search</el-button>
<el-button class="filter-item" icon="el-icon-edit" style="margin-left: 10px;" type="primary" @click="handleCreate">Add</el-button>
</div>
<!--表格-->
@ -39,53 +59,53 @@
style="width: 100%;"
@sort-change="sortChange"
>
<el-table-column fixed label="任务名" align="center" width="150px">
<el-table-column align="center" fixed label="任务名" width="150px">
<template slot-scope="{row}">
<span>{{ row.jobName }}</span>
</template>
</el-table-column>
<el-table-column fixed label="状态" width="100px" align="center">
<el-table-column align="center" fixed label="状态" width="100px">
<template slot-scope="{row}">
<span>{{ row.triggerState }}</span>
</template>
</el-table-column>
<el-table-column fixed label="上一次执行时间" width="150px" align="center">
<!-- <el-table-column align="center" fixed label="上一次执行时间" width="150px">
<template slot-scope="{row}">
<span>{{ row.prevFireTime | parseTime('{y}-{m}-{d} {h}:{i}') }}</span>
</template>
</el-table-column>
<el-table-column fixed label="下一次执行时间" width="150px" align="center">
<el-table-column align="center" fixed label="下一次执行时间" width="150px">
<template slot-scope="{row}">
<span>{{ row.nextFireTime | parseTime('{y}-{m}-{d} {h}:{i}') }}</span>
</template>
</el-table-column>
<el-table-column label="任务组" width="150px" align="center">
</el-table-column>-->
<el-table-column align="center" label="任务组" width="150px">
<template slot-scope="{row}">
<span>{{ row.jobGroupName }}</span>
<span>{{ row.timestamp | parseTime('{y}-{m}-{d} {h}:{i}') }}</span>
</template>
</el-table-column>
<el-table-column label="触发器名称" align="center" width="150px">
<el-table-column align="center" label="触发器名称" width="150px">
<template slot-scope="{row}">
<span>{{ row.triggerName }}</span>
</template>
</el-table-column>
<el-table-column label="触发器组名" width="150px" align="center">
<el-table-column align="center" label="触发器组名" width="150px">
<template slot-scope="{row}">
<span>{{ row.triggerGroupName }}</span>
</template>
</el-table-column>
<el-table-column label="cron" width="150px" align="center">
<el-table-column align="center" label="cron" width="150px">
<template slot-scope="{row}">
<span>{{ row.cron }}</span>
</template>
</el-table-column>
<el-table-column label="开始时间" width="150px" align="center">
<el-table-column align="center" label="开始时间" width="150px">
<template slot-scope="{row}">
<span>{{ row.startTime | parseTime('{y}-{m}-{d} {h}:{i}') }}</span>
</template>
</el-table-column>
<el-table-column label="结束时间" width="150px" align="center">
<el-table-column align="center" label="结束时间" width="150px">
<template slot-scope="{row}">
<span>{{ row.endTime | parseTime('{y}-{m}-{d} {h}:{i}') }}</span>
</template>
@ -100,30 +120,28 @@
<span>{{ row.misfirePolicy }}</span>
</template>
</el-table-column>
<el-table-column label="通知方式" align="center">
<el-table-column align="center" label="通知方式">
<template slot-scope="{row}">
<span>{{ getNotifyWay(row.notifyWay) }}</span>
</template>
</el-table-column>
<el-table-column label="通知路径" align="center">
<el-table-column align="center" label="通知路径">
<template slot-scope="{row}">
<span>{{ row.notifyUrl }}</span>
</template>
</el-table-column>
<el-table-column label="通知内容" align="center">
<el-table-column align="center" label="通知内容">
<template slot-scope="{row}">
<span>{{ row.notifyParam }}</span>
</template>
</el-table-column>
<el-table-column fixed="right" label="Actions" align="center" width="230" class-name="small-padding fixed-width">
<el-table-column align="center" class-name="small-padding fixed-width" fixed="right" label="Actions" width="230">
<template slot-scope="{row,$index}">
<el-button type="primary" size="mini" @click="handleUpdate(row)">
Edit
</el-button>
<el-popconfirm v-if="row.recStatus === 1" title="确定重启任务吗?" @onConfirm="handleResume(row,$index)">
<el-button v-if="row.triggerState !== 'CLOSED'" size="mini" type="primary" @click="handleUpdate(row)">Edit</el-button>
<el-popconfirm v-if="row.recStatus === 1 && row.triggerState !== 'CLOSED'" title="确定重启任务吗?" @onConfirm="handleResume(row,$index)">
<el-button slot="reference" size="mini" type="success">resume</el-button>
</el-popconfirm>
<el-popconfirm v-else title="确定停止任务吗?" @onConfirm="handlePause(row,$index)">
<el-popconfirm v-if="row.recStatus === 0 && row.triggerState !== 'CLOSED'" title="确定停止任务吗?" @onConfirm="handlePause(row,$index)">
<el-button slot="reference" size="mini" type="warning">pause</el-button>
</el-popconfirm>
<el-popconfirm title="删除后任务不可恢复,确定删除吗?" @onConfirm="handleDelete(row,$index)">
@ -133,19 +151,19 @@
</el-table-column>
</el-table>
<pagination v-show="total>0" :total="total" :page.sync="listQuery.pageNum" :limit.sync="listQuery.pageSize" @pagination="getList" />
<pagination v-show="total>0" :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNum" :total="total" @pagination="getList" />
<!--添加/编辑界面-->
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible">
<el-form ref="dataForm" :rules="rules" :model="temp" label-position="left" label-width="90px" style="width: 90%; margin-left:30px;">
<el-form ref="dataForm" :model="temp" :rules="rules" label-position="left" label-width="90px" style="width: 90%; margin-left:30px;">
<el-form-item label="cron" prop="cron">
<el-input v-model="temp.cron" />
</el-form-item>
<el-form-item label="开始时间" prop="startTime">
<el-date-picker v-model="date.start" type="datetime" placeholder="开始时间" style="width: 100%;" @change="changeTime($event, 2)" />
<el-date-picker v-model="date.start" placeholder="开始时间" style="width: 100%;" type="datetime" @change="changeTime($event, 2)" />
</el-form-item>
<el-form-item label="结束时间" prop="endTime">
<el-date-picker v-model="date.end" type="datetime" placeholder="结束时间" style="width: 100%;" @change="changeTime($event, 3)" />
<el-date-picker v-model="date.end" placeholder="结束时间" style="width: 100%;" type="datetime" @change="changeTime($event, 3)" />
</el-form-item>
<el-form-item label="通知方式" prop="notifyWay">
<el-select v-model="temp.notifyWay" placeholder="通知方式" style="width: 100%;">
@ -169,7 +187,7 @@
</el-select>
</el-form-item>
<el-form-item label="appId" prop="appId">
<el-select v-model="temp.appId" placeholder="appId" style="width: 100%;" :disabled="dialogStatus !== 'create'">
<el-select v-model="temp.appId" :disabled="dialogStatus !== 'create'" placeholder="appId" style="width: 100%;">
<el-option v-for="item in appIdArr" :key="item.key" :label="item.value" :value="item.key" />
</el-select>
</el-form-item>
@ -187,18 +205,14 @@
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">
Cancel
</el-button>
<el-button type="primary" @click="dialogStatus==='create'?createData():updateData()">
Confirm
</el-button>
<el-button @click="dialogFormVisible = false">Cancel</el-button>
<el-button type="primary" @click="dialogStatus==='create'?createData():updateData()">Confirm</el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogPvVisible" title="Reading statistics">
<el-table :data="pvData" border fit highlight-current-row style="width: 100%">
<el-table-column prop="key" label="Channel" />
<el-table-column prop="pv" label="Pv" />
<el-table-column label="Channel" prop="key" />
<el-table-column label="Pv" prop="pv" />
</el-table>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="dialogPvVisible = false">Confirm</el-button>
@ -208,7 +222,15 @@
</template>
<script>
import { fetchList, fetchPv, createJob, updateJob, pauseJob, resumeJob, removeJob } from '@/api/task'
import {
fetchList,
fetchPv,
createJob,
updateJob,
pauseJob,
resumeJob,
removeJob
} from '@/api/task'
import waves from '@/directive/waves' // waves directive
import { parseTime } from '@/utils'
import Pagination from '@/components/Pagination' // secondary package based on el-pagination
@ -275,18 +297,14 @@ export default {
value: 'withMisfireHandlingInstructionDoNothing'
}
],
jobArr: [
{ key: 0, value: '任务通知' }
],
jobArr: [{ key: 0, value: '任务通知' }],
notifyWayArr: [
{ key: 0, value: 'http' },
{ key: 1, value: 'mq' },
{ key: 2, value: '邮件' },
{ key: 3, value: '短信' }
],
appIdArr: [
{ key: '0', value: '0' }
],
appIdArr: [{ key: '0', value: '0' }],
statusOptions: ['published', 'draft', 'deleted'],
showReviewer: false,
temp: {
@ -319,7 +337,9 @@ export default {
rules: {
cron: [{ required: true, message: 'cron是必填的', trigger: 'blur' }],
// timestamp: [{ type: 'date', required: true, message: 'timestamp is required', trigger: 'change' }],
notifyUrl: [{ required: true, message: '通知路径是必填的', trigger: 'blur' }]
notifyUrl: [
{ required: true, message: '通知路径是必填的', trigger: 'blur' }
]
},
downloadLoading: false
}
@ -428,7 +448,7 @@ export default {
})
},
createData() {
this.$refs['dataForm'].validate((valid) => {
this.$refs['dataForm'].validate(valid => {
if (valid) {
createJob(this.temp).then(() => {
// this.list.unshift(this.temp)
@ -466,7 +486,7 @@ export default {
})
},
updateData() {
this.$refs['dataForm'].validate((valid) => {
this.$refs['dataForm'].validate(valid => {
if (valid) {
const tempData = Object.assign({}, this.temp)
tempData.timestamp = +new Date(tempData.timestamp) // change Thu Nov 30 2017 16:41:05 GMT+0800 (CST) to 1512031311464
@ -486,68 +506,74 @@ export default {
handleDelete(row, index) {
const { jobName, jobGroupName, triggerName, triggerGroupName } = row
this.listLoading = true
removeJob({ jobName, jobGroupName, triggerName, triggerGroupName }).then(response => {
this.listLoading = false
this.handleFilter()
this.$notify({
title: 'Success',
message: 'Delete Successfully',
type: 'success',
duration: 2000
removeJob({ jobName, jobGroupName, triggerName, triggerGroupName })
.then(response => {
this.listLoading = false
this.handleFilter()
this.$notify({
title: 'Success',
message: 'Delete Successfully',
type: 'success',
duration: 2000
})
})
}).catch(e => {
this.listLoading = false
this.$notify({
title: 'Fail',
message: 'Delete FAIL',
type: 'error',
duration: 2000
.catch(e => {
this.listLoading = false
this.$notify({
title: 'Fail',
message: 'Delete FAIL',
type: 'error',
duration: 2000
})
})
})
},
handleResume(row, index) {
const { jobName, jobGroupName } = row
this.listLoading = true
resumeJob({ jobName, jobGroupName }).then(response => {
this.listLoading = false
this.handleFilter()
this.$notify({
title: 'Success',
message: 'Resume Successfully',
type: 'success',
duration: 2000
resumeJob({ jobName, jobGroupName })
.then(response => {
this.listLoading = false
this.handleFilter()
this.$notify({
title: 'Success',
message: 'Resume Successfully',
type: 'success',
duration: 2000
})
})
}).catch(e => {
this.listLoading = false
this.$notify({
title: 'Fail',
message: 'Resume FAIL',
type: 'error',
duration: 2000
.catch(e => {
this.listLoading = false
this.$notify({
title: 'Fail',
message: 'Resume FAIL',
type: 'error',
duration: 2000
})
})
})
},
handlePause(row, index) {
const { jobName, jobGroupName } = row
this.listLoading = true
pauseJob({ jobName, jobGroupName }).then(response => {
this.listLoading = false
this.handleFilter()
this.$notify({
title: 'Success',
message: 'Pause Successfully',
type: 'success',
duration: 2000
pauseJob({ jobName, jobGroupName })
.then(response => {
this.listLoading = false
this.handleFilter()
this.$notify({
title: 'Success',
message: 'Pause Successfully',
type: 'success',
duration: 2000
})
})
}).catch(e => {
this.listLoading = false
this.$notify({
title: 'Fail',
message: 'Pause FAIL',
type: 'error',
duration: 2000
.catch(e => {
this.listLoading = false
this.$notify({
title: 'Fail',
message: 'Pause FAIL',
type: 'error',
duration: 2000
})
})
})
},
handleDownload() {
this.downloadLoading = true
@ -564,13 +590,15 @@ export default {
})
},
formatJson(filterVal) {
return this.list.map(v => filterVal.map(j => {
if (j === 'timestamp') {
return parseTime(v[j])
} else {
return v[j]
}
}))
return this.list.map(v =>
filterVal.map(j => {
if (j === 'timestamp') {
return parseTime(v[j])
} else {
return v[j]
}
})
)
},
getSortClass: function(key) {
const sort = this.listQuery.sort

4
scheduler/vue-element-admin-master/vue.config.js

@ -24,7 +24,7 @@ module.exports = {
* In most cases please use '/' !!!
* Detail: https://cli.vuejs.org/config/#publicpath
*/
publicPath: '/',
publicPath: process.env.PUBLIC_PATH,
outputDir: 'dist',
assetsDir: 'static',
lintOnSave: process.env.NODE_ENV === 'development',
@ -88,7 +88,7 @@ module.exports = {
.plugin('ScriptExtHtmlWebpackPlugin')
.after('html')
.use('script-ext-html-webpack-plugin', [{
// `runtime` must same as runtimeChunk name. default is `runtime`
// `runtime` must same as runtimeChunk name. default is `runtime`
inline: /runtime\..*\.js$/
}])
.end()

Loading…
Cancel
Save