文章置顶等

master
yujialong 2 years ago
parent b2dc8250e3
commit 9e75121a19
  1. 1
      src/api/index.js
  2. 2
      src/layouts/header/index.vue
  3. 30
      src/pages/article/list/index.vue
  4. 2
      src/pages/user/list/index.vue
  5. 40
      src/plugins/requests/index.js

@ -76,4 +76,5 @@ export default {
individualTemplateDetailsStyle: `iasf/template/individualTemplateDetailsStyle`,
longPageListStyle: `iasf/template/longPageListStyle`,
resort: `iasf/sysContent/sort`,
articleTopOperation: `iasf/sysContent/articleTopOperation`,
}

@ -98,7 +98,7 @@ export default {
//
toIndex() {
const { site } = this.$store.state.content
window.open((Setting.isDev ? `http://${location.hostname}:8095` : site.domainName) + `/#/column?siteId=${site.id}`)
window.open((Setting.isDev ? `http://${location.hostname}:8095/` : site.domainName) + `#/column?siteId=${site.id}`)
},
//
siteCommand(e) {

@ -39,18 +39,6 @@
<el-table-column v-if="settings[0].show" type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column v-if="settings[1].show" show-overflow-tooltip prop="title" label="标题" align="center" min-width="150"></el-table-column>
<el-table-column prop="sequence" label="文章排序" align="center" min-width="110" sortable="custom">
<template slot-scope="scope">
<el-input
v-if="scope.row.editing"
class="squ-input"
v-model.number="scope.row.sequence"
></el-input>
<span v-else>{{ scope.row.sequence }}</span>
<i v-if="scope.row.editing" class="el-icon-check squ-icon" @click="submitSequence(scope.row)"></i>
<i v-auth="'/site/list:' + siteName + ':内容管理:文章管理:文章排序设置'" v-else class="el-icon-edit squ-icon" @click="editSequence(scope.row)"></i>
</template>
</el-table-column>
<el-table-column v-if="settings[2].show" prop="columnName" label="栏目" align="center" min-width="120"></el-table-column>
<el-table-column prop="classificationName" label="所属分类" align="center" min-width="120"></el-table-column>
<el-table-column v-if="settings[3].show" prop="typeId" label="栏目类型" align="center" min-width="100">
@ -68,13 +56,18 @@
{{ scope.row.isRelease ? '已发布' : '草稿' }}
</template>
</el-table-column>
<el-table-column v-if="settings[10].show" label="操作" align="center" width="210">
<el-table-column v-auth="'/site/list:' + siteName + ':内容管理:文章管理:置顶'" prop="sequence" label="置顶" align="center" min-width="80" sortable="custom">
<template slot-scope="scope">
<i v-if="scope.row.isRelease" :class="['squ-icon', scope.row.isTop ? 'el-icon-check' : 'el-icon-close']" @click="sticky(scope.row)"></i>
</template>
</el-table-column>
<el-table-column v-if="settings[10].show" label="操作" align="center" width="190">
<template slot-scope="scope">
<el-button v-auth="'/site/list:' + siteName + ':内容管理:文章管理:置顶'" type="text" @click="sticky(scope.row)">置顶</el-button>
<el-button v-auth="'/site/list:' + siteName + ':内容管理:文章管理:预览'" type="text" @click="preview(scope.row)">预览</el-button>
<el-button v-auth="'/site/list:' + siteName + ':内容管理:文章管理:编辑'" type="text" @click="edit(scope.row)">编辑</el-button>
<el-button v-auth="'/site/list:' + siteName + ':内容管理:文章管理:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button>
<el-switch
v-if="scope.row.isRelease"
v-auth="'/site/list:' + siteName + ':内容管理:文章管理:禁用'"
class="m-l-10"
v-model="scope.row.isDisable"
@ -362,7 +355,7 @@ export default {
},
//
sticky(row) {
this.$post(`${this.api.modifiedSort}?articleId=${row.id}&sequenceNumber=1`).then(res => {
this.$post(`${this.api.articleTopOperation}?articleId=${row.id}&isTop=${row.isTop ? 0 : 1}`).then(res => {
this.initData()
}).catch(res => {})
},
@ -391,8 +384,13 @@ export default {
text-overflow: ellipsis;
}
.squ-icon {
margin-left: 5px;
font-size: 16px;
font-weight: 600;
cursor: pointer;
color: #f70000;
&.el-icon-check {
color: #05991e;
}
}
/deep/.squ-input {
width: auto;

@ -521,7 +521,7 @@ export default {
const len = cas.length
if (cas && len) {
this.orgForm.pid = cas[len - 1]
} else {
} else if (!form.pid) {
form.pid = 0
}
if (!form.id) {

@ -47,28 +47,26 @@ service.interceptors.response.use(
// 服务器状态码不是200的情况
error => {
if (error.response.status) {
switch (error.response.status) {
case 500:
Util.errorMsg("网络错误");
break;
// 401token过期
const { msg, code } = error.response.data
switch (code) {
// 401: 未登录
case 401:
Util.errorMsg(error.response.data.msg)
setTimeout(() => {
store.dispatch('user/logout')
}, 1000)
break;
// 404请求不存在
case 404:
Util.errorMsg("网络请求不存在!");
break;
case 401001:
Util.errorMsg(error.response.data.msg);
break;
// 其他错误,直接抛出错误提示
default:
Util.errorMsg(error.response.data.msg);
Promise.reject(res);
Util.errorMsg("登录过期,请重新登录");
setTimeout(() => {
store.dispatch('user/logout')
}, 1000);
break;
// 403 token过期
case 403:
Util.errorMsg("登录过期,请重新登录");
setTimeout(() => {
store.dispatch('user/logout')
}, 1000);
break;
// 其他错误,直接抛出错误提示
default:
Util.errorMsg(msg);
Promise.reject(error.response.data);
}
return Promise.reject(error.response);
}

Loading…
Cancel
Save