Authored by 周少峰

'video'

package com.yohobuy.platform.grass.restapi;
import com.yohobuy.platform.common.exception.PlatformException;
import com.yohobuy.platform.common.util.DateUtil;
import com.yohobuy.platform.grass.service.IGrassArticleService;
import com.yohobuy.platform.model.common.ApiResponse;
import com.yohobuy.platform.model.grass.request.GrassArticleReq;
... ... @@ -9,9 +10,12 @@ import com.yohobuy.platform.model.grass.response.ArticleDetailRspBo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.yohobuy.platform.grass.util.TencentSignature;
import java.util.Random;
@RestController
@RequestMapping("/grassArticle")
... ... @@ -22,6 +26,11 @@ public class GrassArticleController {
@Autowired
IGrassArticleService grassArticleService;
@Value("${tencent.cloud.secretId}")
private String secretId;
@Value("${tencent.cloud.secretKey}")
private String secretKey;
@RequestMapping("/publishArticle")
public ApiResponse publishArticle(@RequestBody GrassArticleReq req){
logger.info("grassArticle publishArticle begin, req is {}", req);
... ... @@ -139,4 +148,22 @@ public class GrassArticleController {
}
@RequestMapping("/getTencentSignature")
public ApiResponse getTencentSignature() {
logger.info("grassArticle getTencentSignature begin");
TencentSignature signature = new TencentSignature(secretId, secretKey);
signature.setCurrentTime(DateUtil.getCurrentTimeSeconds());
signature.setRandom(new Random().nextInt(java.lang.Integer.MAX_VALUE));
signature.setSignValidDuration(3600 * 24 * 2);
try {
String sign = signature.getUploadSignature();
logger.info("signature : {}", sign);
return new ApiResponse(sign);
} catch (Exception e) {
logger.error("signature Exception = {}", e);
return new ApiResponse(500, "签名失败!");
}
}
}
... ...
... ... @@ -114,6 +114,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
private final static String BLOCK_TEXT = "text";
private final static String BLOCK_IMAGE = "image";
private final static String BLOCK_LINK = "link";
private final static String BLOCK_VIDEO = "video";
@Value("${uic.service.url:http://uic.yohoops.org/uic}")
private String uicUrl;
... ... @@ -176,6 +177,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
}
try {
List<GrassArticleBlock> contentList = buildArticleBlock(urls, article.getId(), req);
grassArticleBlockDao.insertArticleContents(contentList);
updateArticleImageSize(article.getId());
... ... @@ -270,6 +272,12 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
case BLOCK_LINK:
dataObject.put("url", data);
break;
case BLOCK_VIDEO:
String[] urls = StringUtils.split(data,",");
dataObject.put("coverUrl", urls[0]);
dataObject.put("videoUrl", urls[1]);
dataObject.put("fileId", urls[2]);
break;
default:
break;
}
... ... @@ -1625,21 +1633,40 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
grassRefreshCacheService.refreshGrassCache(cacheReq);
}
private List<GrassArticleBlock> buildArticleBlock(String[] urls, Integer articleId, GrassArticleReq req) {
private List<GrassArticleBlock> buildArticleBlock(String[] urls, Integer articleId, GrassArticleReq req) throws PlatformException {
List<GrassArticleBlock> contentList = Lists.newArrayList();
int contentOrder = 0;
Integer sort = Optional.ofNullable(req.getSort()).orElse(1);
long now = System.currentTimeMillis();
for (String url : urls) {
if (urls.length == 0) {
throw new PlatformException("publish images requried ", 405);
}
// 短视频
if (sort == 4) {
GrassArticleBlock content = new GrassArticleBlock();
content.setArticleId(articleId);
content.setContentData(getBlock(BLOCK_IMAGE, url));
content.setContentData(getBlock(BLOCK_VIDEO, urls[0]+ "," + req.getVideoUrl() + "," + req.getFileId()));
content.setCreateTime(now);
content.setTemplateKey("image");
content.setTemplateKey("video");
content.setOrderBy(contentOrder);
contentOrder++;
contentList.add(content);
} else {
for (String url : urls) {
GrassArticleBlock content = new GrassArticleBlock();
content.setArticleId(articleId);
content.setContentData(getBlock(BLOCK_IMAGE, url));
content.setCreateTime(now);
content.setTemplateKey("image");
content.setOrderBy(contentOrder);
contentOrder++;
contentList.add(content);
}
}
if (StringUtils.isNotEmpty(req.getContent()) && 3 != sort) {
GrassArticleBlock content = new GrassArticleBlock();
content.setArticleId(articleId);
... ...
package com.yohobuy.platform.grass.util;
import java.util.Base64;
import java.util.Random;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
public class TencentSignature {
private String secretId;
private String secretKey;
private long currentTime;
private int random;
private int signValidDuration;
private static final String HMAC_ALGORITHM = "HmacSHA1";
private static final String CONTENT_CHARSET = "UTF-8";
public TencentSignature(String secretId, String secretKey) {
this.secretId = secretId;
this.secretKey = secretKey;
}
public static byte[] byteMerger(byte[] byte1, byte[] byte2) {
byte[] byte3 = new byte[byte1.length + byte2.length];
System.arraycopy(byte1, 0, byte3, 0, byte1.length);
System.arraycopy(byte2, 0, byte3, byte1.length, byte2.length);
return byte3;
}
public String getUploadSignature() throws Exception {
String strSign = "";
String contextStr = "";
long endTime = (currentTime + signValidDuration);
contextStr += "secretId=" + java.net.URLEncoder.encode(secretId, "utf8");
contextStr += "&currentTimeStamp=" + currentTime;
contextStr += "&expireTime=" + endTime;
contextStr += "&random=" + random;
contextStr += "&vodSubAppId=" + 1400201211;
try {
Mac mac = Mac.getInstance(HMAC_ALGORITHM);
SecretKeySpec secretKey = new SecretKeySpec(this.secretKey.getBytes(CONTENT_CHARSET), mac.getAlgorithm());
mac.init(secretKey);
byte[] hash = mac.doFinal(contextStr.getBytes(CONTENT_CHARSET));
byte[] sigBuf = byteMerger(hash, contextStr.getBytes("utf8"));
strSign = base64Encode(sigBuf);
strSign = strSign.replace(" ", "").replace("\n", "").replace("\r", "");
} catch (Exception e) {
throw e;
}
return strSign;
}
public void setSecretId(String secretId) {
this.secretId = secretId;
}
public void setSecretKey(String secretKey) {
this.secretKey = secretKey;
}
public void setCurrentTime(long currentTime) {
this.currentTime = currentTime;
}
public void setRandom(int random) {
this.random = random;
}
public void setSignValidDuration(int signValidDuration) {
this.signValidDuration = signValidDuration;
}
private String base64Encode(byte[] buffer) {
Base64.Encoder encoder = Base64.getEncoder();
return encoder.encodeToString(buffer);
}
}
... ...
... ... @@ -24,7 +24,7 @@
<dependency>
<groupId>com.yoho.service.platform.model</groupId>
<artifactId>platform-service-model</artifactId>
<version>1.2.3-6.9.7-SNAPSHOT</version>
<version>1.2.3-6.9.8-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.yoho.dsf.yhplatform</groupId>
... ...
... ... @@ -254,3 +254,7 @@ uic.service.url = http://java-yoho-uic.test3.ingress.dev.yohocorp.com/uic
preview.url = http://yoho-community-web.test3.ingress.dev.yohocorp.com/grass/article/
file.excel.saveDir=E:\\Data\\saveDir
tencent.cloud.secretId = AKIDf9SVSxWqBOVTG1aZHwQ7jATwGScdlBzc
tencent.cloud.secretKey = 2ub9aXEyb761QcbRBjFkEYmqphTSwY0C
\ No newline at end of file
... ...
<style>
.btn-long {
width: 120px;
height: 37px;
line-height: 37px;
font-size: 15px;
color: white;
border-radius: 5px;
display: inline-block;
cursor: pointer;
text-align: center;
}
.btn-long:hover {
opacity: 0.9;
}
.tag{
display: block;
float: left;
padding: 2px 5px;
background: #1caf9a;
margin-right: 5px;
margin-bottom: 5px;
margin-top: 5px;
-moz-border-radius: 2px;
-webkit-border-radius: 2px;
border-radius: 2px;
font-size: 13px;
}
.goodTag{
display: block;
float: right;
font-size: 18px;
}
</style>
<link rel="stylesheet" href="/pfcms/js/emoji/emojionearea.css">
<script type="text/javascript" src="/pfcms/js/emoji/emojionearea.js"></script>
<div region="center" id="labelGroupList" style="margin-left: 20px;width: 100%">
<div id="tt" class="easyui-layout" style="margin-right:20px;height:100%;overflow-y: scroll">
<form name="publishArticleForm" id="publishArticleForm" method="post">
<input type="hidden" name="sort" id="sort" value="4">
<div style="margin-top: 20px;margin-left: 30px">
<table border="0" style="width:95%;margin-top:5px;line-height:30px;" id="tab">
<tr style="height: 60px">
<td style="width:100% ">
<div style="float: left;width:700px;" >
<span style="color:red">*</span><label style="font-size: 14px;">选择用户</label> <br>
<input id="articleUid" name="authorUid" style="width:600px " class="easyui-textbox" />
<a id="userBotton" class="btn btn-small" style="font-size: 18px; " >确认</a>
<br>
<span style="color:red"> 必填项,选择某个用户身份后,才能发布</span>
</div>
<div id="userInfo" style="float: left;margin-left: 30px;">
</div>
</td>
</tr>
<tr style="height: 60px">
<td style="width:100%; word-wrap:break-word;" >
<span style="color:red">*</span><label style="font-size: 14px;">文字内容(必填项,内容不能为空)</label> <br>
<div style="width:600px; word-wrap:break-word;float: left;position: relative" >
<textarea rows="5" id="content" style="width:60%; white-space: pre-wrap;" name = "content" class="form-control" placeholder="请在这里输入1-500字的笔记" required="" maxlength="500"></textarea>
<div style="position: absolute;bottom:0;right:-50px"> <span id="content-count">0</span>/500</div>
</div>
<!--<div style="clear: both;"> <span id="content-count">0</span>/500</div>-->
</td>
</tr>
<tr style="height: 60px">
<td style="width:100%;">
<label style="font-size: 14px;">上传视频</label> <br>
<a href="javascript:void(0);" class="btn btn-default" @click="videoAdd">选择视频</a><span style="margin-left: 20px; height: 30px; width: 30px; border-radius: 30px; line-height: 30px; text-align: center; background: #aaa; display: inline-block">{{videoUploaderInfo.progress * 100}}%</span><br>
<span style="color:red"> 请上传比例为16:9横版或9:16竖版视频素材,大小不超过200M,时长不超过90s</span><br>
<input id="videoUrl" type="text" name="videoUrl" v-model="videoUploaderInfo.videoUrl" style="padding: 0; border: 1px solid #333; width: 350px;height: 30px; line-height: 30px;"><a style="height: 30px; line-height: 30px; border: 1px solid #333; color: #000; text-decoration: none; padding: 0px 15px; display: inline-block; border-left: 0px;" href="javascript:(0);" data-clipboard-action="copy" class="copy" data-clipboard-target="#videoUrl">复制</a>
<form ref="vExample">
<input type="file" style="display:none;" ref="videoFile" @change="videoUpload" />
</form>
</td>
</tr>
<tr style="height: 60px">
<td style="width:100%;">
<label style="font-size: 14px;">上传封面</label><br>
<template v-if="videoUploaderInfo.coverUrl">
<img :src="videoUploaderInfo.coverUrl" width="150"><br>
<input id="imgs" name="articleImages" :value="videoUploaderInfo.coverUrl" hidden="hidden"/>
<input name="url" :value="videoUploaderInfo.coverUrl" hidden="hidden"/>
</template>
<input type="file" @change="videoCoverUpload" ref="videoCoverFile">
</td>
</tr>
<tr style="height: 60px">
<td style="width:100%;">
<label style="font-size: 14px;">选择标签</label> <br>
<input id="labelId" name="labelId" class="easyui-combobox" style="width:600px; "/><br>
<span style="color:red">至多添加5个标签,非必填项</span><label></label>
<input id="labelIds" name="labelIds" hidden="hidden"/>
<div id="labelList">
</div>
</td>
</tr>
<tr style="height: 60px">
<td style="width:100%;">
<label style="font-size: 14px;">选择话题</label> <br>
<input id="topicGroupId" name="topicGroupId" class="easyui-combobox" style="width:300px; "/>
<input id="topicId" name="topicId" class="easyui-combobox" style="width:300px; "/><br>
<span style="color:red">至多添加1个话题,非必填项</span><label></label>
<input id="topicIds" name="topicIds" hidden="hidden"/>
<div id="topicList">
</div>
</td>
</tr>
<tr style="height: 60px">
<td>
<label style="font-size: 14px;">关联商品</label> <br>
<span style="color:red">1.支持商品编号(SKN&SKUP)查询商品;&nbsp&nbsp&nbsp
2.至多添加10个商品,非必填项</span><label></label><br>
<a id="addSkn" class="btn btn-primary" style="font-size: 15px">选择商品+</a>
<!--<input id="skns" name="articleSkns" hidden="hidden"/>-->
<!--<input id="sknType" name="sknType" hidden="hidden"/>-->
<span id ="products"></span>
</td>
</tr>
<tr style="height: 60px">
<td id="goodstd">
<div id="good0" style="float: left;margin-left: 30px;width: 150px;">
</div>
</td>
</tr>
<tr>
<td valign="bottom">
<input id="draftBotton" class="btn btn-primary" style="font-size: 16px; height: 36px;" value="保存到草稿箱"/>
<input id="timerBotton" class="btn btn-primary" style="font-size: 16px; height: 36px;" value="定时发布"/>
<input id="subBotton" class="btn btn-primary" style="font-size: 16px; margin-left: 30px; height: 36px;" value="立即发布"/>
<span style="color:red">*运营平台发布的内容,均免审核,直接发布。</span><label></label><br>
</td>
</tr>
</table>
</div>
</form>
</div>
</div>
<script src="/pfcms/js/tencent/vod-js-sdk-v6.js"></script>
<script src="/pfcms/js/axios.min.js"></script>
<script src="/pfcms/js/vue/vue-2.3.4.js"></script>
<script src="/pfcms/js/utils/clipboard.min.js"></script>
<script>
var checkedItems = [];
var checkedItemsObj = {};
var searchType = 1;
var checkType = 1;
var data = paramObject.mkData;
$(function () {
console.log(data);
if(data && data.editFlag == 1){
$("#draftBotton").hide();
$("#timerBotton").hide();
$("#operateType").val(1);
}
if (data){
$("#articleUid").textbox("setValue", data.authorUid);
$("#draftArticleId").val(data.articleId);
// $("#content").val(data.articleContent);
$("#content").emojioneArea()[0].emojioneArea.setText(data.articleContent);
/*字数限制提示*/
if(data.articleContent !=null && data.articleContent !=''){
var count = data.articleContent.length;
$("#content-count").text(count);
}
var labelIds = [];
if(data.labelList!=null && data.labelList.length>0){
for (var i=0;i<data.labelList.length;i++){
labelIds.push(data.labelList[i].id);
}
}
$("#labelId").combobox('setValues',labelIds);
if(data.topicGroupId !=null && data.topicId!=null){
$("#topicGroupId").combobox('setValue',data.topicGroupId);
$("#topicId").combobox('setValue',data.topicId);
}
htmlTopic(data.topicName);
if(data.sknList!=null && data.sknList.length>0){
checkedItems =data.sknList;
}
if(data.yohoList!=null && data.yohoList.length>0){
initGoods(data.yohoList,1);
}
if(data.ufoList!=null && data.ufoList.length>0){
initGoods(data.ufoList,2);
}
initGoodsDiv();
}
// 复制链接
new ClipboardJS('.copy');
$("#content").emojioneArea({
// options
autoHideFilters: true,
autocomplete : false,
search :false,
recentEmojis: false,
tones: false,
filters: {
// see in source file
animals_nature : true,
food_drink :true,
activity: true,
travel_places :true,
objects:true,
symbols: true,
flags:true
}
});
$("#addImage").linkbutton({
iconCls : "icon-search",
onClick : function() {
}
});
$("#addSkn").linkbutton({
iconCls : "icon-search",
onClick : function() {
getEditDialog();
}
});
$("#userBotton").linkbutton({
iconCls : "icon-search",
onClick : function() {
//发送请求
$.ajax({
type: "POST",
url: serverContextPath + "/grassArticle/getUserInfo", //提交到后端的url
dataType: 'json',
data:{
uid : $("#articleUid").textbox("getValue")
},
success: function (result) {
if(result.code == 200) {
if(result.data !=null && result.data !=''){
var headIco = result.data.headIco.substring(0, result.data.headIco.indexOf("?"));
var html = '';
html += "<span style='font-size: 18px;'>&nbsp&nbsp<img src='"+headIco+"' width='60px;' height='60px;'></span>&nbsp&nbsp&nbsp&nbsp";
html += "<span style='font-size: 15px;'>&nbsp&nbsp<label>"+result.data.nickName+"</label></span>";
$("#userInfo").html(html);
}else{
var html = '<span style="color:red;font-size: 15px;">获取用户信息失败,请检查uid输入是否正确</span>';
$("#userInfo").html(html);
}
}
else {
var html = '<span style="color:red;font-size: 15px;">获取用户信息失败,请稍后重试</span>';
$("#userInfo").html(html);
}
}
});
}
});
$("#timerBotton").linkbutton({
iconCls : "icon-search",
onClick : function() {
getTimeDialog();
}
});
$("#articleUid").textbox({
required: true,
missingMessage: "发布用户不能为空",
prompt: "请输入发布用户",
onChange: function () {
}
});
$("#content").emojioneArea()[0].emojioneArea.on("keyup change",function (edite,event) {
var $this = $(this);
var count = $this[0].getText().length;
var content = $this[0].getText();
if(count>500){
$this[0].setText(content.substring(0,500));
count = $this[0].getText().length;
}
$("#content-count").text(count);
});
$("#labelId").combobox({
prompt: "请选择标签",
required: false,
selectOnNavigation : true,
valueField: 'id',
textField: 'labelName',
multiple:true,
url : serverContextPath + "/grassLabelManage/getAllGrassLabelInfo",
loadFilter: function (data) {
return defaultLoadFilter(data);
},
onChange:function (data) {
var arr = $(this).combobox("getValues");
var textarr = $(this).combobox("getData");
if(arr.length > 5 ){
$(this).combobox("unselect",arr[arr.length-1]);
// $.messager.alert("提示","标签最多只能选择5个", "info");
arr = $(this).combobox("getValues");
}
var labelList='';
for (var i=0; i<arr.length;i++){
var text = '';
for (var j=0; j< textarr.length;j++){
if(arr[i] == textarr[j].id){
text=textarr[j].labelName;
}
}
labelList+='<span class="tag"><span>'+text+'</span><a href="#" class="labelTag" data-index="'+i+'">x</a></span>&nbsp&nbsp&nbsp'
}
$("#labelList").html(labelList);
}
});
$("#topicGroupId").combobox({
prompt: "选择话题分组",
required: false,
selectOnNavigation : true,
valueField: 'id',
textField: 'groupName',
url : serverContextPath + "/topicGroupManage/getAllTopicGroupInfo",
loadFilter: function (data) {
return defaultLoadFilter(data);
},
onChange:function (data) {
$('#topicId').combobox('reload',serverContextPath + "/grassTopicManage/grassTopicByGroupId?groupId="+data);
// 清空业务线
$("#topicId").combobox("setValue",'');
}
});
$("#topicId").combobox({
prompt: "选择话题",
required: false,
selectOnNavigation : true,
valueField: 'id',
textField: 'topicName',
url : serverContextPath + "/grassTopicManage/grassTopicByGroupId",
loadFilter: function (data) {
return defaultLoadFilter(data);
},
onChange:function (data) {
var arr = $(this).combobox("getValue");
var textarr = $(this).combobox("getData");
var html='';
var text = '';
for (var j=0; j< textarr.length;j++){
if( arr == textarr[j].id){
text=textarr[j].topicName;
}
}
if(text !=''){
html+='<span class="tag"><span>'+text+'</span><a href="#" class="topicTag" ">x</a></span>&nbsp&nbsp&nbsp'
}
$("#topicList").html(html);
}
});
$(document).on("click", ".labelTag", function () {
var index = $(this).attr("data-index");
var arr = $("#labelId").combobox("getValues");
$("#labelId").combobox("unselect",arr[index]);
});
$(document).on("click", ".topicTag", function () {
$("#topicId").combobox("setValue","");
});
$(document).on("click", ".goodTag", function () {
var product_skn = $(this).attr("data-index");
removeSingleItemById(product_skn);
var skns = '';
// for (var i = 0; i < checkedItems.length; i++) {
// if( i == checkedItems.length -1){
// skns = skns+ checkedItems[i]
// }else{
// skns = skns+ checkedItems[i] +","
// }
// }
// $("#skns").val(skns);
var div= $(this).parent("span").parent("div");
div.remove();
});
$("#subBotton").linkbutton({
iconCls: "icon-save",
width:200,
onClick: function () {
$("#publishArticleForm").form("submit",{
url : serverContextPath+"/grassArticle/publishArticle",
onSubmit : function(param) {
;
if (!$("#publishArticleForm").form("validate")) {
return false;
}
var content = $("#content").val();
if(content == '' || content.length<=0){
$.messager.alert("发布失败", "请输入文字内容", "error");
return false;
}
if(content.length>500){
$.messager.alert("发布失败", "内容长度超过500,请重新输入", "error");
return false;
}
var imgs = '';
var imageCount = 0;
$("input[name='url']").each(function(j,item){
var url = item.value;
if(imgs == ''){
imgs = url;
}else{
imgs = imgs + ","+url;
}
imageCount++;
});
$("#imgs").val(imgs);
if(imageCount > 9){
$.messager.alert("发布失败", "最多只能选择9张图片", "error");
return false;
}
if(imageCount < 1){
$.messager.alert("发布失败", "请选择至少一张图片", "error");
return false;
}
var labels = '';
$("input[name='labelId']").each(function(j,item){
var id = item.value;
if(labels == ''){
labels = id;
}else{
labels = labels + ","+id;
}
});
$("#labelIds").val(labels);
var html = '';
for (var i = 0; i < checkedItems.length; i++) {
html += "<input name='products["+i+"].productSkn' hidden value='"+checkedItems[i].productSkn+"'/><br>";
html += "<input name='products["+i+"].productType' hidden value='"+checkedItems[i].productType+"'/>";
}
$("#products").html(html);
return true;
},
success : function(data) {
if (data) {
data = $.parseJSON(data);
if (data.code == 200) {
$.messager.alert("提示","发布成功", "info", function(){window.location.reload()});
// alert("保存成功");
} else {
$.messager.alert("保存失败", data.message, "error");
}
} else {
$.messager.alert("保存失败", data.message, "error");
}
}
});
}
});
$("#draftBotton").linkbutton({
iconCls: "icon-save",
width:200,
onClick: function () {
$("#publishArticleForm").form("submit",{
url : serverContextPath+"/grassArticle/saveArticleDraft",
onSubmit : function(param) {
;
if (!$("#publishArticleForm").form("validate")) {
return false;
}
var content = $("#content").val();
if(content == '' || content.length<=0){
$.messager.alert("保存失败", "请输入文字内容", "error");
return false;
}
if(content.length>500){
$.messager.alert("发布失败", "内容长度超过500,请重新输入", "error");
return false;
}
var imgs = '';
var imageCount = 0;
$("input[name='url']").each(function(j,item){
var url = item.value;
if(imgs == ''){
imgs = url;
}else{
imgs = imgs + ","+url;
}
imageCount++;
});
$("#imgs").val(imgs);
if(imageCount > 9){
$.messager.alert("保存失败", "最多只能选择9张图片", "error");
return false;
}
var labels = '';
$("input[name='labelId']").each(function(j,item){
var id = item.value;
if(labels == ''){
labels = id;
}else{
labels = labels + ","+id;
}
});
$("#labelIds").val(labels);
var html = '';
for (var i = 0; i < checkedItems.length; i++) {
html += "<input name='products["+i+"].productSkn' hidden value='"+checkedItems[i].productSkn+"'/><br>";
html += "<input name='products["+i+"].productType' hidden value='"+checkedItems[i].productType+"'/>";
}
$("#products").html(html);
return true;
},
success : function(data) {
if (data) {
data = $.parseJSON(data);
if (data.code == 200) {
$.messager.alert("提示","保存成功", "info", function(){window.location.reload()});
// alert("保存成功");
} else {
$.messager.alert("保存失败", data.message, "error");
}
} else {
$.messager.alert("保存失败", data.message, "error");
}
}
});
}
});
});
// 定时 选择时间
function getTimeDialog(data,id, status){
var timeChoose = $("<div id='timeChoose'>").appendTo($(document.body));
var title = "选择时间";
var textVar = "确认";
window.self.paramObject.mkData = data;
$(timeChoose).myDialog({
title: title,
width: "20%",
height: "30%",
resizable:false,
buttons:[{
id : "saveBtn",
text:textVar,
iconCls : "icon-save",
handler:function(){
;
var time=''
if($("#publishTimeStr").datetimebox('getValue') !=null && $("#publishTimeStr").datetimebox('getValue') !=''){
time = parseInt(new Date($("#publishTimeStr").datetimebox('getValue')).getTime() );
}else {
$.messager.alert("发布失败", "请选择时间", "error");
return;
}
$("#publishArticleForm").form("submit",{
url : serverContextPath+"/grassArticle/timerPublish",
onSubmit : function(param) {
;
if (!$("#publishArticleForm").form("validate")) {
return false;
}
var content = $("#content").val();
if(content == '' || content.length<=0){
$.messager.alert("保存失败", "请输入文字内容", "error");
return false;
}
if(content.length>500){
$.messager.alert("发布失败", "内容长度超过500,请重新输入", "error");
return false;
}
param.publishTime =time;
var imgs = '';
var imageCount = 0;
$("input[name='url']").each(function(j,item){
var url = item.value;
if(imgs == ''){
imgs = url;
}else{
imgs = imgs + ","+url;
}
imageCount++;
});
$("#imgs").val(imgs);
if(imageCount > 9){
$.messager.alert("发布失败", "最多只能选择9张图片", "error");
return false;
}
if(imageCount < 1){
$.messager.alert("发布失败", "请选择至少一张图片", "error");
return false;
}
var labels = '';
$("input[name='labelId']").each(function(j,item){
var id = item.value;
if(labels == ''){
labels = id;
}else{
labels = labels + ","+id;
}
});
$("#labelIds").val(labels);
var html = '';
for (var i = 0; i < checkedItems.length; i++) {
html += "<input name='products["+i+"].productSkn' hidden value='"+checkedItems[i].productSkn+"'/><br>";
html += "<input name='products["+i+"].productType' hidden value='"+checkedItems[i].productType+"'/>";
}
$("#products").html(html);
return true;
},
success : function(data) {
if (data) {
data = $.parseJSON(data);
if (data.code == 200) {
$.messager.alert("提示","发布成功", "info", function(){window.location.reload()});
// alert("保存成功");
} else {
$.messager.alert("保存失败", data.message, "error");
}
} else {
$.messager.alert("保存失败", data.message, "error");
}
}
});
$(timeChoose).dialog("close");
}
}, {
text: "关闭",
iconCls: "icon-cancel",
handler: function () {
$.messager.confirm("确认", "确认关闭吗?", function (flag) {
if(flag){
$(timeChoose).dialog("close");
}
});
}
}],
modal: true,
href: contextPath + "/html/grass/article/chooseTime.html"
});
}
// 选择商品
function getEditDialog(data){
var labelGroupList = $("<div id='labelGroupList'>").appendTo($(document.body));
var title = "选择商品";
var textVar = "确认";
var msgVar = "确认新增吗?";
window.self.paramObject.mkData = data;
$(labelGroupList).myDialog({
title: title,
width: "70%",
height: "80%",
resizable:false,
buttons:[{
id : "saveBtn",
text:textVar,
iconCls : "icon-save",
handler:function(){
;
$("#goodstd").html("<div id=\"good0\" style=\"float: left;margin-left: 30px;width: 300px\">\n" +
" </div>");
var skns = '';
for (var i = 0; i < checkedItems.length; i++) {
buildgood(i,checkedItems[i]);
}
$(labelGroupList).dialog("close");
}
}, {
text: "关闭",
iconCls: "icon-cancel",
handler: function () {
$.messager.confirm("确认", "确认关闭吗?", function (flag) {
if(flag){
$(labelGroupList).dialog("close");
}
});
}
}],
modal: true,
href: contextPath + "/html/grass/article/chooseSkns.html"
});
}
function buildgood(index,obj) {
var data = checkedItemsObj[obj.productSkn];
$("#good"+index).html(gooddiv(data));
$div = $("#good"+(index+1));
$("#good"+index).after('<div id="good'+(index+1)+'"style="float: left;margin-left: 30px;width: 300px"> </div>');
}
function gooddiv(data) {
return " <span>商品图:<img width=\"120\" height=\"60\" src="+getImageUrl(data.default_images)+
" /> <a href=\"#\" class=\"goodTag\" data-index=\""+data.product_skn+"\">x</a></span>" +
"<h5 style=\"margin-top: 0px;margin-bottom: 0px\">商品名:"+ data.product_name +"</h5>\n" +
"<h5 style=\"margin-top: 0px;margin-bottom: 0px\">价格:"+data.sales_price+"</h5>"
}
function getImageUrl(image) {
var result='';
if (image) {
if(image.indexOf('http://') == 0){
result = image.split("?")[0];
}else{
var fileMode = image.substring(15, 17);
if(fileMode=='01'){
result= "http://"+"img11.static.yhbimg.com"+"/goodsimg"+image;
}
if(fileMode=='02'){
result= "http://"+"img12.static.yhbimg.com"+"/goodsimg"+image;
}
}
}
else {
result = ""
}
if (result) {
return result + "?imageMogr2/thumbnail/320x320/extent/320x320/background/d2hpdGU=/position/center/quality/90";
} else {
return "";
}
}
function findCheckedItem(ID) {
for (var i = 0; i < checkedItems.length; i++) {
if (checkedItems[i].productSkn == ID) return i;
}
return -1;
}
function addcheckItem() {
// if(searchType != checkType && checkedItems.length>0){
// checkedItems=[];
// }
checkType = searchType;
var i=0;
$("input[type='checkbox'][name='product_skn']:checked").each(function () {
if(i > 9){
alert("最多只能选择10个商品");
return false;
}
var k = findCheckedItem($(this).val());
if (k == -1) {
var product = {};
product.productSkn = $(this).val();
product.productType = checkType;
checkedItems.push(product);
}
i++;
});
}
function removeAllItem(rows) {
$("input[type='checkbox'][name='product_skn']").each(function () {
if (!this.checked) {
var k = findCheckedItem($(this).val());
if (k != -1) {
checkedItems.splice(k, 1);
}
}
});
}
function resetSelectedCheckBox(data){
$("input[type='checkbox'][name='product_skn']").each(function () {
var cb=$(this);
$.each(checkedItems,function(index,value){
if(value.productSkn==cb.val()){
cb.attr("checked",true);
return false;
}
});
});
}
function removeSingleItem(rowIndex, rowData) {
var k = findCheckedItem(rowData.product_skn);
if (k != -1) {
checkedItems.splice(k, 1);
}
}
function removeSingleItemById(id) {
debugger
var k = findCheckedItem(id);
if (k != -1) {
checkedItems.splice(k, 1);
}
}
function initGoods(skns,type) {
debugger
var url=serverContextPath+"/grassArticle/queryGoods";
// var url = contextPath+"/search/queryGoods";
var query ='';
var params ='';
for (var i=0;i<skns.length;i++){
if(query==''){
query = skns[i];
}else{
query = query+","+skns[i];
}
}
if(type==1){
params = "?query="+query;
}
if(type==2){
params = "?query="+query+"&type=UFO";
}
$.ajax({
type : "post",
url : url+params,
async : false,
success : function(data){
debugger
if(data.code == 200){
for (var i=0; i<data.data.list.length;i++){
var rowdata = data.data.list[i]
checkedItemsObj[rowdata.product_skn] = rowdata;
}
}
}
});
}
function initGoodsDiv() {
for (var i = 0; i < checkedItems.length; i++) {
buildgood(i,checkedItems[i].productSkn);
}
}
function htmlTopic(text){
var html='';
if(text !='' && text!=null){
html+='<span class="tag"><span>'+text+'</span><a href="#" class="topicTag" ">x</a></span>&nbsp&nbsp&nbsp'
}
$("#topicList").html(html);
}
</script>
<script>
function getSignature() {
return axios.post("/pfcms/grassArticle/getTencentSignature").then(function (res) {
return res.data.data;
}).catch(function (error) {
console.log(error);
});
}
new Vue({
el: '#tt',
// state
data () {
return {
videoUploaderInfo: {
progress: 0,
videoUrl: data.videoUrl || "",
coverUrl: data.coverUrl || "",
}
}
},
created: function () {
this.tcVod = new TcVod.default({
getSignature: getSignature
})
},
// actions
methods: {
videoAdd: function () {
this.$refs.videoFile.click()
},
videoUpload: function () {
var self = this;
var mediaFile = this.$refs.videoFile.files[0]
var uploader = this.tcVod.upload({
mediaFile: mediaFile,
})
self.videoUploaderInfo = {
videoInfo: uploader.videoInfo,
isVideoUploadSuccess: false,
isVideoUploadCancel: false,
progress: 0,
fileId: '',
videoUrl: '',
cancel: function() {
self.videoUploaderInfo.isVideoUploadCancel = true;
uploader.cancel()
},
}
uploader.on('media_progress', function (info) {
self.videoUploaderInfo.progress = info.percent;
})
uploader.on('media_upload', function (info) {
self.videoUploaderInfo.isVideoUploadSuccess = true;
})
uploader.done().then(function(doneResult) {
self.videoUploaderInfo.fileId = doneResult.fileId;
self.videoUploaderInfo.videoUrl = doneResult.video.url;
})
},
videoCoverUpload: function () {
console.log("videoCoverUpload");
var self = this;
var coverFile = this.$refs.videoCoverFile.files[0];
var uploader = this.tcVod.upload({
coverFile: coverFile,
fileId: self.videoUploaderInfo.fileId
})
uploader.on('cover_upload', function (info) {
self.videoUploaderInfo.coverUrl = "https://v.yohobuy.com/" + info.Key;
self.$forceUpdate()
})
}
}
})
</script>
\ No newline at end of file
... ...
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Yoho!Buy运营平台</title>
<script src="/pfcms/js/include.js"></script>
<script src="/pfcms/js/ajaxfileupload.js"></script>
<script src="/pfcms/js/jquery.imageUpload.js"></script>
</head>
<body>
<script>
$(function () {
$('body').load('editorVideoDetail.html');
})
</script>
</body>
</html>
\ No newline at end of file
... ...
... ... @@ -539,11 +539,7 @@
var dataId = $(this).attr("dataId");
var sort = $(this).attr("sort");
index = $(this).attr("index");
if(sort == '1'){
articleEditer(data.rows[index]);
}else{
longArticleEditer(data.rows[index]);
}
editor(sort, data.rows[index]);
}
});
... ... @@ -673,7 +669,21 @@
}
// 编辑
function articleEditer(data){
function editor(sort, data) {
var editorFilePath = "";
if (sort == 1) {
editorFilePath = "/html/grass/article/editArticle.html"
}
else if (sort == 4) {
editorFilePath = "/html/grass/article/editorVideoDetail.html";
}
else {
editorFilePath = "/html/grass/longArticle/edit.html"
}
var articleEditer = $("<div id='articleEditer'>").appendTo($(document.body));
var title = "编辑";
data.editFlag = 1;
... ... @@ -684,24 +694,9 @@
height: "100%",
resizable:false,
modal: true,
href: contextPath + "/html/grass/article/editArticle.html"
href: contextPath + editorFilePath
});
}
// 编辑
function longArticleEditer(data){
var articleEditer = $("<div id='articleEditer'>").appendTo($(document.body));
var title = "编辑";
data.editFlag = 1;
window.self.paramObject.mkData = data;
$(articleEditer).myDialog({
title: title,
width: "95%",
height: "100%",
resizable:false,
modal: true,
href: contextPath + "/html/grass/longArticle/edit.html"
});
}
function switchRecommend(id, status) {
... ...
/* axios v0.19.0 | (c) 2019 by Matt Zabriskie */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.axios=t():e.axios=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";function r(e){var t=new i(e),n=s(i.prototype.request,t);return o.extend(n,i.prototype,t),o.extend(n,t),n}var o=n(2),s=n(3),i=n(5),a=n(22),u=n(11),c=r(u);c.Axios=i,c.create=function(e){return r(a(c.defaults,e))},c.Cancel=n(23),c.CancelToken=n(24),c.isCancel=n(10),c.all=function(e){return Promise.all(e)},c.spread=n(25),e.exports=c,e.exports.default=c},function(e,t,n){"use strict";function r(e){return"[object Array]"===j.call(e)}function o(e){return"[object ArrayBuffer]"===j.call(e)}function s(e){return"undefined"!=typeof FormData&&e instanceof FormData}function i(e){var t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer}function a(e){return"string"==typeof e}function u(e){return"number"==typeof e}function c(e){return"undefined"==typeof e}function f(e){return null!==e&&"object"==typeof e}function p(e){return"[object Date]"===j.call(e)}function d(e){return"[object File]"===j.call(e)}function l(e){return"[object Blob]"===j.call(e)}function h(e){return"[object Function]"===j.call(e)}function m(e){return f(e)&&h(e.pipe)}function y(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams}function g(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}function x(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)}function v(e,t){if(null!==e&&"undefined"!=typeof e)if("object"!=typeof e&&(e=[e]),r(e))for(var n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.call(null,e[s],s,e)}function w(){function e(e,n){"object"==typeof t[n]&&"object"==typeof e?t[n]=w(t[n],e):t[n]=e}for(var t={},n=0,r=arguments.length;n<r;n++)v(arguments[n],e);return t}function b(){function e(e,n){"object"==typeof t[n]&&"object"==typeof e?t[n]=b(t[n],e):"object"==typeof e?t[n]=b({},e):t[n]=e}for(var t={},n=0,r=arguments.length;n<r;n++)v(arguments[n],e);return t}function E(e,t,n){return v(t,function(t,r){n&&"function"==typeof t?e[r]=S(t,n):e[r]=t}),e}var S=n(3),R=n(4),j=Object.prototype.toString;e.exports={isArray:r,isArrayBuffer:o,isBuffer:R,isFormData:s,isArrayBufferView:i,isString:a,isNumber:u,isObject:f,isUndefined:c,isDate:p,isFile:d,isBlob:l,isFunction:h,isStream:m,isURLSearchParams:y,isStandardBrowserEnv:x,forEach:v,merge:w,deepMerge:b,extend:E,trim:g}},function(e,t){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}}},function(e,t){/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
e.exports=function(e){return null!=e&&null!=e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}},function(e,t,n){"use strict";function r(e){this.defaults=e,this.interceptors={request:new i,response:new i}}var o=n(2),s=n(6),i=n(7),a=n(8),u=n(22);r.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{},e.url=arguments[0]):e=e||{},e=u(this.defaults,e),e.method=e.method?e.method.toLowerCase():"get";var t=[a,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach(function(e){t.unshift(e.fulfilled,e.rejected)}),this.interceptors.response.forEach(function(e){t.push(e.fulfilled,e.rejected)});t.length;)n=n.then(t.shift(),t.shift());return n},r.prototype.getUri=function(e){return e=u(this.defaults,e),s(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},o.forEach(["delete","get","head","options"],function(e){r.prototype[e]=function(t,n){return this.request(o.merge(n||{},{method:e,url:t}))}}),o.forEach(["post","put","patch"],function(e){r.prototype[e]=function(t,n,r){return this.request(o.merge(r||{},{method:e,url:t,data:n}))}}),e.exports=r},function(e,t,n){"use strict";function r(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var o=n(2);e.exports=function(e,t,n){if(!t)return e;var s;if(n)s=n(t);else if(o.isURLSearchParams(t))s=t.toString();else{var i=[];o.forEach(t,function(e,t){null!==e&&"undefined"!=typeof e&&(o.isArray(e)?t+="[]":e=[e],o.forEach(e,function(e){o.isDate(e)?e=e.toISOString():o.isObject(e)&&(e=JSON.stringify(e)),i.push(r(t)+"="+r(e))}))}),s=i.join("&")}if(s){var a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}},function(e,t,n){"use strict";function r(){this.handlers=[]}var o=n(2);r.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},r.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},r.prototype.forEach=function(e){o.forEach(this.handlers,function(t){null!==t&&e(t)})},e.exports=r},function(e,t,n){"use strict";function r(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var o=n(2),s=n(9),i=n(10),a=n(11),u=n(20),c=n(21);e.exports=function(e){r(e),e.baseURL&&!u(e.url)&&(e.url=c(e.baseURL,e.url)),e.headers=e.headers||{},e.data=s(e.data,e.headers,e.transformRequest),e.headers=o.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),o.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]});var t=e.adapter||a.adapter;return t(e).then(function(t){return r(e),t.data=s(t.data,t.headers,e.transformResponse),t},function(t){return i(t)||(r(e),t&&t.response&&(t.response.data=s(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})}},function(e,t,n){"use strict";var r=n(2);e.exports=function(e,t,n){return r.forEach(n,function(n){e=n(e,t)}),e}},function(e,t){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,n){"use strict";function r(e,t){!s.isUndefined(e)&&s.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}function o(){var e;return"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process)?e=n(13):"undefined"!=typeof XMLHttpRequest&&(e=n(13)),e}var s=n(2),i=n(12),a={"Content-Type":"application/x-www-form-urlencoded"},u={adapter:o(),transformRequest:[function(e,t){return i(t,"Accept"),i(t,"Content-Type"),s.isFormData(e)||s.isArrayBuffer(e)||s.isBuffer(e)||s.isStream(e)||s.isFile(e)||s.isBlob(e)?e:s.isArrayBufferView(e)?e.buffer:s.isURLSearchParams(e)?(r(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):s.isObject(e)?(r(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},s.forEach(["delete","get","head"],function(e){u.headers[e]={}}),s.forEach(["post","put","patch"],function(e){u.headers[e]=s.merge(a)}),e.exports=u},function(e,t,n){"use strict";var r=n(2);e.exports=function(e,t){r.forEach(e,function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])})}},function(e,t,n){"use strict";var r=n(2),o=n(14),s=n(6),i=n(17),a=n(18),u=n(15);e.exports=function(e){return new Promise(function(t,c){var f=e.data,p=e.headers;r.isFormData(f)&&delete p["Content-Type"];var d=new XMLHttpRequest;if(e.auth){var l=e.auth.username||"",h=e.auth.password||"";p.Authorization="Basic "+btoa(l+":"+h)}if(d.open(e.method.toUpperCase(),s(e.url,e.params,e.paramsSerializer),!0),d.timeout=e.timeout,d.onreadystatechange=function(){if(d&&4===d.readyState&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in d?i(d.getAllResponseHeaders()):null,r=e.responseType&&"text"!==e.responseType?d.response:d.responseText,s={data:r,status:d.status,statusText:d.statusText,headers:n,config:e,request:d};o(t,c,s),d=null}},d.onabort=function(){d&&(c(u("Request aborted",e,"ECONNABORTED",d)),d=null)},d.onerror=function(){c(u("Network Error",e,null,d)),d=null},d.ontimeout=function(){c(u("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",d)),d=null},r.isStandardBrowserEnv()){var m=n(19),y=(e.withCredentials||a(e.url))&&e.xsrfCookieName?m.read(e.xsrfCookieName):void 0;y&&(p[e.xsrfHeaderName]=y)}if("setRequestHeader"in d&&r.forEach(p,function(e,t){"undefined"==typeof f&&"content-type"===t.toLowerCase()?delete p[t]:d.setRequestHeader(t,e)}),e.withCredentials&&(d.withCredentials=!0),e.responseType)try{d.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&d.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&d.upload&&d.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){d&&(d.abort(),c(e),d=null)}),void 0===f&&(f=null),d.send(f)})}},function(e,t,n){"use strict";var r=n(15);e.exports=function(e,t,n){var o=n.config.validateStatus;!o||o(n.status)?e(n):t(r("Request failed with status code "+n.status,n.config,null,n.request,n))}},function(e,t,n){"use strict";var r=n(16);e.exports=function(e,t,n,o,s){var i=new Error(e);return r(i,t,n,o,s)}},function(e,t){"use strict";e.exports=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},function(e,t,n){"use strict";var r=n(2),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,s,i={};return e?(r.forEach(e.split("\n"),function(e){if(s=e.indexOf(":"),t=r.trim(e.substr(0,s)).toLowerCase(),n=r.trim(e.substr(s+1)),t){if(i[t]&&o.indexOf(t)>=0)return;"set-cookie"===t?i[t]=(i[t]?i[t]:[]).concat([n]):i[t]=i[t]?i[t]+", "+n:n}}),i):i}},function(e,t,n){"use strict";var r=n(2);e.exports=r.isStandardBrowserEnv()?function(){function e(e){var t=e;return n&&(o.setAttribute("href",t),t=o.href),o.setAttribute("href",t),{href:o.href,protocol:o.protocol?o.protocol.replace(/:$/,""):"",host:o.host,search:o.search?o.search.replace(/^\?/,""):"",hash:o.hash?o.hash.replace(/^#/,""):"",hostname:o.hostname,port:o.port,pathname:"/"===o.pathname.charAt(0)?o.pathname:"/"+o.pathname}}var t,n=/(msie|trident)/i.test(navigator.userAgent),o=document.createElement("a");return t=e(window.location.href),function(n){var o=r.isString(n)?e(n):n;return o.protocol===t.protocol&&o.host===t.host}}():function(){return function(){return!0}}()},function(e,t,n){"use strict";var r=n(2);e.exports=r.isStandardBrowserEnv()?function(){return{write:function(e,t,n,o,s,i){var a=[];a.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(o)&&a.push("path="+o),r.isString(s)&&a.push("domain="+s),i===!0&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},function(e,t){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,n){"use strict";var r=n(2);e.exports=function(e,t){t=t||{};var n={};return r.forEach(["url","method","params","data"],function(e){"undefined"!=typeof t[e]&&(n[e]=t[e])}),r.forEach(["headers","auth","proxy"],function(o){r.isObject(t[o])?n[o]=r.deepMerge(e[o],t[o]):"undefined"!=typeof t[o]?n[o]=t[o]:r.isObject(e[o])?n[o]=r.deepMerge(e[o]):"undefined"!=typeof e[o]&&(n[o]=e[o])}),r.forEach(["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"],function(r){"undefined"!=typeof t[r]?n[r]=t[r]:"undefined"!=typeof e[r]&&(n[r]=e[r])}),n}},function(e,t){"use strict";function n(e){this.message=e}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,e.exports=n},function(e,t,n){"use strict";function r(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var n=this;e(function(e){n.reason||(n.reason=new o(e),t(n.reason))})}var o=n(23);r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var e,t=new r(function(t){e=t});return{token:t,cancel:e}},e.exports=r},function(e,t){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}}])});
//# sourceMappingURL=axios.min.map
\ No newline at end of file
... ...
This diff could not be displayed because it is too large.
/*!
* clipboard.js v2.0.4
* https://zenorocha.github.io/clipboard.js
*
* Licensed MIT © Zeno Rocha
*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return function(n){var o={};function r(t){if(o[t])return o[t].exports;var e=o[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,r),e.l=!0,e.exports}return r.m=n,r.c=o,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function o(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),t}}(),a=o(n(1)),c=o(n(3)),u=o(n(4));function o(t){return t&&t.__esModule?t:{default:t}}var l=function(t){function o(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this));return n.resolveOptions(e),n.listenClick(t),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(o,c.default),i(o,[{key:"resolveOptions",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===r(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=(0,u.default)(t,"click",function(t){return e.onClick(t)})}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new a.default({action:this.action(e),target:this.target(e),text:this.text(e),container:this.container,trigger:e,emitter:this})}},{key:"defaultAction",value:function(t){return s("action",t)}},{key:"defaultTarget",value:function(t){var e=s("target",t);if(e)return document.querySelector(e)}},{key:"defaultText",value:function(t){return s("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:["copy","cut"],e="string"==typeof t?[t]:t,n=!!document.queryCommandSupported;return e.forEach(function(t){n=n&&!!document.queryCommandSupported(t)}),n}}]),o}();function s(t,e){var n="data-clipboard-"+t;if(e.hasAttribute(n))return e.getAttribute(n)}t.exports=l},function(t,e,n){"use strict";var o,r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function o(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),t}}(),a=n(2),c=(o=a)&&o.__esModule?o:{default:o};var u=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.resolveOptions(t),this.initSelection()}return i(e,[{key:"resolveOptions",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,e="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,c.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,c.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var e=void 0;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(void 0!==t){if(!t||"object"!==(void 0===t?"undefined":r(t))||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),e}();t.exports=u},function(t,e){t.exports=function(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var o=window.getSelection(),r=document.createRange();r.selectNodeContents(t),o.removeAllRanges(),o.addRange(r),e=o.toString()}return e}},function(t,e){function n(){}n.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){var o=this;function r(){o.off(t,r),e.apply(n,arguments)}return r._=e,this.on(t,r,n)},emit:function(t){for(var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,r=n.length;o<r;o++)n[o].fn.apply(n[o].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),o=n[t],r=[];if(o&&e)for(var i=0,a=o.length;i<a;i++)o[i].fn!==e&&o[i].fn._!==e&&r.push(o[i]);return r.length?n[t]=r:delete n[t],this}},t.exports=n},function(t,e,n){var d=n(5),h=n(6);t.exports=function(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!d.string(e))throw new TypeError("Second argument must be a String");if(!d.fn(n))throw new TypeError("Third argument must be a Function");if(d.node(t))return s=e,f=n,(l=t).addEventListener(s,f),{destroy:function(){l.removeEventListener(s,f)}};if(d.nodeList(t))return a=t,c=e,u=n,Array.prototype.forEach.call(a,function(t){t.addEventListener(c,u)}),{destroy:function(){Array.prototype.forEach.call(a,function(t){t.removeEventListener(c,u)})}};if(d.string(t))return o=t,r=e,i=n,h(document.body,o,r,i);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");var o,r,i,a,c,u,l,s,f}},function(t,n){n.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},n.nodeList=function(t){var e=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===e||"[object HTMLCollection]"===e)&&"length"in t&&(0===t.length||n.node(t[0]))},n.string=function(t){return"string"==typeof t||t instanceof String},n.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},function(t,e,n){var a=n(7);function i(t,e,n,o,r){var i=function(e,n,t,o){return function(t){t.delegateTarget=a(t.target,n),t.delegateTarget&&o.call(e,t)}}.apply(this,arguments);return t.addEventListener(n,i,r),{destroy:function(){t.removeEventListener(n,i,r)}}}t.exports=function(t,e,n,o,r){return"function"==typeof t.addEventListener?i.apply(null,arguments):"function"==typeof n?i.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,function(t){return i(t,e,n,o,r)}))}},function(t,e){if("undefined"!=typeof Element&&!Element.prototype.matches){var n=Element.prototype;n.matches=n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector}t.exports=function(t,e){for(;t&&9!==t.nodeType;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}}])});
\ No newline at end of file
... ...