2020/12/31

This commit is contained in:
裴浩宇 2020-12-31 15:22:23 +08:00
parent caa44bd1ea
commit 734b46ab5d
26 changed files with 296 additions and 43 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -34,6 +34,9 @@ public class HSController {
@Resource
HSService hsService;
/**文件路径*/
@Value("${filePath}")
private String filesPath;
/**登录验证*/
@RequestMapping(value = "/login", method = {RequestMethod.POST, RequestMethod.GET})
@ -477,4 +480,41 @@ public class HSController {
return result;
}
/**
* 以流的形式写照片
*
* @param response
* @throws FileNotFoundException
* @throws IOException
*/
@RequestMapping("/showImg/{fileName}")
private void responPhoto(HttpServletResponse response, @PathVariable(value = "fileName") String fileName) throws IOException {
String filePath = filesPath + "\\" + fileName;
File imageFile = new File(filePath);
if (imageFile.exists()) {
FileInputStream fis = null;
OutputStream os = null;
try {
fis = new FileInputStream(imageFile);
os = response.getOutputStream();
int count = 0;
byte[] buffer = new byte[1024 * 8];
while ((count = fis.read(buffer)) != -1) {
os.write(buffer, 0, count);
os.flush();
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
fis.close();
os.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}

View File

@ -27,11 +27,11 @@ public class SaticScheduleTask {
/**
* 3.添加定时任务
*/
@Scheduled(cron = "0/5 * * * * ?")
/*@Scheduled(cron = "0/5 * * * * ?")*/
/**
* 或直接指定时间间隔例如5秒
*/
/*@Scheduled(fixedRate=5000)*/
@Scheduled(fixedRate = 120000)
private void configureTasks() {
Map<String, Object> map = new HashMap<>();

View File

@ -12,12 +12,13 @@ logging:
##数据源
spring:
datasource:
url: jdbc:mysql://127.0.0.1:3306/hslink?serverTimezone=Hongkong&useUnicode=true&characterEncoding=utf8
# url: jdbc:mysql://127.0.0.1:3306/hslink?serverTimezone=Hongkong&useUnicode=true&characterEncoding=utf8
url: jdbc:mysql://106.53.113.158:3306/hslink?serverTimezone=Hongkong&useUnicode=true&characterEncoding=utf8
username: root
password: 123456
password: Beater123
db-name: hslink
filters: log4j,wall,mergeStat
driverClassName: com.mysql.cj.jdbc.Driver
##文件保存路径
filePath: D:\office\phy\HSLink\HSLink-front\src\assets\file
filePath: ${user.dir}\src\main\static\files

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 KiB

View File

@ -6,7 +6,11 @@
<script>
export default {
name: 'App'
name: 'App',
mounted() {
const url = `http://192.168.10.207:8048`;
sessionStorage.setItem('url', url);
}
}
</script>

View File

@ -1,9 +1,6 @@
// 配置API接口地址
import de from "element-ui/src/locale/lang/de";
// let root = 'http://192.168.10.29:8048'
let root = 'http://106.53.113.158:8048'
// let root = 'http://127.0.0.1:8048'
// 引用axios
let axios = require('axios')
// 自定义判断元素类型JS
@ -46,7 +43,7 @@ function apiAxios (method, url, params, success, failure) {
url: url,
data: method === 'POST' || method === 'PUT' ? params : null,
params: method === 'GET' || method === 'DELETE' ? params : null,
baseURL: root,
baseURL: sessionStorage.getItem('url'),
withCredentials: false
})
.then(function (res) {

View File

@ -39,7 +39,7 @@
<div class="comment-area">
<el-button class="message" type="primary" @click="messages">留言</el-button>
<div class="comment-list">
<div class="comment-one" v-for="(item,index) in message">
<div class="comment-one" v-for="(item, index) in message" :key='index'>
<div class="comment-header">
<div class="header-photo">{{item.header_photo}}</div>
<div class="name">{{item.real_name}}</div>
@ -461,8 +461,10 @@
padding: 0;
}
.el-aside{
/*margin-top: 1rem;*/
width: 14rem!important;
position: fixed;
top: 15rem;
right: 10%;
}
.el-main{
padding: 0;

View File

@ -12,21 +12,21 @@
</div>
<el-carousel indicator-position="outside">
<el-carousel-item v-for="(item,index) in rotationPhotoList" :key="index">
<img :src="item.fileName" height="100%" width="100%"/>
<img class="rotation-photo" :src='imgPath(item)'/>
</el-carousel-item>
</el-carousel>
</div>
</div>
<div id="bottom">
<div class="left">
<el-tabs v-model="activeName" @tab-click="" v-loading="tabLoading">
<el-tabs v-model="activeName" v-loading="tabLoading">
<el-tab-pane label="校园通知" name="first">
<div class="newest-notice module">
<div class="title">
<i class="el-icon-chat-dot-square"></i>
</div>
<div class="content">
<div class="one theme-font-blue" v-for="item in newestNotice" :data-id="item.id" >
<div class="one theme-font-blue" v-for="(item, index) in newestNotice" :data-id="item.id" :key='index'>
<div class="type" @click="searchLabel(item.label)">
[{{item.label}}]
</div>
@ -43,7 +43,7 @@
<i class="el-icon-chat-line-square"></i>
</div>
<div class="content">
<div class="one theme-font-blue" v-for="item in goodAdvice" :data-id="item.id">
<div class="one theme-font-blue" v-for="(item, index) in goodAdvice" :data-id="item.id" :key='index'>
<div class="type" @click="searchLabel(item.label)">[{{item.label}}]</div>
<div class="text" @click="getContent(item.id)">{{item.title}}</div>
<div class="release" @click="goPersonalInfo(item.user_id)">{{item.real_name}}</div>
@ -58,7 +58,7 @@
<i class="el-icon-chat-square"></i>
</div>
<div class="content">
<div class="one theme-font-blue" v-for="item in magicalThinking" :data-id="item.id">
<div class="one theme-font-blue" v-for="(item, index) in magicalThinking" :data-id="item.id" :key='index'>
<div class="type" @click="searchLabel(item.label)">[{{item.label}}]</div>
<div class="text" @click="getContent(item.id)">{{item.title}}</div>
<div class="release" @click="goPersonalInfo(item.user_id)">{{item.real_name}}</div>
@ -75,7 +75,7 @@
<i class="el-icon-trophy"></i>
</div>
<div class="one" v-for="item in prominentTeacher">
<div class="one" v-for="(item, index) in prominentTeacher" :key='index'>
<div class="name theme-font-blue">{{item.name}}老师</div>
<!-- <div class="subject theme-font-blue">数学</div>-->
<!-- <div class="grade theme-font-blue">2016</div>-->
@ -87,7 +87,7 @@
<i class="el-icon-trophy-1"></i>
</div>
<div class="one" v-for="item in meritStudent">
<div class="one" v-for="(item, index) in meritStudent" :key='index'>
<div class="name theme-font-blue">{{item.name}}同学</div>
<!-- <div class="grade theme-font-blue">2016</div>-->
<div class="subject theme-font-blue">{{item.class}}</div>
@ -173,6 +173,12 @@
this.getNoticeList();
},
methods: {
/**
* 图片地址
*/
imgPath(item) {
return `${sessionStorage.getItem('url')}/hs/showImg/${item.fileEncryption}`
},
//
getNoticeList() {
this.tabLoading = true;
@ -187,16 +193,7 @@
getRotationPhotoList() {
this.$ajax.post('/hs/getRotationPhotoList',{},res=>{
console.log("轮播图列表",res);
this.rotationPhotoList = [];
for (let i = 0; i < res.rotationPhotoList.length; i++) {
this.rotationPhotoList.push(
{
id: res.rotationPhotoList[i].id,
fileId: res.rotationPhotoList[i].fileId,
fileName: require('../assets/img/carousel/'+res.rotationPhotoList[i].fileName)},
);
}
console.log("rotationPhotoList",this.rotationPhotoList)
this.rotationPhotoList = res.rotationPhotoList;
})
},
searchLabel(label) {
@ -219,7 +216,12 @@
}
</script>
<style scoped>
<style scoped>
.rotation-photo{
object-fit: contain;
width: 100%;
height: 100%;
}
.el-main{
padding: 0.5rem 1rem;
}

View File

@ -177,6 +177,8 @@
margin-top: 1rem;
text-align: center;
height: 21rem;
position: sticky;
top: 1rem;
}
.el-radio-group{
margin-bottom: 0!important;

View File

@ -20,7 +20,7 @@
:visible.sync="dialogVisible"
width="40%">
<div class="list">
<div class="one" v-for="item in list" >
<div class="one" v-for="(item, index) in list" :key='index'>
<div class="type">[{{item.label}}]</div>
<div class="text" @click="getContent(item.id)">{{item.title}}</div>
<div class="release" @click="goPersonalInfo(item.user_id)">{{item.real_name}}</div>

View File

@ -34,6 +34,11 @@ export default new Router({
path: '/homepagemanagement',
name: 'homepagemanagement',
component:() => import('@/view/admin/homepageManagement/HomepageManagement')
},
{
path: '/helpreply',
name: 'helpreply',
component:() => import('@/view/admin/helpReply/HelpReply')
}
]
},

View File

@ -29,8 +29,7 @@
<el-menu-item index="1" @click="goToHomepageManagement">首页管理</el-menu-item>
<el-menu-item index="2" @click="goToArticleReview">文章审核</el-menu-item>
<el-menu-item index="3" @click="goToPersonnelManagement">人员管理</el-menu-item>
<el-menu-item index="4" @click="goToHomepageManagement">注册管理</el-menu-item>
<el-menu-item index="5" @click="goToHomepageManagement">帮助答复</el-menu-item>
<el-menu-item index="5" @click="goToHelpReply">帮助答复</el-menu-item>
<el-menu-item index="6" disabled>更多···</el-menu-item>
</el-menu>
</el-aside>
@ -83,6 +82,10 @@
goToHomepageManagement() {
this.$router.push({name: "homepagemanagement"})
},
//
goToHelpReply() {
this.$router.push({name: "helpreply"})
},
timingTask(userId) {
this.$ajax.post("/hs/timingTask",{userId:userId},r=>{
console.log(r)

View File

@ -0,0 +1,25 @@
<template>
<div class="page">
<h1>完善中···</h1>
</div>
</template>
<script>
export default {
data() {
return{
}
},
methods: {
/**
* 获取帮助答复列表
*/
}
}
</script>
<style scoped>
</style>

View File

@ -1,12 +1,39 @@
<template>
<div class="page">
<h1>完善中···</h1>
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="轮播图管理" name="1">
<rotation-photo-management></rotation-photo-management>
</el-tab-pane>
<el-tab-pane label="版块管理" name="2">
<registration></registration>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import rotationPhotoManagement from '@/view/admin/homepageManagement/homepageManagement/RotationPhotoManagement';
export default {
name: "HomepageManagement"
components: {
rotationPhotoManagement
},
name: "HomepageManagement",
data() {
return{
activeName: '1'
}
},
mounted() {
},
methods: {
/**
* 切换tab
*/
handleClick(tab, event) {
console.log(tab, event);
},
}
}
</script>

View File

@ -0,0 +1,97 @@
<template>
<div>
<div class="title">轮播图管理</div>
<div class="img-list">
<div class="img" v-for="(img, index) in rotationPhotoList" :key='index'>
<el-image class="rotation-photo"
:src='imgPath(img)'
:preview-src-list="srcList"
fit='scale-down'></el-image>
<i class="el-icon-circle-close delete-icon pointer" @click="deleteImg(img)"></i>
</div>
<div class="add-img pointer">
<i class="el-icon-plus"></i>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return{
//
rotationPhotoList: [],
//URL
srcList: []
}
},
mounted() {
this.getRotationPhotoList();
},
methods: {
/**
* 删除图片
*/
deleteImg(img) {
},
/**
* 图片地址
*/
imgPath(item) {
return `${sessionStorage.getItem('url')}/hs/showImg/${item.fileEncryption}`
},
//
getRotationPhotoList() {
this.$ajax.post('/hs/getRotationPhotoList',{},res=>{
console.log("轮播图列表",res);
if (res.rotationPhotoList.length > 0) {
this.rotationPhotoList = res.rotationPhotoList;
res.rotationPhotoList.forEach(img => {
this.srcList.push(`${sessionStorage.getItem('url')}/hs/showImg/${img.fileEncryption}`)
});
}
})
},
}
}
</script>
<style scoped>
.delete-icon{
position: absolute;
margin-left: -1rem;
margin-top: -0.4rem;
color: #ff0000;
font-size: 1.5rem;
}
.img-list{
display: flex;
flex-wrap: wrap;
}
.add-img{
width: 10rem;
height: 10rem;
display: flex;
justify-content: center;
align-items: center;
}
.add-img i{
font-size: 5rem;
color: #999999;
}
.img, .add-img{
border: 1px solid #999999;
margin: 0.5rem;
padding: 0.5rem;
border-radius: 0.5rem
}
.title{
font-size: 1.2rem;
}
.rotation-photo{
width: 10rem;
height: 10rem;
}
</style>

View File

@ -12,12 +12,10 @@
</template>
<script>
import noDate from '@/components/components/NoData'
import person from '@/view/admin/personnelManagement/personnelManagement/PersonnelManagement'
import registration from '@/view/admin/personnelManagement/registrationManagement/RegistrationManagement'
export default {
components: {
noDate,
person,
registration
},

View File

@ -16,13 +16,13 @@
<div class="table-content">
<div class="one-data" v-for="(person, index) in personList" :key="index">
<div class="index box">{{index+1}}</div>
<div class="article-name box theme-font-blue special-text">{{person.real_name}}</div>
<div class="article-name box theme-font-blue special-text" @click="goPersonalInfo(person.user_id)">{{person.real_name}}</div>
<div class="article-type box">{{person.user_type}}</div>
<div class="time box theme-font-blue special-text">{{person.create_time}}</div>
<div class="article-type box" :class="person.frozen_state === '0' ? 'theme-font-green' : 'theme-font-red'">{{person.frozen_state === '0' ? '未冻结' : '已冻结'}}</div>
<div class="function box">
<el-button type="danger" size='mini' @click="" v-if="person.frozen_state === '0'">冻结</el-button>
<el-button type="success" size='mini' @click="" v-if="person.frozen_state === '1'">解冻</el-button>
<el-button type="danger" size='mini' @click="peopleManagement(person, '1')" v-if="person.frozen_state === '0'">冻结</el-button>
<el-button type="success" size='mini' @click="peopleManagement(person, '0')" v-if="person.frozen_state === '1'">解冻</el-button>
</div>
</div>
<div class="number">{{personList.length}}条数据</div>
@ -51,6 +51,50 @@
this.getFollowPeopleList()
},
methods: {
/**
* 冻结/解冻
* @param {Object} item
* @param {Object} operation 冻结/解冻
*/
peopleManagement(item, operating) {
const OPERATING = {
"0": "解冻",
"1": "冻结",
};
let _this = this;
_this.$confirm(`确认${OPERATING[operating]+item.real_name}?`, `${OPERATING[operating]}`, {
confirmButtonText: '确定',
cancelButtonText: '取消',
}).then(() => {
this.$ajax.post('/admin/peopleManagement', {
userId: item.user_id,
operating: operating
}, res => {
console.log("人员操作结果", res);
if (res > 0) {
this.$message({
type: 'success',
message: `${OPERATING[operating]+item.real_name}成功`
});
setTimeout(() => {
_this.getFollowPeopleList();
}, 1000)
} else {
this.$message({
type: 'error',
message: '服务器出小差了,请稍后再试'
});
}
})
})
},
/**
* 查看个人主页
*/
goPersonalInfo(userId) {
this.$router.push({name: 'personalinfo'});
sessionStorage.setItem("userId",userId);
},
/**
* 获取人员列表
*/

View File

@ -2,7 +2,7 @@
<div id="upload">
<el-upload
class="upload-demo"
action="http://127.0.0.1:8048/hs/upload"
:action="url"
:on-preview="handlePreview"
:on-remove="handleRemove"
:file-list="fileList"
@ -11,17 +11,23 @@
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>
</el-upload>
<div class="img">
<img v-for="(item,index) in fileList" :src="item.path" height="100" width="100"/>
<img v-for="(item,index) in fileList" :src="item.path" height="100" width="100" :key='index'/>
</div>
<el-button @click="fileUpload">
下载
</el-button>
<img :src="imgUrl" alt="">
</div>
</template>
<script>
export default {
data() {
return {
//
imgUrl: `${sessionStorage.getItem('url')}/hs/showImg/3fdc4d49-8bd4-4dc7-a8c1-50d2fa8e89f5carousel4.jpg`,
//
url: `${sessionStorage.getItem('url')}/hs/upload`,
//
fileList: []
};
},
@ -34,7 +40,7 @@
this.$axios(
{
method: 'post',
url: 'http://127.0.0.1:8048/hs/fileDownload',
url: `${sessionStorage.getItem('url')}/hs/fileDownload`,
params: {
fileId: '111'
},