bihuisong 1 рік тому
батько
коміт
3b5ea54a4f

+ 2 - 1
api/knowledge/knowledge.js

@@ -13,10 +13,11 @@ export function getDetails(id) {
     method: 'get',
   })
 }
-export function popularKnowledgeList() {
+export function popularKnowledgeList(query) {
   return request({
     url: '/knowledge/base/popularKnowledgeList',
     method: 'get',
+	params:query
   })
 }
 /**

+ 4 - 4
pages/index/index.vue

@@ -370,7 +370,7 @@
 				})
 				return
 			} else {
-				this.queryParams.pageNum += 1;
+				this.knowledgeParams.pageNum += 1;
 				this.getList()
 			}
 		},
@@ -392,14 +392,14 @@
 				})	
 			},
 			// 热门知识获取数据
-			getList(pageNum) {
+			getList() {
 				let params = {
 					pageSize: this.knowledgeParams.pageSize,
-					pageNum: pageNum,
+					pageNum: this.knowledgeParams.pageNum,
 				}
 				popularKnowledgeList(params).then(res => {
 					if (res.code == 200) {
-						this.dataSource = [...this.dataSource, ...res.rows]
+						this.dataSource = res.rows
 						this.total = res.total
 						console.log("this.dataSource", this.dataSource)
 					}

+ 1 - 1
pages/knowledge/knowledge.vue

@@ -93,7 +93,7 @@
 				}
 				list(params).then(res => {
 					if (res.code == 200) {
-						this.dataSource = [...this.dataSource,...res.rows]
+						this.dataSource = res.rows
 						this.total = res.total
 					}
 				})

+ 5 - 5
pages/knowledge/knowledgeForm.vue

@@ -7,9 +7,9 @@
 					<uni-easyinput v-model="customFormData.titleName" placeholder="请输入标题" />
 				</uni-forms-item>
 				<uni-forms-item label="正文" required name="textDetails">
-					<!-- <uni-easyinput v-model="customFormData.textDetails" placeholder="请输入正文" /> -->
-					<piaoyiEditor :maxlength="30000" @changes="saveContens" :readOnly="readOnly" :photoUrl="photoUrl"
-						:api="api" :name="name" />
+					<uni-easyinput type="textarea" v-model="customFormData.textDetails" placeholder="请输入正文" />
+					<!-- <piaoyiEditor :maxlength="30000" @changes="saveContens" :readOnly="readOnly" :photoUrl="photoUrl"
+						:api="api" :name="name" /> -->
 				</uni-forms-item>
 				<uni-forms-item label="图片" required name="url">
 					<upload :imgArr="imgUrlList" :fileSize="1" :limit="3" @updateImg="updateImg" />
@@ -40,8 +40,8 @@
 		},
 		data() {
 			return {
-				api: config.baseUrl + `/common/upload`,
-				// photoUrl: config.baseUrl,
+				api: `/common/upload`,
+				photoUrl: config.baseUrl,
 				readOnly: false,
 				// 基础表单数据
 				baseFormData: {

+ 1 - 1
pages/lifeServices/lifeServices.vue

@@ -96,7 +96,7 @@
 				}
 				list(params).then(res => {
 					if (res.code == 200) {
-						this.dataSource = [...this.dataSource,...res.rows]
+						this.dataSource = res.rows
 						this.total = res.total
 					}
 				})

+ 1 - 1
pages/liveBroadcast/liveBroadcast.vue

@@ -96,7 +96,7 @@
 				}
 				list(params).then(res => {
 					if (res.code == 200) {
-						this.dataSource = [...this.dataSource,...res.rows]
+						this.dataSource = res.rows
 						this.total = res.total
 					}
 				})

+ 5 - 2
uni_modules/piaoyi-editor/components/piaoyi-editor/piaoyi-editor.vue

@@ -65,6 +65,7 @@
 <script>
 	import PickerColor from "./color-picker.vue"
 	import config from '@/config'
+	import {getToken} from '@/utils/auth'
 	export default {
 		components: {
 			PickerColor
@@ -97,6 +98,9 @@
 		},
 		data() {
 			return {
+				headers: {
+					Authorization: "Bearer " + getToken()
+				},
 				currentTab: 0,
 				curColor: '#000000',
 				show: true,
@@ -257,8 +261,6 @@
 					sourceType: ['album'],
 					sizeType: 'compressed',
 					success: (chooseImageRes) => {
-						console.log("this.api",this.api)
-						console.log("this.photoUrl",this.photoUrl)
 						const tempFilePaths = chooseImageRes.tempFiles[0].tempFilePath;
 						console.log(tempFilePaths)
 						if (!this.api || !this.photoUrl) {
@@ -277,6 +279,7 @@
 								url: this.photoUrl + this.api,
 								filePath: tempFilePaths,
 								name: this.name,
+								header: this.headers,
 								formData: {},
 								success: (uploadFileRes) => {
 									var obj = JSON.parse(uploadFileRes.data)