Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 88 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,38 +51,104 @@

<p>体验地址:<a href="http://81.69.247.172/#/">http://81.69.247.172/#/</a></p>

> 管理员账号:admin123 管理员密码: admin123

### 开源地址

前端项目
<a href="https://github.com/Jarrettluo/all-documents-vue.git">
https://github.com/Jarrettluo/all-documents-vue.git
<a href="https://github.com/Jarrettluo/all-docs-vue">
https://github.com/Jarrettluo/all-docs-vue.git
</a>


后端项目
<a href="https://github.com/Jarrettluo/document-sharing-site.git">
https://github.com/Jarrettluo/document-sharing-site.git
<a href="https://github.com/Jarrettluo/all-docs">
https://github.com/Jarrettluo/all-docs
</a>

选择mongoDB作为主要的数据库,存储文档和文件。

后端技术:SpringBoot + MongoDB + ES
后端技术:`SpringBoot` + `MongoDB` + `ES` + `Redis`

前端技术:Vue + axios
前端技术:`Vue` + `axios` + `iView` + `...`

- docx预览方案:docx
- pdf 预览方案: `pdfjs-dist`

- ppt预览方案:暂无
- docx预览方案(对doc支持非常差):`docx-preview`

- excel预览方案:xx
- ppt预览方案(后端生成pdf后预览):`pdfjs-dist`

<!-- ROADMAP -->
- excel预览方案:`vue-office/excel`

## 路线图
## 快速体验
> 在ubuntu 18.04 环境下测试通过
```shell
# 克隆项目
git clone https://github.com/Jarrettluo/all-docs.git

# 切换为管理员
su root

# 切换到工作目录
cd all-docs && cd docker

# 修改文件权限
chmod +x auto.sh

# 启动脚本
sudo ./auto.sh
```
注意:因为快速体验是采用默认参数进行安装,使用的版本也可能比较旧,因此建议不要在生产环境中使用。

## 开发者浏览
all-docs项目是一个前后端分离项目。
如果只是想启动前端项目可以采用如下步骤:
```shell
# 拉取项目
git clone https://github.com/Jarrettluo/all-docs-vue

# 切换分支(如果有必要的话,默认是master分支)
git checkout develop

# 找到 路径为:./src/api/request.js 并 修改request.js
# 其中baseURL就是默认的用户地址
baseURL: 'http://81.69.247.172:8082/api/v1.0',

# 安装依赖
npm install

# 其中服务
npm serve
```

查看 [open issues](https://github.com/othneildrew/Best-README-Template/issues) 。
成功以后控制台可以看到如下内容:
```shell
App running at:
- Local: http://localhost:8080
- Network: http://ip:8080
```


作者开发环境如下,供参考:
```shell
$ node -v
v14.16.1

$ npm -v
6.14.12
```

### 项目部署

- [全文档在Windows环境下部署](https://github.com/Jarrettluo/document-sharing-site/blob/main/deploy/depoly_win_zh.md)
- [全文档在Linux环境下部署--待补充](https://github.com/Jarrettluo/document-sharing-site/blob/main/deploy/deploy_linux_zh.md)
- [全文档使用Docker部署--待补充](https://github.com/Jarrettluo/document-sharing-site/blob/main/deploy/deploy_docker_zh.md)
- [全文档使用Docker-Compose部署](https://github.com/Jarrettluo/document-sharing-site/blob/main/deploy/deploy_docker_compose_zh.md)


<!-- ROADMAP -->

## 路线图
暂无

<!-- CONTRIBUTING -->

Expand All @@ -108,16 +174,15 @@ https://github.com/Jarrettluo/document-sharing-site.git

## 联系我

欢迎加入微信交流群,一起玩😄
欢迎加入微信交流群,一起玩😄,如果微信群二维码失效,可以加我微信拉你进群。

<img src="https://github.com/Jarrettluo/document-sharing-site/blob/main/images/WechatIMG112.jpeg" alt="imGroup" width="200">
<img src="https://github.com/Jarrettluo/all-docs-vue/blob/main/images/WechatIMG349.jpg" alt="imGroup" width="200">

> 如果有二次开发或者私有部署需求,请联系我

(添加微信请备注"全文档")


<img src="https://github.com/Jarrettluo/document-sharing-site/blob/main/images/Wechat.jpeg" alt="imGroup" width="200">
<img src="https://github.com/Jarrettluo/all-docs-vue/blob/main/images/WechatIMG350.jpg" alt="imGroup" width="200">


Jarrett Luo - luojiarui2@163.com
Expand All @@ -127,7 +192,12 @@ Jarrett Luo - luojiarui2@163.com

## 致谢

- 暂无
感谢天南地北的朋友支持,让项目不断维护更新!

如果您觉得项目带给您一些启发或者帮助,欢迎大赏支持!

<img src="https://github.com/Jarrettluo/all-docs-vue/blob/main/images/WechatIMG351.jpg" alt="imGroup" width="200">


<!-- MARKDOWN LINKS & IMAGES -->
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
Expand Down
Binary file added images/WechatIMG349.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/WechatIMG350.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/WechatIMG351.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 33 additions & 5 deletions src/components/AvatarUploader/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ export default {
client_alioss: {},
};
},

props: {
img_url: {type: String, requires: true}
},
created() {
},
mounted() {
Expand All @@ -158,10 +160,9 @@ export default {
//打开编辑头像窗口
openEditAvatarDialog() {
this.isVisible_editAvatarDialog = true;
if (this.previews.url) {
this.previews.url = "";
this.options.img = "";
}
this.urlToBase64(this.img_url).then(res => {
this.options.img = res;
})
},
// 实时预览函数
realTime(data) {
Expand Down Expand Up @@ -232,6 +233,33 @@ export default {
}
return new File([u8arr], filename, {type: mime});
},

/**
* url转base64
* @param {String} url - url地址
*/
urlToBase64(url) {
return new Promise ((resolve,reject) => {
let image = new Image();
image.onload = function() {
let canvas = document.createElement('canvas');
canvas.width = this.naturalWidth;
canvas.height = this.naturalHeight;
// 将图片插入画布并开始绘制
canvas.getContext('2d').drawImage(image, 0, 0);
// result
let result = canvas.toDataURL('image/png')
resolve(result);
};
// CORS 策略,会存在跨域问题https://stackoverflow.com/questions/20424279/canvas-todataurl-securityerror
image.setAttribute("crossOrigin",'Anonymous');
image.src = url;
// 图片加载失败的错误处理
image.onerror = () => {
reject(new Error('转换失败'));
};
});
}
},
watch: {},
};
Expand Down
25 changes: 21 additions & 4 deletions src/home/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@
<img :src="imgSrc" width="100%" height="100%" alt=""/>
<SearchGroup></SearchGroup>
<div class="user-zone" v-if="!ad && !tokenExpired">
<span>{{ type | userType }}</span>
<Dropdown>
<a class="user-tag" href="javascript:void(0)" style="text-align: center; width: 36px;" @mouseenter="checkLogin">
<img :src="0 | userAvatar" alt="">
</a>
<template #list>
<DropdownMenu>
<DropdownItem @click.native="gotoAdminPage">系统管理</DropdownItem>
<DropdownItem @click.native="$router.push('/userPage')">个人主页</DropdownItem>
<DropdownItem><span style="color: #8d7b25;">{{ username | userNameTooLong }}</span></DropdownItem>
<DropdownItem @click.native="$router.push('/userPage/userInfo')" divided>个人主页</DropdownItem>
<DropdownItem @click.native="gotoAdminPage" v-show="type === 'ADMIN'">系统管理</DropdownItem>
<DropdownItem @click.native="logout()" divided>退出登录</DropdownItem>
</DropdownMenu>
</template>
Expand Down Expand Up @@ -116,7 +118,10 @@ export default {
tokenExpired: false,
img1: require('@/assets/source/heart.png'),
img2: require('@/assets/source/folder.png'),
img3: require('@/assets/source/upload.png')
img3: require('@/assets/source/upload.png'),

username: localStorage.getItem('username'),
type: localStorage.getItem("type")
}
},
computed: {
Expand All @@ -136,6 +141,18 @@ export default {
} else {
return BackendUrl() + "/files/image2/" + value;
}
},
userType(type) {
if (type === "ADMIN") {
return "管理员"
}
return ""
},
userNameTooLong(name) {
if (name.length > 10) {
return name.slice(0, 4) + "..." + name.slice(-4)
}
return name;
}
},
methods: {
Expand Down Expand Up @@ -240,14 +257,14 @@ export default {
display: flex;
justify-content: flex-start;
padding: 5px 5px 0 5px;
color: #2c3e50;

span {
height: 36px;
line-height: 36px;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC, serif;
font-weight: 400;
color: #000000;
padding-right: 10px;
}

Expand Down
2 changes: 1 addition & 1 deletion src/home/SearchGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ export default {
top: 0px;
line-height: 28px;
font-size: 12px;
color: blue;
color: #0067eb;
padding: 0px 8px;
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ Vue.component('tags-input', VoerroTagsInput);
Vue.use(VueRouter);
Vue.use(iView);

import jm from 'vue-jsmind'

Vue.use(jm)
if (window.jsMind) {
Vue.prototype.jsMind = window.jsMind
}
// import jm from 'vue-jsmind'
//
// Vue.use(jm)
// if (window.jsMind) {
// Vue.prototype.jsMind = window.jsMind
// }

Vue.prototype.$axios = Api;

Expand Down
5 changes: 0 additions & 5 deletions src/views/About.vue

This file was deleted.

19 changes: 0 additions & 19 deletions src/views/Home.vue

This file was deleted.

Loading