diff --git a/src/components/setting/comment/CommentManage.vue b/src/components/setting/comment/CommentManage.vue
index 3b1335c..ade1261 100644
--- a/src/components/setting/comment/CommentManage.vue
+++ b/src/components/setting/comment/CommentManage.vue
@@ -17,25 +17,25 @@
@@ -87,7 +87,6 @@ export default {
}
},
mounted() {
- this.getFormatDate();
},
created() {
this.getUserInfo();
@@ -104,7 +103,7 @@ export default {
type: 'warning'
}).then(() => {
axios({
- method: 'get',
+ method: 'post',
// 请求的地址
url: '/api/comment/deleteByCommentId',
// URL 中的查询参数
@@ -137,6 +136,30 @@ export default {
});
});
},
+ // 格式化时间
+ dateFormat(fmt, date) {
+ let ret="";
+ date=new Date(date);
+ const opt = {
+ 'Y+': date.getFullYear().toString(), // 年
+ 'm+': (date.getMonth() + 1).toString(), // 月
+ 'd+': date.getDate().toString(), // 日
+ 'H+': date.getHours().toString(), // 时
+ 'M+': date.getMinutes().toString(), // 分
+ 'S+': date.getSeconds().toString() // 秒
+ // 有其他格式化字符需求可以继续添加,必须转化成字符串
+ }
+ for (let k in opt) {
+ ret = new RegExp('(' + k + ')').exec(fmt)
+ if (ret) {
+ fmt = fmt.replace(
+ ret[1],
+ ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
+ )
+ }
+ }
+ return fmt
+ },
// 编辑按钮:
handleEdit(index) {
var _this = this;
@@ -176,17 +199,14 @@ export default {
var that = this;
axios({
method:'get',
- url:'/api/notice/select',
+ url:'/api/comment/view_reply',
params:{
}
}).then(function(res){
that.List = res.data;
for(let i = 0 ; i < that.List.length; i++){
- var date = new Date(that.List[i].createtime);// 时间戳为10位需*1000,时间戳为13位的话不需乘1000
- var Y = date.getFullYear() + '年';
- var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '月';
- var D = date.getDate() + '日 ';
- that.List[i].createtime = "" + Y + M + D;
+ var tmp = that.List[i].commentTime
+ that.List[i].commentTime = that.dateFormat('YYYY-mm-dd',tmp);
}
})
// /selectAllArticleByadmin