首页更新
This commit is contained in:
@@ -367,11 +367,12 @@ export default {
|
||||
|
||||
// 方法
|
||||
submitForm(formName) {
|
||||
var _this=this;
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
//存入cookie
|
||||
// this.setCookie(this.ruleForm.username, this.ruleForm.password, 7); //保存7天
|
||||
this.$cookie.set('username',this.ruleForm.username,7);
|
||||
|
||||
|
||||
// } else {
|
||||
// this.clearCookie();
|
||||
@@ -396,6 +397,7 @@ export default {
|
||||
// type: 'success'
|
||||
// });
|
||||
if (res.data.code === 200) {
|
||||
_this.$cookie.set('username',_this.ruleForm.username,7);
|
||||
Vue.prototype.$notify({
|
||||
title: '成功',
|
||||
message: ('i', {style: 'color: teal'}, res.data.msg),
|
||||
|
@@ -9,13 +9,14 @@
|
||||
style="padding-top: 0"
|
||||
v-model="visible"
|
||||
>
|
||||
<div class="search-content" v-show="this.$cookie.get('username')!=null">
|
||||
<div class="search-his" v-show="historySearch.length!=null">
|
||||
<div class="search-content">
|
||||
<div class="search-his">
|
||||
<div>
|
||||
<span class="title">搜索历史</span>
|
||||
<span class="clear" @click="clearHistory"><i class="el-icon-circle-close"></i>清空</span>
|
||||
<span class="clear" @click="clearHistory" v-show="this.$cookie.get('username')!=null"><i class="el-icon-circle-close"></i>清空</span>
|
||||
</div>
|
||||
<el-tag
|
||||
<div v-show="this.$cookie.get('username')!=null">
|
||||
<el-tag
|
||||
v-for="(tag,index) in historySearch"
|
||||
:key="index"
|
||||
size="small"
|
||||
@@ -23,9 +24,14 @@
|
||||
@close="handleClose(tag)"
|
||||
style="margin-right: 10px; margin-top: 10px; cursor: pointer"
|
||||
@click="handleSearch(tag)"
|
||||
>
|
||||
{{ tag }}
|
||||
</el-tag>
|
||||
>
|
||||
{{ tag }}
|
||||
</el-tag>
|
||||
</div>
|
||||
<div v-show="this.$cookie.get('username')==null">
|
||||
<span style="color: #9ca3af;font-size: 15px">你还没有登录哦~</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -56,7 +62,7 @@ export default {
|
||||
isMouseOver: false,
|
||||
search: '',
|
||||
tipsWord: '',
|
||||
historySearch: [],
|
||||
historySearch: null,
|
||||
items: [
|
||||
]
|
||||
}
|
||||
@@ -114,34 +120,34 @@ export default {
|
||||
});
|
||||
},
|
||||
handleClose(tag){
|
||||
var that=this;
|
||||
axios({
|
||||
method: 'post',
|
||||
// 请求的地址
|
||||
url: 'http://localhost:8082/helloGithub_war_exploded/deletelabel',
|
||||
// URL 中的查询参数
|
||||
params: {
|
||||
tag:tag+';'
|
||||
tag:tag
|
||||
}
|
||||
}).then((res)=>{
|
||||
if(res.date.code===200){
|
||||
that.$message({
|
||||
showClose: true,
|
||||
message: res.date.msg,
|
||||
type: 'success'
|
||||
if(res.data.code===200){
|
||||
Vue.prototype.$notify({
|
||||
title: '成功',
|
||||
message: ('i', {style: 'color: teal'}, res.data.msg),
|
||||
type: 'success',
|
||||
offset: 50
|
||||
});
|
||||
}else{
|
||||
that.$message({
|
||||
showClose: true,
|
||||
message: res.date.msg,
|
||||
type: 'error'
|
||||
Vue.prototype.$notify.error({
|
||||
title: '错误',
|
||||
message: res.data.msg,
|
||||
offset: 50
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.tipsWord = "helloGithub";
|
||||
this.tipsWord = "搜索开源项目";
|
||||
this.gethistorySearch();
|
||||
}
|
||||
};
|
||||
|
@@ -2,7 +2,7 @@
|
||||
<div style="display: flex;flex-direction: column;flex-wrap: nowrap" v-show="this.$cookie.get('username')!=null">
|
||||
<div style="display: flex;flex-direction: row;align-items: center;width: 11vw;justify-content: space-between">
|
||||
<div style="display: flex;flex-direction: row;align-items: center">
|
||||
<el-avatar shape="square" style=" box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04)" size="large" src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"></el-avatar>
|
||||
<el-avatar shape="square" style=" background-color: #59A3A4;box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04)" size="large">{{this.$cookie.get('username')}}</el-avatar>
|
||||
<div style="margin-left: 5px;display: flex;flex-direction: column;justify-content: space-evenly">
|
||||
<span style="font-weight: bold">{{this.$cookie.get('username')}}</span>
|
||||
<span style="font-weight: 800;font-size: 13px;color: #3b82f6">Lv.1</span>
|
||||
@@ -14,14 +14,14 @@
|
||||
</div>
|
||||
<div style="display: flex;flex-direction: row;margin-top: 10px;justify-content: space-between;align-items: center">
|
||||
<span style="font-size: 10px;color: #9ca3af">贡献值</span>
|
||||
<span style="font-weight: bold;color: #59A3A4;font-size: 20px">0/64</span>
|
||||
<span style="font-weight: bold;color: #59A3A4;font-size: 20px">0/100</span>
|
||||
</div>
|
||||
<div style="margin-top: 10px">
|
||||
<el-progress :text-inside="true" :stroke-width="15" :percentage="0"></el-progress>
|
||||
</div>
|
||||
<el-divider></el-divider>
|
||||
<div style="display: flex;align-items: center;justify-content: space-between;flex-direction: row;flex-wrap: nowrap;">
|
||||
<el-link style="color: #9ca3af;font-size: 13px" icon="el-icon-s-custom" class="link">我的主页</el-link>
|
||||
<el-link style="color: #9ca3af;font-size: 13px" icon="el-icon-s-custom" class="link" @click="toUserPage">我的主页</el-link>
|
||||
<el-link style="color: #9ca3af;font-size: 13px" icon="el-icon-switch-button" class="link" @click="signOut">退出登录</el-link>
|
||||
</div>
|
||||
</div>
|
||||
@@ -39,6 +39,9 @@ export default {
|
||||
signOut(){
|
||||
this.$cookie.delete('username');
|
||||
window.location.reload();
|
||||
},
|
||||
toUserPage(){
|
||||
this.$router.push({path:'/UserInfoPage'})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div>
|
||||
<div style="margin-top: 30px">
|
||||
个人主页
|
||||
</div>
|
||||
</template>
|
||||
|
Reference in New Issue
Block a user