1、前端主页修改,清空每日一句,移到翻译管理模块
This commit is contained in:
parent
b898b9feb1
commit
9517158900
|
|
@ -25,3 +25,13 @@ export function delAword(id) {
|
|||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询英语单词列表
|
||||
export function getApiAWord(query) {
|
||||
return request({
|
||||
url: '/openapi/aword/',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,11 +3,3 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
|
||||
// 查询英语单词列表
|
||||
export function getApiAWord(query) {
|
||||
return request({
|
||||
url: '/openapi/aword/',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,8 +13,9 @@
|
|||
<el-popover
|
||||
placement="top"
|
||||
width="400"
|
||||
title="❉预报天气❉"
|
||||
v-model="weatherVisible">
|
||||
<table style="text-align: center">
|
||||
<table style="text-align: center" v-loading="loading">
|
||||
<td v-for="(cast,index) in forecastWeatherData.casts" width="100px">
|
||||
<tr>{{cast.dayweather}}</tr>
|
||||
<tr>
|
||||
|
|
@ -149,6 +150,9 @@ export default {
|
|||
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
|
||||
//预警数据
|
||||
warnData: {},
|
||||
|
||||
|
|
@ -205,9 +209,10 @@ export default {
|
|||
methods: {
|
||||
//获取预报天气
|
||||
getForecastWeather() {
|
||||
console.log("点击了")
|
||||
this.loading = true;
|
||||
getForecastWeather().then(res => {
|
||||
this.forecastWeatherData = res.data
|
||||
this.loading = false;
|
||||
})
|
||||
|
||||
},
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<!-- 翻译区域-->
|
||||
|
|
@ -65,6 +66,39 @@
|
|||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="0">
|
||||
<el-col :span="24" v-loading="loading3"></el-col>
|
||||
<div class="aword">
|
||||
<div class="div1">
|
||||
<el-image
|
||||
style="width: 120px; height: 148px"
|
||||
:src=apiAWord.imgurl
|
||||
:preview-src-list=[apiAWord.imgurl]
|
||||
>
|
||||
</el-image>
|
||||
</div>
|
||||
|
||||
<div class="div2 div23">
|
||||
<audio :src=apiAWord.tts controls="controls">
|
||||
您的浏览器不支持 audio 标签。
|
||||
</audio>
|
||||
</div>
|
||||
|
||||
<div class="div3 div23 div34" style="margin-left: 0px">
|
||||
<p>
|
||||
{{apiAWord.content}}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="div4 div34">
|
||||
<p>
|
||||
{{apiAWord.note}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</el-row>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -72,7 +106,11 @@
|
|||
<script>
|
||||
import {translation, getCopyWriting} from "@/api/business/openapi/translation";
|
||||
|
||||
import {getApiAWord} from "@/api/business/openapi/aword";
|
||||
import Aword from "@/views/business/openapi/aword";
|
||||
|
||||
export default {
|
||||
components: {Aword},
|
||||
dicts: ['translation_type'],
|
||||
name: "Log",
|
||||
data() {
|
||||
|
|
@ -80,6 +118,15 @@ export default {
|
|||
// 遮罩层
|
||||
loading1: true,
|
||||
loading2: false,
|
||||
loading3: false,
|
||||
|
||||
//响应数据
|
||||
apiAWord: {},
|
||||
|
||||
//apiAWord请求参数
|
||||
apiAWordParams: {
|
||||
rand: 1
|
||||
},
|
||||
|
||||
//翻译响应数据
|
||||
responseTranslation: '',
|
||||
|
|
@ -119,8 +166,16 @@ export default {
|
|||
},
|
||||
created() {
|
||||
this.getCopyWriting()
|
||||
this.getApiAWord()
|
||||
},
|
||||
methods: {
|
||||
//随机获取一条每日一句
|
||||
getApiAWord() {
|
||||
getApiAWord(this.apiAWordParams).then(res => {
|
||||
this.apiAWord = res.data
|
||||
})
|
||||
},
|
||||
|
||||
//获取文案
|
||||
getCopyWriting() {
|
||||
this.loading1 = true;
|
||||
|
|
@ -155,6 +210,44 @@ export default {
|
|||
</script>
|
||||
|
||||
<style scoped>
|
||||
.aword div {
|
||||
float: left;
|
||||
width: 24%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.aword .div1 {
|
||||
padding-left: 110px;
|
||||
}
|
||||
.aword .div2 {
|
||||
padding: 50px 0px;
|
||||
}
|
||||
|
||||
.aword .div23{
|
||||
margin: 0 18px;
|
||||
}
|
||||
|
||||
.aword .div34{
|
||||
text-align: center;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.aword {
|
||||
box-shadow: 0 0 9px 3px #999;
|
||||
font-style: italic;
|
||||
height: 200px;
|
||||
font-family: Georgia;
|
||||
border-radius: 4px;
|
||||
margin-top: 20px;
|
||||
|
||||
padding: 25px;
|
||||
min-height: 36px;
|
||||
|
||||
}
|
||||
|
||||
.bg-purple {
|
||||
box-shadow: 0 0 9px 3px #999;
|
||||
}
|
||||
|
|
@ -162,15 +255,15 @@ export default {
|
|||
.grid-content {
|
||||
border-radius: 4px;
|
||||
min-height: 36px;
|
||||
height: 500px;
|
||||
margin-top: 20px;
|
||||
padding: 50px;
|
||||
height: 360px;
|
||||
margin-top: 15px;
|
||||
padding: 25px;
|
||||
}
|
||||
|
||||
.spans {
|
||||
margin: 50px;
|
||||
margin-top: 40px;
|
||||
padding: 50px;
|
||||
margin: 25px;
|
||||
margin-top: 5px;
|
||||
padding: 30px;
|
||||
font-family: Georgia;
|
||||
font-size: 20px;
|
||||
height: 300px;
|
||||
|
|
@ -183,9 +276,10 @@ export default {
|
|||
width: 75%;
|
||||
text-shadow: 2px 2px 2px grey;
|
||||
}
|
||||
|
||||
.source_div {
|
||||
float: left;
|
||||
padding-top: 70px;
|
||||
padding-top: 100px;
|
||||
width: 25%;
|
||||
text-shadow: 2px 2px 2px grey;
|
||||
text-align: right
|
||||
|
|
|
|||
|
|
@ -1,75 +1,27 @@
|
|||
<template>
|
||||
<div>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<div class="grid-content bg-purple">
|
||||
<!--每日一句-->
|
||||
<div class="box-card">
|
||||
<div class="aWordImage">
|
||||
<el-image
|
||||
class="aWordImage"
|
||||
:src=apiAWord.imgurl
|
||||
:preview-src-list=[apiAWord.imgurl]>
|
||||
</el-image>
|
||||
</div>
|
||||
<div class="aWordAudio">
|
||||
<audio :src=apiAWord.tts controls="controls">
|
||||
您的浏览器不支持 audio 标签。
|
||||
</audio>
|
||||
</div>
|
||||
<div class="aWordContent">
|
||||
<span>{{ apiAWord.content }}</span>
|
||||
</div>
|
||||
<div class="aWordNote">
|
||||
<span>{{ apiAWord.note }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
|
||||
<!--todo 天气预报 -->
|
||||
<el-col :span="12">
|
||||
<div class="grid-content bg-purple">
|
||||
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import {getApiAWord} from "@/api/index";
|
||||
|
||||
export default {
|
||||
name: "Index",
|
||||
data() {
|
||||
return {
|
||||
//响应数据
|
||||
apiAWord: {},
|
||||
|
||||
//apiAWord请求参数
|
||||
apiAWordParams: {
|
||||
rand: 1
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
created() {
|
||||
this.getApiAWord();
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
//随机获取一条每日一句
|
||||
getApiAWord() {
|
||||
getApiAWord(this.apiAWordParams).then(res => {
|
||||
this.apiAWord = res.data
|
||||
})
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
};
|
||||
|
|
@ -77,65 +29,6 @@ export default {
|
|||
|
||||
<style scoped lang="scss">
|
||||
|
||||
.bg-purple {
|
||||
background: #d3dce6;
|
||||
}
|
||||
|
||||
.grid-content {
|
||||
border-radius: 4px;
|
||||
min-height: 36px;
|
||||
height: 141px;
|
||||
}
|
||||
|
||||
.box-card {
|
||||
width: 744px;
|
||||
background-color: #f2f2f2;
|
||||
height: 141px;
|
||||
}
|
||||
|
||||
.box-card div {
|
||||
float: left;
|
||||
}
|
||||
|
||||
|
||||
.aWordImage {
|
||||
float: left;
|
||||
width: 108px;
|
||||
height: 141px;
|
||||
}
|
||||
|
||||
.aWordAudio {
|
||||
float: left;
|
||||
height: 141px;
|
||||
width: 300px;
|
||||
/*flex 布局*/
|
||||
display: flex;
|
||||
/*实现垂直居中*/
|
||||
align-items: center;
|
||||
/*实现水平居中*/
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.aWordContent {
|
||||
float: left;
|
||||
width: 168px;
|
||||
height: 141px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
overflow:hidden;
|
||||
}
|
||||
|
||||
.aWordNote {
|
||||
width: 168px;
|
||||
height: 141px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
float: left;
|
||||
overflow:hidden;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
|
|
|
|||
|
|
@ -32,9 +32,10 @@ import java.util.Objects;
|
|||
import static com.xjs.consts.ApiWarnHandleConst.NO;
|
||||
|
||||
/**
|
||||
* api日志切面类
|
||||
*
|
||||
* @author xiejs
|
||||
* @desc api日志切面类
|
||||
* @create 2021-12-26
|
||||
* @since 2021-12-26
|
||||
*/
|
||||
@Component
|
||||
@Aspect
|
||||
|
|
@ -44,7 +45,9 @@ public class ApiLogAspect {
|
|||
@Autowired
|
||||
private RemoteLogFeign remoteLogFeign;
|
||||
|
||||
//用来调用预警,记录预警信息
|
||||
/**
|
||||
* 用来调用预警,记录预警信息
|
||||
*/
|
||||
@Autowired
|
||||
private RemoteWarningCRUDFeign remoteWarningCRUDFeign;
|
||||
|
||||
|
|
@ -77,6 +80,7 @@ public class ApiLogAspect {
|
|||
|
||||
/**
|
||||
* 处理完请求后执行
|
||||
*
|
||||
* @param joinPoint 切点
|
||||
*/
|
||||
@AfterReturning(pointcut = "@annotation(apiLog)", returning = "jsonResult")
|
||||
|
|
@ -87,6 +91,7 @@ public class ApiLogAspect {
|
|||
|
||||
/**
|
||||
* 异常切点
|
||||
*
|
||||
* @param joinPoint 连接点
|
||||
* @param apiLog 自定义注解
|
||||
* @param e 抛出的异常
|
||||
|
|
@ -130,6 +135,7 @@ public class ApiLogAspect {
|
|||
|
||||
/**
|
||||
* 预警切入
|
||||
*
|
||||
* @param between api接口调用时间
|
||||
* @param joinPoint aop连接对象
|
||||
*/
|
||||
|
|
@ -202,8 +208,6 @@ public class ApiLogAspect {
|
|||
haveApiRecord.getDayCount());
|
||||
apiWarning.setWarningMessage(message);
|
||||
remoteWarningCRUDFeign.saveApiWarningForRPC(apiWarning);
|
||||
|
||||
// todo websocket实现即时推送到客户端
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue