修改README
This commit is contained in:
parent
51e4c85019
commit
c7969607b8
10
README.md
10
README.md
@ -35,6 +35,16 @@ npm install
|
|||||||
# develop
|
# develop
|
||||||
npm run dev
|
npm run dev
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 4. Build
|
||||||
|
```bush
|
||||||
|
# build for test environment
|
||||||
|
npm run build:stage
|
||||||
|
|
||||||
|
# build for production environment
|
||||||
|
npm run build:prod
|
||||||
|
```
|
||||||
|
|
||||||
This will automatically open http://localhost:9528
|
This will automatically open http://localhost:9528
|
||||||
|
|
||||||
## Browsers support
|
## Browsers support
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import getPageTitle from '@/utils/get-page-title'
|
|||||||
|
|
||||||
NProgress.configure({ showSpinner: false }) // NProgress Configuration
|
NProgress.configure({ showSpinner: false }) // NProgress Configuration
|
||||||
|
|
||||||
const whiteList = ['/login','/public/articles','/public/article','/share'] // no redirect whitelist
|
const whiteList = ['/login','/public/articles','/public/articles/article','/share'] // no redirect whitelist
|
||||||
|
|
||||||
router.beforeEach(async(to, from, next) => {
|
router.beforeEach(async(to, from, next) => {
|
||||||
// start progress bar
|
// start progress bar
|
||||||
|
|||||||
@ -1,63 +1,17 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-html="htms"></div>
|
<div v-html="html"></div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import showdown from "showdown"
|
|
||||||
let converter = new showdown.Converter();
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
htms: ""
|
html: ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.setMakedown()
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
setMakedown() {
|
|
||||||
this.htms = converter.makeHtml('# 标题\n' +
|
|
||||||
'```java\n' +
|
|
||||||
'/***\n' +
|
|
||||||
' * 重命名\n' +
|
|
||||||
' * @param username\n' +
|
|
||||||
' * @param id\n' +
|
|
||||||
' * @return\n' +
|
|
||||||
' */\n' +
|
|
||||||
' @Override\n' +
|
|
||||||
' public ResponseResult<Object> rename(String newFileName, String username, String id) {\n' +
|
|
||||||
' FileDocument fileDocument = mongoTemplate.findById(id, FileDocument.class, COLLECTION_NAME);\n' +
|
|
||||||
' if (fileDocument != null) {\n' +
|
|
||||||
' String currentDirectory = getUserDirectory(fileDocument.getPath());\n' +
|
|
||||||
' String filePath = rootPath + File.separator + username + currentDirectory;\n' +
|
|
||||||
' File file = new File(filePath + fileDocument.getName());\n' +
|
|
||||||
' if(fileDocument.getIsFolder()){\n' +
|
|
||||||
' Query query = new Query();\n' +
|
|
||||||
' String searchPath = currentDirectory + fileDocument.getName();\n' +
|
|
||||||
' String newPath = currentDirectory + newFileName;\n' +
|
|
||||||
' query.addCriteria(Criteria.where("path").regex("^"+searchPath));\n' +
|
|
||||||
' List<FileDocument> documentList = mongoTemplate.find(query, FileDocument.class, COLLECTION_NAME);\n' +
|
|
||||||
' // 修改该文件夹下的所有文件的path\n' +
|
|
||||||
' documentList.parallelStream().forEach(rep -> {\n' +
|
|
||||||
' String path = rep.getPath();\n' +
|
|
||||||
' String newFilePath = replaceStart(path, searchPath, newPath);\n' +
|
|
||||||
' Update update = new Update();\n' +
|
|
||||||
' update.set("path",newFilePath);\n' +
|
|
||||||
' Query query1 = new Query();\n' +
|
|
||||||
' query1.addCriteria(Criteria.where("_id").is(rep.getId()));\n' +
|
|
||||||
' mongoTemplate.upsert(query1, update, COLLECTION_NAME);\n' +
|
|
||||||
' });\n' +
|
|
||||||
' }\n' +
|
|
||||||
' if (renameFile(newFileName, id, filePath, file)) {\n' +
|
|
||||||
' return ResultUtil.error("重命名失败");\n' +
|
|
||||||
' }\n' +
|
|
||||||
' return ResultUtil.success(true);\n' +
|
|
||||||
' } else {\n' +
|
|
||||||
' return ResultUtil.error("数据库查询失败");\n' +
|
|
||||||
' }\n' +
|
|
||||||
' }\n' +
|
|
||||||
'```\n')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1420,14 +1420,14 @@ export default {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(row.contentType.includes('text')){
|
if(row.contentType.includes('text')){
|
||||||
// let routeData = this.$router.resolve({path: '/public/p',query: {mark: row.id}})
|
// let routeData = this.$router.resolve({path: '/public/articles/article',query: {mark: row.id}})
|
||||||
// window.open(routeData.href, '_blank');
|
// window.open(routeData.href, '_blank');
|
||||||
this.$router.push(`/public/articles/article?mark=${row.id}`)
|
this.$router.push(`/public/articles/article?mark=${row.id}`)
|
||||||
}else{
|
}else{
|
||||||
// 打开文件
|
// 打开文件
|
||||||
const fileIds = [row.id]
|
const fileIds = [row.id]
|
||||||
const url = process.env.VUE_APP_BASE_FILE_API + 'preview/' + row.name + '?jmal-token=' + this.$store.state.user.token + '&fileIds=' + fileIds
|
const url = process.env.VUE_APP_BASE_FILE_API + 'preview/' + row.name + '?jmal-token=' + this.$store.state.user.token + '&fileIds=' + fileIds
|
||||||
window.open(url, '_self')
|
window.open(url, '_blank')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
<div v-show="titleList.length > 0" class="right-bj">
|
<div v-show="titleList.length > 0" class="right-bj">
|
||||||
<div class="slimScrollDiv">
|
<div class="slimScrollDiv">
|
||||||
<div class="right-menu">
|
<div class="right-menu" style="max-height: 700px">
|
||||||
<div class="toc-content">
|
<div class="toc-content">
|
||||||
<header class="toc-header"><svg-icon icon-class="contents"></svg-icon><span>目录</span></header>
|
<header class="toc-header"><svg-icon icon-class="contents"></svg-icon><span>目录</span></header>
|
||||||
</div>
|
</div>
|
||||||
@ -51,7 +51,8 @@
|
|||||||
toolbarsFlag: true,
|
toolbarsFlag: true,
|
||||||
content:'',
|
content:'',
|
||||||
html:'',
|
html:'',
|
||||||
titleList: []
|
titleList: [],
|
||||||
|
tocMaxHeight: 500
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|||||||
@ -3,7 +3,6 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import showdown from "showdown"
|
|
||||||
converter.setOption('tables', true); // 将表格显示出来
|
converter.setOption('tables', true); // 将表格显示出来
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user