This commit is contained in:
landaiqing 2023-12-28 22:48:08 +08:00
parent 7d9186d31c
commit 26fec1bf40
15 changed files with 342 additions and 103 deletions

51
package-lock.json generated
View File

@ -22,6 +22,8 @@
"qs": "^6.11.2", "qs": "^6.11.2",
"vue": "^2.6.14", "vue": "^2.6.14",
"vue-iframe": "^0.0.0", "vue-iframe": "^0.0.0",
"vue-live2d": "^1.3.1",
"vue-meta": "^2.4.0",
"vue-router": "^3.5.1", "vue-router": "^3.5.1",
"vue2-element-dict": "^1.0.2", "vue2-element-dict": "^1.0.2",
"vuex": "^3.6.2" "vuex": "^3.6.2"
@ -16200,6 +16202,15 @@
"resolved": "https://registry.npmjs.org/vue-iframe/-/vue-iframe-0.0.0.tgz", "resolved": "https://registry.npmjs.org/vue-iframe/-/vue-iframe-0.0.0.tgz",
"integrity": "sha512-gH791EBUqJrsa5SuGhxeujyK4NFngJnuvpSJN0p5W5VoHmYkW35ZekOLlCZTN658VsXUYNGCPHlk9bzLtRyd7Q==" "integrity": "sha512-gH791EBUqJrsa5SuGhxeujyK4NFngJnuvpSJN0p5W5VoHmYkW35ZekOLlCZTN658VsXUYNGCPHlk9bzLtRyd7Q=="
}, },
"node_modules/vue-live2d": {
"version": "1.3.1",
"resolved": "https://registry.npmmirror.com/vue-live2d/-/vue-live2d-1.3.1.tgz",
"integrity": "sha512-CWi495jWERVm9E/l9e7duLCuPsvJdPqKrY9XAStWpk7Uixrs5GwqA3qvfQGihfwrfRLthaRVoZDW3+ZZJ5O2RQ==",
"dependencies": {
"core-js": "^3.6.5",
"vue": "^2.6.11"
}
},
"node_modules/vue-loader": { "node_modules/vue-loader": {
"version": "17.3.1", "version": "17.3.1",
"resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-17.3.1.tgz", "resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-17.3.1.tgz",
@ -16286,6 +16297,22 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/vue-meta": {
"version": "2.4.0",
"resolved": "https://registry.npmmirror.com/vue-meta/-/vue-meta-2.4.0.tgz",
"integrity": "sha512-XEeZUmlVeODclAjCNpWDnjgw+t3WA6gdzs6ENoIAgwO1J1d5p1tezDhtteLUFwcaQaTtayRrsx7GL6oXp/m2Jw==",
"dependencies": {
"deepmerge": "^4.2.2"
}
},
"node_modules/vue-meta/node_modules/deepmerge": {
"version": "4.3.1",
"resolved": "https://registry.npmmirror.com/deepmerge/-/deepmerge-4.3.1.tgz",
"integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/vue-router": { "node_modules/vue-router": {
"version": "3.6.5", "version": "3.6.5",
"resolved": "https://registry.npmmirror.com/vue-router/-/vue-router-3.6.5.tgz", "resolved": "https://registry.npmmirror.com/vue-router/-/vue-router-3.6.5.tgz",
@ -29729,6 +29756,15 @@
"resolved": "https://registry.npmjs.org/vue-iframe/-/vue-iframe-0.0.0.tgz", "resolved": "https://registry.npmjs.org/vue-iframe/-/vue-iframe-0.0.0.tgz",
"integrity": "sha512-gH791EBUqJrsa5SuGhxeujyK4NFngJnuvpSJN0p5W5VoHmYkW35ZekOLlCZTN658VsXUYNGCPHlk9bzLtRyd7Q==" "integrity": "sha512-gH791EBUqJrsa5SuGhxeujyK4NFngJnuvpSJN0p5W5VoHmYkW35ZekOLlCZTN658VsXUYNGCPHlk9bzLtRyd7Q=="
}, },
"vue-live2d": {
"version": "1.3.1",
"resolved": "https://registry.npmmirror.com/vue-live2d/-/vue-live2d-1.3.1.tgz",
"integrity": "sha512-CWi495jWERVm9E/l9e7duLCuPsvJdPqKrY9XAStWpk7Uixrs5GwqA3qvfQGihfwrfRLthaRVoZDW3+ZZJ5O2RQ==",
"requires": {
"core-js": "^3.6.5",
"vue": "^2.6.11"
}
},
"vue-loader": { "vue-loader": {
"version": "17.3.1", "version": "17.3.1",
"resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-17.3.1.tgz", "resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-17.3.1.tgz",
@ -29791,6 +29827,21 @@
} }
} }
}, },
"vue-meta": {
"version": "2.4.0",
"resolved": "https://registry.npmmirror.com/vue-meta/-/vue-meta-2.4.0.tgz",
"integrity": "sha512-XEeZUmlVeODclAjCNpWDnjgw+t3WA6gdzs6ENoIAgwO1J1d5p1tezDhtteLUFwcaQaTtayRrsx7GL6oXp/m2Jw==",
"requires": {
"deepmerge": "^4.2.2"
},
"dependencies": {
"deepmerge": {
"version": "4.3.1",
"resolved": "https://registry.npmmirror.com/deepmerge/-/deepmerge-4.3.1.tgz",
"integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A=="
}
}
},
"vue-router": { "vue-router": {
"version": "3.6.5", "version": "3.6.5",
"resolved": "https://registry.npmmirror.com/vue-router/-/vue-router-3.6.5.tgz", "resolved": "https://registry.npmmirror.com/vue-router/-/vue-router-3.6.5.tgz",

View File

@ -22,6 +22,8 @@
"qs": "^6.11.2", "qs": "^6.11.2",
"vue": "^2.6.14", "vue": "^2.6.14",
"vue-iframe": "^0.0.0", "vue-iframe": "^0.0.0",
"vue-live2d": "^1.3.1",
"vue-meta": "^2.4.0",
"vue-router": "^3.5.1", "vue-router": "^3.5.1",
"vue2-element-dict": "^1.0.2", "vue2-element-dict": "^1.0.2",
"vuex": "^3.6.2" "vuex": "^3.6.2"

View File

@ -15,7 +15,7 @@
<img style="width: 28px" :src="require('@/assets/img/null.png')" alt="图标"> <img style="width: 28px" :src="require('@/assets/img/null.png')" alt="图标">
</div> </div>
</el-image> </el-image>
<span v-if="item.name" style="overflow-x: scroll;margin-top:2px;margin-left:10px;width:90%;text-align: center">{{item.name}}</span> <span v-if="item.name" style="overflow-x: scroll;margin-top:2px;margin-left:10px;width:300px;height: 30px;white-space: nowrap;text-align: center">{{item.name}}</span>
</div> </div>
</div> </div>
</div> </div>
@ -44,12 +44,27 @@ export default {
}, },
methods: { methods: {
// toDetail(id){
// if(id){
// this.$router.push({
// path: '/nav',
// query: {
// uid: id,
// refresh: true
// }
// })
// } else {
// return false;
// }
// },
toDetail(id){ toDetail(id){
if(id){ if(id){
let pathInfo = this.$router.resolve({ let pathInfo = this.$router.resolve({
path: '/nav', path: '/nav',
query: { query: {
uid: id, uid: id,
refresh: true
} }
}) })
window.open(pathInfo.href, '_self'); window.open(pathInfo.href, '_self');

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="wrapper"> <div class="wrapper" :key="UrlId">
<LeftSide :category="category"></LeftSide> <LeftSide :category="category"></LeftSide>
<div class="DefinedPage"> <div class="DefinedPage">
<div class="LeftPart" style="overflow: auto"> <div class="LeftPart" style="overflow: auto">
@ -141,6 +141,19 @@
</div> </div>
</div> </div>
</div> </div>
<div id="热度趋势" class="JustBack" style="width:670px;display:flex; flex-direction: column; flex-wrap: nowrap;">
<div style="width:670px;color: var(--theme-color)">
<div class="HeadLine" style="margin-top:50px">
<div class="HeadSquare"></div>
<div class="TitleFont"><i class="el-icon-info"></i>特别声明</div>
</div>
<div class="ArticleContent">
<span>
{{copyright_info}}
</span>
</div>
</div>
</div>
<!--用户评论--> <!--用户评论-->
<div id="用户评论" v-show="update" class="JustBack" style="width:670px; <div id="用户评论" v-show="update" class="JustBack" style="width:670px;
height:auto;display:flex; flex-direction: column; flex-wrap: nowrap;"> height:auto;display:flex; flex-direction: column; flex-wrap: nowrap;">
@ -379,16 +392,29 @@ export default {
rules: { rules: {
rating: [{ required: 'true', message: '请输入评分!', trigger: 'blur' }], rating: [{ required: 'true', message: '请输入评分!', trigger: 'blur' }],
content: [{ required: 'true', message: '请输入评价!', trigger: 'blur' }], content: [{ required: 'true', message: '请输入评价!', trigger: 'blur' }],
} },
copyright_info:null,
} }
}, },
watch: { watch: {
'$route': 'getPath' // '$route': 'getPath',
$route () {
this.getPath();
if(this.$route.query.refresh){
this.GetAllComment();
this.GetAllCate();
this.addViewByTime();
this.UrlId = this.$route.query.uid;
this.getUser();
}
}
}, },
mounted() { mounted() {
// this.GetAllComment(); // this.GetAllComment();
this.GetAllComment(); this.GetAllComment();
this.GetAllCate(); this.GetAllCate();
this.getConfig('copyright_info');
}, },
created() { created() {
this.addViewByTime(); this.addViewByTime();
@ -403,6 +429,35 @@ export default {
}, },
computed: {}, computed: {},
methods: { methods: {
getConfig(name) {
let _this = this;
if (name) {
axios({
method: 'get',
url: '/api/getConfig',
params: {
name: name
}
}).then(function (res) {
if (res) {
if (res.data.copyright_info) {
_this.copyright_info = res.data.copyright_info.value;
}
// if(res.data.light_bg){
// _this.light_bg=res.data.light_bg.value;
// }
}
}).catch((error) => {
})
} else {
return false
}
},
closeDialog() { closeDialog() {
var that = this; var that = this;
// //

View File

@ -55,6 +55,7 @@ export default {
path: '/nav', path: '/nav',
query: { query: {
uid: id, uid: id,
refresh: true
} }
}) })
window.open(pathInfo.href, '_self'); window.open(pathInfo.href, '_self');

View File

@ -22,7 +22,7 @@
<!-- <div class="app-card__subtext">{{nav.desc}}</div>--> <!-- <div class="app-card__subtext">{{nav.desc}}</div>-->
<div class="dividing-line"></div> <div class="dividing-line"></div>
<div class="app-card-buttons"> <div class="app-card-buttons">
<el-tooltip v-if="nav.agentHint" class="item" effect="dark" :content="nav.agentHint" placement="bottom"> <el-tooltip v-if="nav.agentHint || copyright_info" class="item" effect="dark" :content="nav.agentHint || copyright_info" placement="bottom">
<i v-show="nav.isNeedAgent===1" style="color: red" class="qr el-icon-info"></i> <i v-show="nav.isNeedAgent===1" style="color: red" class="qr el-icon-info"></i>
</el-tooltip> </el-tooltip>
<!-- <button class="content-button status-button"><i class="el-icon-d-arrow-right"></i>详情</button>--> <!-- <button class="content-button status-button"><i class="el-icon-d-arrow-right"></i>详情</button>-->
@ -66,10 +66,11 @@ export default {
return { return {
imageCode: '', imageCode: '',
dialogVisible:false, dialogVisible:false,
copyright_info:null,
} }
}, },
mounted() { mounted() {
this.getConfig('copyright_info');
}, },
created() { created() {
@ -116,13 +117,41 @@ export default {
path: '/nav', path: '/nav',
query: { query: {
uid: this.nav.urlId, uid: this.nav.urlId,
refresh: true
} }
}) })
window.open(pathInfo.href, '_self'); window.open(pathInfo.href, '_self');
} else { } else {
return false; return false;
} }
},
getConfig(name) {
let _this = this;
if (name) {
axios({
method: 'get',
url: '/api/getConfig',
params: {
name: name
} }
}).then(function (res) {
if (res) {
if (res.data.copyright_info) {
_this.copyright_info = res.data.copyright_info.value;
}
// if(res.data.light_bg){
// _this.light_bg=res.data.light_bg.value;
// }
}
}).catch((error) => {
})
} else {
return false
}
},
} }
} }
</script> </script>

View File

@ -0,0 +1,23 @@
<template>
</template>
<script>
export default {
name: "CommentManage",
data() {
return {}
},
mounted() {
},
created() {
},
computed: {},
methods: {}
}
</script>
<style scoped>
</style>

View File

@ -9,7 +9,9 @@
<InfoCard v-if="this.infoData.urlListNum && this.infoData.name1 && this.infoData.icon1" :info="this.infoData.urlListNum" :name="this.infoData.name1" :icon="this.infoData.icon1"></InfoCard> <InfoCard v-if="this.infoData.urlListNum && this.infoData.name1 && this.infoData.icon1" :info="this.infoData.urlListNum" :name="this.infoData.name1" :icon="this.infoData.icon1"></InfoCard>
<InfoCard v-if="this.infoData.cateNum && this.infoData.name2 && this.infoData.icon2" :info="this.infoData.cateNum" :name="this.infoData.name2" :icon="this.infoData.icon2" style="margin-left: 10px"></InfoCard> <InfoCard v-if="this.infoData.cateNum && this.infoData.name2 && this.infoData.icon2" :info="this.infoData.cateNum" :name="this.infoData.name2" :icon="this.infoData.icon2" style="margin-left: 10px"></InfoCard>
</div> </div>
<div style="display: flex;align-items: center;justify-content: center">
<vueLive2d :size="450" :homePage="homepage"></vueLive2d>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -19,10 +21,10 @@ import PersonalInfoCard from "@/components/setting/home/PersonalInfoCard.vue";
import InfoCard from "@/components/setting/home/InfoCard.vue"; import InfoCard from "@/components/setting/home/InfoCard.vue";
import axios from "axios"; import axios from "axios";
import Vue from "vue"; import Vue from "vue";
import vueLive2d from 'vue-live2d'
export default { export default {
name: "PersonalHomePage", name: "PersonalHomePage",
components: { InfoCard, PersonalInfoCard}, components: { InfoCard, PersonalInfoCard,vueLive2d},
data() { data() {
return { return {
infoData:{ infoData:{
@ -33,6 +35,7 @@ export default {
icon1:'https://imgbed.landaiqing.space/img/1/2023/12/25/1_65893ab12d3f2_1703492272311_20231225.webp', icon1:'https://imgbed.landaiqing.space/img/1/2023/12/25/1_65893ab12d3f2_1703492272311_20231225.webp',
icon2:'https://imgbed.landaiqing.space/img/1/2023/12/25/1_65893af89eecf_1703492343951_20231225.webp', icon2:'https://imgbed.landaiqing.space/img/1/2023/12/25/1_65893af89eecf_1703492343951_20231225.webp',
}, },
homepage:'https://landaiqing.space'
} }
}, },

View File

@ -22,12 +22,12 @@
<!-- <span class="min-title">Logo(深色模式)</span>--> <!-- <span class="min-title">Logo(深色模式)</span>-->
<!-- <UploadComponent :config-name="dark_logo" style="margin-top: 10px;"></UploadComponent>--> <!-- <UploadComponent :config-name="dark_logo" style="margin-top: 10px;"></UploadComponent>-->
<!-- </div>--> <!-- </div>-->
<div class="min-content" style="margin-left: 50px"> <!-- <div class="min-content" style="margin-left: 50px">-->
<span class="min-title">Favicon</span> <!-- <span class="min-title">Favicon</span>-->
<div class="img-card"> <!-- <div class="img-card">-->
<UploadComponent style="margin-top: 10px;" :config-name="favicon"></UploadComponent> <!-- <UploadComponent style="margin-top: 10px;" :config-name="favicon"></UploadComponent>-->
</div> <!-- </div>-->
</div> <!-- </div>-->
</div> </div>
<!-- <div class="color-select">--> <!-- <div class="color-select">-->
<!-- <span class="theme-color-select">主题色</span>--> <!-- <span class="theme-color-select">主题色</span>-->
@ -115,7 +115,6 @@ export default {
dark_bg:null, dark_bg:null,
light_bg:null, light_bg:null,
value:null, value:null,
favicon:"favicon",
logo:'logo', logo:'logo',
dark_bg_file:'dark_bg_file', dark_bg_file:'dark_bg_file',
light_bg_file:'light_bg_file', light_bg_file:'light_bg_file',

View File

@ -19,10 +19,10 @@
<span class="min-title">站名:</span> <span class="min-title">站名:</span>
<el-input <el-input
placeholder="请输入站名" placeholder="请输入站名"
v-model="website_name" v-model="metaInfo.website_name"
clearable clearable
style="margin-top:10px" style="margin-top:10px"
@change="setInfoConfig('website_name',website_name,'String')" @change="setInfoConfig('website_name',metaInfo.website_name,'String')"
> >
</el-input> </el-input>
</div> </div>
@ -32,9 +32,9 @@
type="textarea" type="textarea"
:rows="3" :rows="3"
placeholder="请输入内容" placeholder="请输入内容"
v-model="seo_desc" v-model="metaInfo.seo_desc"
style="margin-top:10px" style="margin-top:10px"
@change="setInfoConfig('seo_desc',seo_desc,'String')"> @change="setInfoConfig('seo_desc',metaInfo.seo_desc,'String')">
</el-input> </el-input>
</div> </div>
<div class="LineInput"> <div class="LineInput">
@ -43,9 +43,9 @@
type="textarea" type="textarea"
:rows="3" :rows="3"
placeholder="请输入内容" placeholder="请输入内容"
v-model="seo_key_words" v-model="metaInfo.seo_key_words"
style="margin-top:10px" style="margin-top:10px"
@change="setInfoConfig('seo_key_words',seo_key_words,'String')"> @change="setInfoConfig('seo_key_words',metaInfo.seo_key_words,'String')">
</el-input> </el-input>
</div> </div>
<!-- <div class="LineInput">--> <!-- <div class="LineInput">-->
@ -82,17 +82,17 @@
<!-- </div>--> <!-- </div>-->
<!-- <el-button @click="addItem" style="width: 100px;margin-top:20px" plain round type="primary">增加</el-button>--> <!-- <el-button @click="addItem" style="width: 100px;margin-top:20px" plain round type="primary">增加</el-button>-->
<!-- </div>--> <!-- </div>-->
<div class="LineInput" style="margin-top:25px!important;"> <!-- <div class="LineInput" style="margin-top:25px!important;">-->
<span class="min-title">底部信息</span> <!-- <span class="min-title">底部信息</span>-->
<el-input <!-- <el-input-->
type="textarea" <!-- type="textarea"-->
:rows="3" <!-- :rows="3"-->
placeholder="请输入内容" <!-- placeholder="请输入内容"-->
v-model="bottom_info" <!-- v-model="bottom_info"-->
style="margin-top:10px" <!-- style="margin-top:10px"-->
@change="setInfoConfig('bottom_info',bottom_info,'String')"> <!-- @change="setInfoConfig('bottom_info',bottom_info,'String')">-->
</el-input> <!-- </el-input>-->
</div> <!-- </div>-->
<div style="display: flex;flex-direction: column"> <div style="display: flex;flex-direction: column">
<span class="min-title">版权信息</span> <span class="min-title">版权信息</span>
<el-input <el-input
@ -205,23 +205,22 @@
<script> <script>
import axios from "axios"; import axios from "axios";
import Vue from "vue"; import Vue from "vue";
import {mapMutations} from "vuex";
export default { export default {
name: "InformationSettings", name: "InformationSettings",
components: {}, components: {},
data() { data() {
return { return {
metaInfo:{
website_name: null, website_name: null,
seo_desc : null, seo_desc : null,
seo_key_words: null, seo_key_words: null,
},
bottom_info: null, bottom_info: null,
copyright_info: null, copyright_info: null,
icp_info: null, icp_info: null,
proxy_prompts: null, proxy_prompts: null,
// form: [{
// name: null,
// url: null,
// }]
loading:true, loading:true,
} }
}, },
@ -229,7 +228,6 @@ export default {
this.getInfoConfig('website_name'); this.getInfoConfig('website_name');
this.getInfoConfig('seo_desc'); this.getInfoConfig('seo_desc');
this.getInfoConfig('seo_key_words'); this.getInfoConfig('seo_key_words');
this.getInfoConfig('bottom_info');
this.getInfoConfig('copyright_info'); this.getInfoConfig('copyright_info');
this.getInfoConfig('icp_info'); this.getInfoConfig('icp_info');
this.getInfoConfig('proxy_prompts'); this.getInfoConfig('proxy_prompts');
@ -239,6 +237,8 @@ export default {
}, },
computed: {}, computed: {},
methods: { methods: {
...mapMutations(['setTitle','setKeywords','setDescription']),
setInfoConfig(name,value,type){ setInfoConfig(name,value,type){
let _this = this; let _this = this;
if (localStorage.getItem('userId')&&localStorage.getItem('Authorization')) { if (localStorage.getItem('userId')&&localStorage.getItem('Authorization')) {
@ -303,13 +303,17 @@ export default {
}).then(function (res) { }).then(function (res) {
if(res){ if(res){
if(res.data.website_name){ if(res.data.website_name){
_this.website_name=res.data.website_name.value; _this.metaInfo.website_name=res.data.website_name.value;
_this.setTitle({title:_this.metaInfo.website_name});
} }
if(res.data.seo_desc){ if(res.data.seo_desc){
_this.seo_desc=res.data.seo_desc.value; _this.metaInfo.seo_desc=res.data.seo_desc.value;
_this.setDescription({description:_this.metaInfo.seo_desc});
} }
if(res.data.seo_key_words){ if(res.data.seo_key_words){
_this.seo_key_words=res.data.seo_key_words.value; _this.metaInfo.seo_key_words=res.data.seo_key_words.value;
_this.setKeywords({keywords:_this.metaInfo.seo_key_words});
} }
if(res.data.bottom_info){ if(res.data.bottom_info){
_this.bottom_info=res.data.bottom_info.value; _this.bottom_info=res.data.bottom_info.value;

View File

@ -5,6 +5,7 @@ import store from './store'
import axios from "axios"; import axios from "axios";
import ElementUI from 'element-ui'; import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css'; import 'element-ui/lib/theme-chalk/index.css';
import VueMeta from "vue-meta";
Vue.prototype.axios = axios; Vue.prototype.axios = axios;
// 请求拦截器, 每次请求都会在请求头中携带token // 请求拦截器, 每次请求都会在请求头中携带token
axios.interceptors.request.use((config) => { axios.interceptors.request.use((config) => {
@ -50,5 +51,19 @@ Vue.use(ElementUI);
new Vue({ new Vue({
router, router,
store, store,
metaInfo() {
return {
title: localStorage.getItem('title'),
meta: [
{
name: "keywords",
content: localStorage.getItem('keywords'),
}, {
name: "description",
content: localStorage.getItem('description'),
}
]
}
},
render: h => h(App) render: h => h(App)
}).$mount('#app') }).$mount('#app')

View File

@ -21,6 +21,7 @@ import bannerManage from "@/components/setting/banner/BannerManage.vue";
import userManage from "@/components/setting/user/UserManage.vue"; import userManage from "@/components/setting/user/UserManage.vue";
import noticeManage from "@/components/setting/notice/NoticeManage.vue"; import noticeManage from "@/components/setting/notice/NoticeManage.vue";
import attachmentManage from "@/components/setting/attachment/AttachmentManage.vue"; import attachmentManage from "@/components/setting/attachment/AttachmentManage.vue";
import commentManage from "@/components/setting/comment/CommentManage.vue";
const originalPush = VueRouter.prototype.push const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) { VueRouter.prototype.push = function push(location) {
@ -151,6 +152,11 @@ const routes = [
name: '/importExport', name: '/importExport',
component: importExport, component: importExport,
}, },
{
path: '/comment',
name: '/comment',
component: commentManage,
},
], ],
}, },

View File

@ -5,36 +5,48 @@ Vue.use(Vuex)
export default new Vuex.Store({ export default new Vuex.Store({
state: { state: {
theme:localStorage.getItem('theme') ? localStorage.getItem('theme') : '', title: localStorage.getItem('title') ? localStorage.getItem('title') : '',
userId:localStorage.getItem('userId') ? localStorage.getItem('userId') : '', keywords: localStorage.getItem('keywords') ? localStorage.getItem('keywords') : '',
userRole:localStorage.getItem('userRole') ? localStorage.getItem('userRole') : '', description: localStorage.getItem('description') ? localStorage.getItem('description') : '',
theme: localStorage.getItem('theme') ? localStorage.getItem('theme') : '',
userId: localStorage.getItem('userId') ? localStorage.getItem('userId') : '',
userRole: localStorage.getItem('userRole') ? localStorage.getItem('userRole') : '',
// 存储token // 存储token
Authorization: localStorage.getItem('Authorization') ? localStorage.getItem('Authorization') : '', Authorization: localStorage.getItem('Authorization') ? localStorage.getItem('Authorization') : '',
}, },
getters: { getters: {},
},
mutations: { mutations: {
setTheme:(state,data)=>{ setTitle(state, data){
state.theme=data.theme; state.title = data.title;
localStorage.setItem('theme',data.theme); localStorage.setItem('title', data.title);
}, },
changeLogin (state, user) { setKeywords(state, data){
state.keywords = data.keywords;
localStorage.setItem('keywords', data.keywords);
},
setDescription(state, data){
state.description = data.description;
localStorage.setItem('description', data.description);
},
setTheme(state, data){
state.theme = data.theme;
localStorage.setItem('theme', data.theme);
},
changeLogin(state, user) {
state.Authorization = user.Authorization; state.Authorization = user.Authorization;
localStorage.setItem('Authorization', user.Authorization); localStorage.setItem('Authorization', user.Authorization);
}, },
setUserId(state,user){ setUserId(state, user) {
state.userId=user.userId; state.userId = user.userId;
localStorage.setItem('userId',user.userId); localStorage.setItem('userId', user.userId);
}, },
setUserRole(state,user){ setUserRole(state, user) {
state.userRole=user.userRole; state.userRole = user.userRole;
localStorage.setItem('userRole',user.userRole); localStorage.setItem('userRole', user.userRole);
}, },
}, },
actions: { actions: {},
}, modules: {}
modules: {
}
}) })

View File

@ -6,14 +6,14 @@
<div class="video-bg"> <div class="video-bg">
<el-image v-if="imageUrl" style="width: 100%;height: 100%" :src="'data:image/jpg;base64,'+imageUrl"> <el-image v-if="imageUrl" style="width: 100%;height: 100%" :src="'data:image/jpg;base64,'+imageUrl">
<div slot="error" class="image-slot"> <div slot="error" class="image-slot">
<img style="width: 100%" :src="require('@/assets/img/macos-big-sur-1280x720-dark-wwdc-2020-22655.jpg')" alt="背景"> <video width="320" height="240" autoplay="" loop="" muted="" __idm_id__="1581057">
</div>
</el-image>
<video v-else width="320" height="240" autoplay="" loop="" muted="" __idm_id__="1581057">
<source src="../assets/video/background.mp4" type="video/mp4"> <source src="../assets/video/background.mp4" type="video/mp4">
Your browser does not support the video tag. Your browser does not support the video tag.
</video> </video>
</div> </div>
</el-image>
</div>
<div v-if="value==='1'" class="dark-light" @click="changeStyle"> <div v-if="value==='1'" class="dark-light" @click="changeStyle">
<svg viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5" fill="none" stroke-linecap="round" <svg viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5" fill="none" stroke-linecap="round"
stroke-linejoin="round"> stroke-linejoin="round">
@ -28,6 +28,10 @@
</keep-alive> </keep-alive>
<div class="overlay-app"></div> <div class="overlay-app"></div>
</div> </div>
<div v-if="icp_info!==''" style="z-index: 9999;display: flex;flex-direction: row;margin-bottom: -30px">
<el-link style="color: var(--theme-color);" :underline="false" href="https://beian.miit.gov.cn/" target="_blank">备案号 </el-link>
<el-link style="color: var(--theme-color);" :underline="false" href="https://beian.miit.gov.cn/" target="_blank"> {{icp_info}}</el-link>
</div>
</body> </body>
</template> </template>
@ -49,30 +53,29 @@ export default {
data() { data() {
return { return {
isLight: false, isLight: false,
folderTrue: [],
folderFalse: [],
value:null, value:null,
imageUrl:null, imageUrl:null,
icp_info:null,
} }
}, },
mounted() { mounted() {
let nowDate = new Date() },
let hour = nowDate.getHours() created() {
// // let nowDate = new Date()
if (hour > 18 && hour <= 24 || hour < 6) { // let hour = nowDate.getHours()
this.goDark() // //
} // if (hour > 18 && hour <= 24 || hour < 6) {
// this.goDark()
// }
// //
if (localStorage.getItem('theme') === 'dark') { if (localStorage.getItem('theme') === 'dark') {
this.goDark() this.goDark()
}else{ }else{
this.goLight(); this.goLight();
} }
},
created() {
this.getConfig('open_dark_light'); this.getConfig('open_dark_light');
this.getConfig('icp_info');
}, },
computed: {}, computed: {},
@ -93,13 +96,13 @@ export default {
if (res.data.open_dark_light) { if (res.data.open_dark_light) {
_this.value = res.data.open_dark_light.value; _this.value = res.data.open_dark_light.value;
} }
// if(res.data.dark_bg){ if(res.data.icp_info){
// _this.dark_bg=res.data.dark_bg.value; _this.icp_info=res.data.icp_info.value;
// } }
// if(res.data.light_bg){ // if(res.data.light_bg){
// _this.light_bg=res.data.light_bg.value; // _this.light_bg=res.data.light_bg.value;
// } // }
// _this.loading=false;
} }
}).catch((error) => { }).catch((error) => {
@ -140,16 +143,18 @@ export default {
}, },
goDark() { goDark() {
this.getImageByConfig('dark_bg_file');
// //
document.body.classList.remove('light-mode') document.body.classList.remove('light-mode')
this.setTheme({theme:'dark'}) this.setTheme({theme:'dark'});
this.getImageByConfig('dark_bg_file');
}, },
goLight() { goLight() {
this.getImageByConfig('light_bg_file');
// //
document.body.classList.add('light-mode') document.body.classList.add('light-mode')
this.setTheme({theme:'light'}); this.setTheme({theme:'light'});
this.getImageByConfig('light_bg_file');
}, },
changeStyle() { changeStyle() {
this.isLight = !this.isLight this.isLight = !this.isLight

View File

@ -24,6 +24,10 @@
</div> </div>
<div class="overlay-app"></div> <div class="overlay-app"></div>
</div> </div>
<div v-if="icp_info!==''" style="z-index: 9999;display: flex;flex-direction: row">
<el-link style="color: var(--theme-color);" :underline="false" href="https://beian.miit.gov.cn/" target="_blank">备案号 </el-link>
<el-link style="color: var(--theme-color);" :underline="false" href="https://beian.miit.gov.cn/" target="_blank"> {{icp_info}}</el-link>
</div>
</body> </body>
</template> </template>
@ -43,13 +47,28 @@ export default {
data() { data() {
return { return {
value:null, value:null,
isLight:false,
icp_info:null,
} }
}, },
mounted() { mounted() {
}, },
created() { created() {
this.getConfig('open_dark_light'); this.getConfig('open_dark_light');
this.getConfig('icp_info');
// let nowDate = new Date()
// let hour = nowDate.getHours()
// //
// if (hour > 18 && hour <= 24 || hour < 6) {
// this.goDark()
// }
//
if (localStorage.getItem('theme') === 'dark') {
this.goDark()
}else{
this.goLight();
}
}, },
computed: {}, computed: {},
methods:{ methods:{
@ -68,9 +87,9 @@ export default {
if (res.data.open_dark_light) { if (res.data.open_dark_light) {
_this.value = res.data.open_dark_light.value; _this.value = res.data.open_dark_light.value;
} }
// if(res.data.dark_bg){ if(res.data.icp_info){
// _this.dark_bg=res.data.dark_bg.value; _this.icp_info=res.data.icp_info.value;
// } }
// if(res.data.light_bg){ // if(res.data.light_bg){
// _this.light_bg=res.data.light_bg.value; // _this.light_bg=res.data.light_bg.value;
// } // }