<template>
	<view class="content">
		<jinEdit placeholder="请输入企业简介" @editOk="editOk" uploadFileUrl="/api/upload/image" :header="{'Authori-zation': AuthoriZation}" :showImgSize="true" :html="content"></jinEdit>
	</view>
</template>

<script>
	import jinEdit from '@/components/jin-edit/jin-edit.vue';
	export default {
		components: {
			jinEdit
		},
		data() {
			return {
				AuthoriZation: '',
				content: ''
			}
		},
		onLoad() {
			this.content = this.$api.prePage().content
			this.AuthoriZation = 'Bearer ' + uni.getStorageSync('token')
		},
		methods: {
			editOk(res) {
				let obj = this
			    console.log(res);
				//  保存富文本转出的html
				let html = res.html
				console.log(obj.$api.prePage().content,'obj.$api.prePage().data')
				obj.$api.prePage().content = html.replace(/<img/g,"<img style='max-width:100%;height:auto;'")
				uni.navigateBack({})
			}
		}
	}
</script>

<style>
</style>
