From 6cf8b20993dbe45c4cb2fb91650ac46d885a3dfe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E8=B1=AA?= <781521347@qq.com>
Date: Thu, 21 Oct 2021 14:02:03 +0800
Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/layout/components/Sidebar/Logo.vue | 2 +-
src/router/routers.js | 5 +-
src/store/getters.js | 1 +
src/store/modules/api.js | 3 +
src/views/wechat/reply/addReply.vue | 106 +++++++++++++++++++++----
5 files changed, 100 insertions(+), 17 deletions(-)
diff --git a/src/layout/components/Sidebar/Logo.vue b/src/layout/components/Sidebar/Logo.vue
index 05acb75..76db837 100644
--- a/src/layout/components/Sidebar/Logo.vue
+++ b/src/layout/components/Sidebar/Logo.vue
@@ -25,7 +25,7 @@ export default {
},
data() {
return {
- title: '禅易精舍后台管理系统',
+ title: '禅易云生态管理系统',
logo: Logo
}
}
diff --git a/src/router/routers.js b/src/router/routers.js
index ac39b96..a13e2c3 100644
--- a/src/router/routers.js
+++ b/src/router/routers.js
@@ -67,11 +67,12 @@ export const constantRouterMap = [
},
component: (resolve) => require(['@/components/editorMaterial/index'], resolve),
hidden: true
- }
+ },
+ { path: '*', component: (resolve) => require(['@/views/home'], resolve) }
]
export default new Router({
- mode: 'hash',
+ mode: 'history',
scrollBehavior: () => ({ y: 0 }),
routes: constantRouterMap
})
diff --git a/src/store/getters.js b/src/store/getters.js
index ffc9f37..03e3313 100644
--- a/src/store/getters.js
+++ b/src/store/getters.js
@@ -19,6 +19,7 @@ const getters = {
uploadApi: state => state.api.uploadApi,
updateAvatarApi: state => state.api.updateAvatarApi,
qiNiuUploadApi: state => state.api.qiNiuUploadApi,
+ wechatUploadApi: state => state.api.wechatUploadApi,
sqlApi: state => state.api.sqlApi,
swaggerApi: state => state.api.swaggerApi
}
diff --git a/src/store/modules/api.js b/src/store/modules/api.js
index d26c39f..a63382d 100644
--- a/src/store/modules/api.js
+++ b/src/store/modules/api.js
@@ -12,6 +12,9 @@ const api = {
// 修改头像
updateAvatarApi: baseUrl + '/api/users/updateAvatar',
// 上传文件到七牛云
+ wechatUploadApi: baseUrl + '/api/wechat/upload',
+
+ // 公众号自动回复上传图片地址
qiNiuUploadApi: baseUrl + '/api/qiNiuContent',
uploadApi: baseUrl + '/api/upload',
diff --git a/src/views/wechat/reply/addReply.vue b/src/views/wechat/reply/addReply.vue
index 1a8831b..3bf9140 100644
--- a/src/views/wechat/reply/addReply.vue
+++ b/src/views/wechat/reply/addReply.vue
@@ -41,7 +41,7 @@
-
+
@@ -105,7 +105,7 @@
-
+
@@ -117,10 +117,12 @@
-
+
+
+
+
+
+
@@ -130,15 +132,46 @@
@@ -161,6 +194,8 @@ import { del, add, get } from '@/api/yxWechatReply'
import eForm from './form'
import picUpload from '@/components/pic-upload'
import { Message } from 'element-ui'
+import { mapGetters } from 'vuex'
+import { getToken } from '@/utils/auth'
export default {
components: { eForm, picUpload },
mixins: [initData],
@@ -180,25 +215,41 @@ export default {
content: ''
},
image: {
- src: ''
+ src: '',
+ mediaId:'',
+ },
+ article:{
+
},
voice: {
src: ''
},
- news: []
+ news: {
+ articleId:'',
+ }
},
uploadColl: function() {
},
uploadLink: '',
- result: null
+ result: null,
+ headers: {
+ 'Authorization': getToken()
+ },
+ articleList:[]
}
},
+ computed: {
+ ...mapGetters([
+ 'wechatUploadApi'
+ ])
+ },
created() {
this.$nextTick(() => {
this.init()
})
},
mounted: function() {
+ this.getArticleList()
this.key = 'subscribe'
this.msg = '编辑关注回复'
get().then(rese => {
@@ -217,8 +268,28 @@ export default {
})
},
methods: {
+ //获取图文列表
+ getArticleList(){
+ this.$http('/api/yxArticle?page=100&size=100&sort=id,desc','get').then((res)=>{
+ this.articleList = res.content
+ })
+ },
+ // 图片上传
+ handleUploadSuccess(response, file, fileList) {
+ console.log(file)
+ this.dataGroup.image.src= file.response.url;
+ this.dataGroup.image.mediaId= file.response.mediaId;
+ },
+ // 限制图片上传大小
+ beforeAvatarUpload(file) {
+ console.log(file)
+ const isLt2M = file.size / 1024 / 1024 < 2
+ if (!isLt2M) {
+ this.$message.error('上传头像图片大小不能超过 2MB!')
+ }
+ return isLt2M
+ },
radioChange(){
- console.log(this.replyStatus)
if(this.replyStatus == 1){
this.key = 'subscribe'
this.readonly = true
@@ -259,6 +330,7 @@ export default {
edit(data) {
this.isAdd = false
const _this = this.$refs.form
+ console.log(data,'data')
_this.form = {
id: data.id,
key: data.key,
@@ -271,9 +343,11 @@ export default {
},
submit: function() {
if (!this.check()) return false
-
+ console.log(this.type)
+ console.log(this.dataGroup[this.type])
add({ key: this.key, status: this.status, data: this.dataGroup[this.type], type: this.type }).then(function(res) {
Message({ message: '设置成功', type: 'success' })
+
}).catch(function(err) {
// Message({message: err,type: 'error'})
})
@@ -288,6 +362,10 @@ export default {
// if (dataGroup.image.src == '') { return this.returnError('请上传图片') }
if (dataGroup.image.mediaId == '') { return this.returnError('请上传图片') }
break
+ case 'image':
+ // if (dataGroup.image.src == '') { return this.returnError('请上传图片') }
+ if (dataGroup.image.articleId == '') { return this.returnError('请选择文章') }
+ break
}
return true
}