clay commit : bug基本修复完成
This commit is contained in:
@@ -8,14 +8,14 @@ module.exports = {
|
|||||||
/**
|
/**
|
||||||
* 单点登录url
|
* 单点登录url
|
||||||
*/
|
*/
|
||||||
casloginUrl: 'https://cas.swjtu.edu.cn/authserver/login?service=http://192.168.190.67/dev-api/cas-login',
|
// casloginUrl: 'https://cas.swjtu.edu.cn/authserver/login?service=http://192.168.190.67/dev-api/cas-login',
|
||||||
// casloginUrl: 'https://cas.swjtu.edu.cn/authserver/login?service=http://sist.swjtu.edu.cn/dev-api/cas-login',
|
casloginUrl: 'https://cas.swjtu.edu.cn/authserver/login?service=http://sist.swjtu.edu.cn/dev-api/cas-login',
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 单点登出url
|
* 单点登出url
|
||||||
*/
|
*/
|
||||||
caslogoutUrl: 'https://cas.swjtu.edu.cn/authserver/logout?service=http://192.168.190.67/admin/logout',
|
// caslogoutUrl: 'https://cas.swjtu.edu.cn/authserver/logout?service=http://192.168.190.67/admin/logout',
|
||||||
// caslogoutUrl: 'https://cas.swjtu.edu.cn/authserver/logout?service=http://sist.swjtu.edu.cn/admin/logout',
|
caslogoutUrl: 'https://cas.swjtu.edu.cn/authserver/logout?service=http://sist.swjtu.edu.cn/admin/logout',
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -109,10 +109,10 @@
|
|||||||
<el-input v-model="form.ptitle" disabled/>
|
<el-input v-model="form.ptitle" disabled/>
|
||||||
<!-- <treeselect v-model="form.pid" :options="navigationOptions" :normalizer="normalizer" placeholder="请选择父ID"/>-->
|
<!-- <treeselect v-model="form.pid" :options="navigationOptions" :normalizer="normalizer" placeholder="请选择父ID"/>-->
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="导航名称" prop="title">
|
<el-form-item label="导航名称" :prop="(form.displayType == 1 || form.displayType == 3) ? 'title':''">
|
||||||
<el-input v-model="form.title" placeholder="请输入导航名称"/>
|
<el-input v-model="form.title" placeholder="请输入导航名称"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="英语名称" prop="englishTitle">
|
<el-form-item label="英语名称" :prop="(form.displayType == 1 || form.displayType == 2) ? 'englishTitle':''">
|
||||||
<el-input v-model="form.englishTitle" placeholder="英语名称"/>
|
<el-input v-model="form.englishTitle" placeholder="英语名称"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="排序" prop="sort">
|
<el-form-item label="排序" prop="sort">
|
||||||
|
|||||||
@@ -23,6 +23,8 @@
|
|||||||
<script>
|
<script>
|
||||||
import Editor from 'wangeditor'
|
import Editor from 'wangeditor'
|
||||||
import { htmlFormat } from './fromat'
|
import { htmlFormat } from './fromat'
|
||||||
|
import { getToken } from '../../utils/auth'
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Editor',
|
name: 'Editor',
|
||||||
@@ -133,7 +135,6 @@ export default {
|
|||||||
console.log(this.code)
|
console.log(this.code)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// let packer = new Packer;
|
// let packer = new Packer;
|
||||||
// let output = packer.pack(this.value, 0, 0);
|
// let output = packer.pack(this.value, 0, 0);
|
||||||
// console.log(output, "output")
|
// console.log(output, "output")
|
||||||
@@ -146,11 +147,45 @@ export default {
|
|||||||
init() {
|
init() {
|
||||||
const _this = this
|
const _this = this
|
||||||
this.editor = new Editor(this.$refs.editor)
|
this.editor = new Editor(this.$refs.editor)
|
||||||
this.editor.config.uploadImgAccept = ['doc', 'docx', 'png', 'gif', 'bmp', 'webp']
|
this.editor.config.uploadImgAccept = ['doc', 'docx', 'png', 'img', 'gif', 'bmp', 'webp']
|
||||||
this.editor.config.uploadImgShowBase64 = true // 使用 base64 保存图片
|
// this.editor.config.uploadImgShowBase64 = true // 使用 base64 保存图片
|
||||||
|
// this.editor.config.uploadImgServer = process.env.VUE_APP_BASE_API + "/web/images"
|
||||||
|
// this.editor.config.uploadFileName = "file"
|
||||||
|
// this.editor.config.uploadImgParams= {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
|
this.editor.config.customUploadImg = function (resultFiles, insertImgFn) {
|
||||||
|
// resultFiles 是 input 中选中的文件列表
|
||||||
|
// insertImgFn 是获取图片 url 后,插入到编辑器的方法
|
||||||
|
let forms = new FormData()
|
||||||
|
let configs = {
|
||||||
|
headers:{
|
||||||
|
'Content-Type':'multipart/form-data',
|
||||||
|
Authorization: getToken()
|
||||||
|
}
|
||||||
|
};
|
||||||
|
forms.append('file',resultFiles[0])
|
||||||
|
|
||||||
|
axios.post(
|
||||||
|
process.env.VUE_APP_BASE_API + "/sist/article/images",
|
||||||
|
forms ,configs).then(res=>{
|
||||||
|
console.log(res)
|
||||||
|
let img = "<p></p><img src='"+res.data.data.href+"' alt='"+res.data.data.url+"'></p>"
|
||||||
|
_this.setHtml(_this.getHtml() + img)
|
||||||
|
})
|
||||||
|
// 上传图片,返回结果,将图片插入到编辑器中
|
||||||
|
}
|
||||||
this.editor.config.height = this.height
|
this.editor.config.height = this.height
|
||||||
this.editor.config.pasteFilterStyle = false
|
this.editor.config.pasteFilterStyle = false
|
||||||
this.editor.config.zIndex = 10
|
this.editor.config.zIndex = 10
|
||||||
|
// this.editor.config.uploadImgHooks = {
|
||||||
|
// customInsert: function (insertImg, result, editor2) {
|
||||||
|
// // uploadResult(result);
|
||||||
|
// console.log(result)
|
||||||
|
// insertImg(result.data.url);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
this.setMenus() // 设置菜单
|
this.setMenus() // 设置菜单
|
||||||
this.editor.config.onchange = (html) => {
|
this.editor.config.onchange = (html) => {
|
||||||
_this.$emit('change', html) // 将内容同步到父组件中
|
_this.$emit('change', html) // 将内容同步到父组件中
|
||||||
|
|||||||
Reference in New Issue
Block a user