提交 562eee47 编写于 作者: BeMount's avatar BeMount 💬

chore: 同步线上

上级 5e60de83
......@@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<link href="https://cdn.bootcss.com/github-markdown-css/2.10.0/github-markdown.min.css" rel="stylesheet">
<!-- <link href="https://cdn.bootcss.com/github-markdown-css/2.10.0/github-markdown.min.css" rel="stylesheet"> -->
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
......
import {turnUTCToGMT} from "@/util/util";
import Cookie from 'js-cookie';
export const getAllArticleInfo = vm =>{
vm.$axios.request({
url:'/article/getAllArticleInfo',
......@@ -12,7 +13,14 @@ export const getAllArticleInfo = vm =>{
// element.isActive = false;
if(element.tag){
vm.tags.push({tagName:element.tag,tagColor:color[index%5]});
for(let i = 0;i < index;i++){
if(element.tag === res.data.articleInfo[i].tag){
vm.tags.pop();
break;
}
}
}
});
}).catch(error => {
......@@ -105,13 +113,39 @@ export const updateArticleList = (vm, tag) =>{
}
}).then(res => {
// vm.articles.splice(0);
// console.log(vm.articles);
vm.articles.splice(0);
res.data.articleInfo.forEach(element => {
element.createTime = turnUTCToGMT(element.createTime)
vm.articles.push(element);
let articleInfo = res.data.articleInfo;
articleInfo.forEach(element => {
element.isActive = false;
})
// console.log(res);
vm.$axios.request({
url:'/personalCenter/getCompleteUserInfo',
method:'get'
}).then(res => {
console.log('----res', res);
if(!res.data.userInfo){
articleInfo.forEach(element => {
element.createTime = turnUTCToGMT(element.createTime)
vm.articles.push(element);
})
return;
}
for(let i = 0 ;i < res.data.userInfo.collections.length;i ++){
for(let j = 0;j < articleInfo.length ;j++){
if(articleInfo[j].title === res.data.userInfo.collections[i].title){
articleInfo[j].isActive = true;
}
}
}
articleInfo.forEach(element => {
element.createTime = turnUTCToGMT(element.createTime);
vm.articles.push(element);
})
}).catch(error => {
console.log('error', error);
})
}).catch( error => {
console.log('error', error);
})
......
......@@ -20,7 +20,7 @@ export const login = (vm, name) =>{
vm.isLogedIn = true;
vm.$Message.success('登录成功');
console.log('------isLogedIn', vm.isLogedIn);
Cookie.set('userName', vm.formData.user);
Cookie.set('userName', vm.formData.user,{ expires: 1 });
vm.userName = Cookie.get('userName');
if(vm.formData.user === 'BeMount'){
vm.updateMenuList();
......
......@@ -37,6 +37,12 @@ export const getAllTagInfo = vm =>{
res.data.articleInfo.forEach((element, index) => {
if(element.tag){
vm.tags.push(element.tag);
for(let i = 0;i < index;i++){
if(element.tag === res.data.articleInfo[i].tag){
vm.tags.pop();
break;
}
}
}
});
}).catch(error => {
......
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ViewUI from 'view-design';
// import router from './router'
import mavonEditor from 'mavon-editor'
import 'mavon-editor/dist/css/index.css'
// use
import 'view-design/dist/styles/iview.css';
import router from './router'
import axios from 'axios';
import {appRouters} from '@/router/router'
......
......@@ -45,7 +45,7 @@
<Button type="primary" @click="handleSignUp('formData')" size="large">Sign up</Button>
</div>
</Modal>
<Content class="content">
<Content class="content" style='width:calc( ~"100wh - 200px");height: calc(~"100vh - 50px"); background-color: aliceblue;'>
<router-view v-if="isRouterAlive"/>
</Content>
</Layout>
......@@ -193,11 +193,5 @@ export default {
background-color:rgb(255, 255, 255);
}
.content{
height: calc(~"100vh - 50px");
width: calc( ~"100wh-200px");
background-color: aliceblue;
}
</style>
......@@ -41,6 +41,6 @@ export default {
}
</script>
<style lang="less">
<style lang="less" scoped>
@import './aboutWriter.less';
</style>
\ No newline at end of file
......@@ -81,6 +81,6 @@ export default{
</script>
<style lang="less">
<style lang="less" scoped>
@import './articleDetail.less';
</style>
\ No newline at end of file
......@@ -90,7 +90,7 @@ export default {
}
</script>
<style lang="less">
<style lang="less" scoped>
@import './articleManagement.less';
// @import 'mavon-editor/dist/css/index.css';
</style>
\ No newline at end of file
......@@ -48,6 +48,6 @@ export default {
}
</script>
<style lang="less">
<style lang="less" scoped>
@import './comment-management.less';
</style>
\ No newline at end of file
......@@ -32,6 +32,6 @@ import * as personalCenterRequest from '@/apis/personalCenter.js';
}
</script>
<style lang='less'>
<style lang='less' scoped>
</style>
\ No newline at end of file
......@@ -79,6 +79,6 @@ import Cookie from 'js-cookie';
}
</script>
<style lang='less'>
<style lang='less' scoped>
</style>
\ No newline at end of file
......@@ -39,6 +39,6 @@ import {submitAvatarUrl} from '@/apis/personalCenter';
}
</script>
<style lang='less'>
<style lang='less' scoped>
</style>
\ No newline at end of file
......@@ -74,6 +74,6 @@ import {changePassword} from '@/apis/personalCenter';
}
</script>
<style lang='less'>
<style lang='less' scoped>
@import './updatePassword.less';
</style>
\ No newline at end of file
......@@ -48,7 +48,7 @@ export default {
}
</script>
<style lang="less">
<style lang="less" scoped>
@import './personalCenter.less';
</style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册