后台管理框架搭建
This commit is contained in:
@@ -51,7 +51,7 @@
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item><el-link :underline="false" @click="goTo(projectUrl)">源码</el-link></el-dropdown-item>
|
||||
<el-dropdown-item> <el-link :underline="false" @click="goTo('https://github.com/'+projectName+'/releases')">官方下载</el-link></el-dropdown-item>
|
||||
<el-dropdown-item v-show="fileAddress!=''"> <el-link @click="Download" :underline="false">快速下载</el-link></el-dropdown-item>
|
||||
<el-dropdown-item v-show="fileAddress!==undefined"> <el-link @click="Download" :underline="false">快速下载</el-link></el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
<el-button v-show="isRouterAlive" v-if="Like===0" @click="addStar" style="height: 60px;width: 150px;margin-left: 10px" icon="el-icon-star-off" type="success">点 赞 {{startNum}}</el-button>
|
||||
@@ -84,8 +84,8 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="font-size: 20px;color: black;font-weight: bold">{{formatNumber(github.starNum)}}</td>
|
||||
<td style="font-size: 20px;color: black;font-weight: bold;">{{briefName}}</td>
|
||||
<td style="font-size: 20px;color: black;font-weight: bold">{{brief}}</td>
|
||||
<td v-if="github.name!==null" style="font-size: 20px;color: black;font-weight: bold;">{{briefName}}</td>
|
||||
<td v-if="github.language!==null" style="font-size: 20px;color: black;font-weight: bold">{{brief}}</td>
|
||||
<td v-if="github.allow_forking" style="font-size: 20px;color: black;font-weight: bold">是</td>
|
||||
<td v-if="!github.allow_forking" style="font-size: 20px;color: black;font-weight: bold">否</td>
|
||||
<td style="font-size: 20px;color: black;font-weight: bold">{{formatNumber(github.subscribers_count)}}</td>
|
||||
@@ -104,6 +104,7 @@
|
||||
<tr>
|
||||
<td style="font-size: 20px;color: black;font-weight: bold">{{github.open_issues_count}}</td>
|
||||
<td v-if="github.organization==='Organization'" style="font-size: 20px;color: black;font-weight: bold">是</td>
|
||||
<td v-else-if="github.organization!=='Organization'" style="font-size: 20px;color: black;font-weight: bold">否</td>
|
||||
<td style="font-size: 20px;color: black;font-weight: bold">{{github.default_branch}}</td>
|
||||
<td style="font-size: 20px;color: black;font-weight: bold">{{formatNumber(github.forks_count)}}</td>
|
||||
<td style="font-size: 20px;color: black;font-weight: bold">{{github.license}}</td>
|
||||
@@ -117,7 +118,7 @@
|
||||
<div>
|
||||
<el-tabs v-model="activeName">
|
||||
<el-tab-pane label="介绍" name="first">
|
||||
<el-tiptap v-html="projectDescription" :readonly="true" :showMenubar="false" :extensions="extensions" />
|
||||
<el-tiptap style="text-align: left;border: 1px solid rgba(150,152,150,0.87)" v-model="projectDescription" :readonly="true" :showMenubar="false" :extensions="extensions" />
|
||||
<div style="display:flex;align-items: center;flex-direction: row;justify-content: space-between">
|
||||
<div style="display: flex;flex-direction: row;flex-wrap: nowrap;align-items: center">
|
||||
<span style="font-size: 14px;margin-top: 10px">收录于: </span><el-tag style="margin-left: 10px;margin-top: 10px" size="medium">第 {{periodicals}} 期</el-tag>
|
||||
@@ -370,7 +371,7 @@ export default {
|
||||
totalStar:3.7,
|
||||
Content:'',
|
||||
imageUrl:'',
|
||||
fileAddress:null,
|
||||
fileAddress:'',
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -378,7 +379,7 @@ export default {
|
||||
this.getLastComment();
|
||||
this.isStart();
|
||||
// this.getUserInfo();
|
||||
|
||||
this.getGithub();
|
||||
},
|
||||
watch: {
|
||||
$route () {
|
||||
@@ -445,6 +446,7 @@ export default {
|
||||
that.fileAddress=res.data.project.fileAddress;
|
||||
// that.userUri=res.data.project.userUri;
|
||||
that.getDetailByGitHub();
|
||||
// that.getGithub();
|
||||
that.changeAvatarByLocal();
|
||||
});
|
||||
},
|
||||
@@ -698,19 +700,25 @@ export default {
|
||||
|
||||
}
|
||||
}).then((res)=>{
|
||||
that.github.starNum=res.data.stargazers_count;
|
||||
that.github.language=res.data.language;
|
||||
that.github.watchers_count=res.data.watchers_count;
|
||||
that.github.subscribers_count=res.data.subscribers_count;
|
||||
that.github.allow_forking=res.data.allow_forking;
|
||||
that.github.open_issues_count=res.data.open_issues_count;
|
||||
that.github.forks_count=res.data.forks_count;
|
||||
that.github.organization=res.data.organization.type;
|
||||
that.github.license=res.data.license.spdx_id;
|
||||
that.github.name=res.data.name;
|
||||
that.github.default_branch=res.data.default_branch;
|
||||
that.github.avatar_url=res.data.owner.avatar_url;
|
||||
that.saveGithubInfo();
|
||||
if(res.data){
|
||||
that.github.starNum=res.data.stargazers_count;
|
||||
that.github.language=res.data.language;
|
||||
that.github.watchers_count=res.data.watchers_count;
|
||||
that.github.subscribers_count=res.data.subscribers_count;
|
||||
that.github.allow_forking=res.data.allow_forking;
|
||||
that.github.open_issues_count=res.data.open_issues_count;
|
||||
that.github.forks_count=res.data.forks_count;
|
||||
that.github.organization=res.data.owner.type;
|
||||
that.github.license=res.data.license.spdx_id;
|
||||
that.github.name=res.data.name;
|
||||
that.github.default_branch=res.data.default_branch;
|
||||
that.github.avatar_url=res.data.owner.avatar_url;
|
||||
that.saveGithubInfo();
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
@@ -756,19 +764,24 @@ export default {
|
||||
},
|
||||
|
||||
changeAvatarByLocal(){
|
||||
var that=this;
|
||||
axios({
|
||||
method: 'post',
|
||||
// 请求的地址
|
||||
url: '/api/retUserAv',
|
||||
// URL 中的查询参数
|
||||
params:{
|
||||
username:this.username,
|
||||
},
|
||||
responseType:'blob'
|
||||
}).then((res)=>{
|
||||
that.imageUrl = window.URL.createObjectURL(res.data)//这里也是关键,调用window的这个方法URL方法
|
||||
})
|
||||
if(this.username!==null){
|
||||
var that=this;
|
||||
axios({
|
||||
method: 'post',
|
||||
// 请求的地址
|
||||
url: '/api/retUserAv',
|
||||
// URL 中的查询参数
|
||||
params:{
|
||||
username:this.username,
|
||||
},
|
||||
responseType:'blob'
|
||||
}).then((res)=>{
|
||||
that.imageUrl = window.URL.createObjectURL(res.data)//这里也是关键,调用window的这个方法URL方法
|
||||
})
|
||||
}else{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
Download(){
|
||||
@@ -790,7 +803,36 @@ export default {
|
||||
// type:"success"
|
||||
// });
|
||||
// })
|
||||
}
|
||||
},
|
||||
|
||||
getGithub(){
|
||||
var that=this;
|
||||
axios({
|
||||
method: 'post',
|
||||
// 请求的地址
|
||||
url: 'http://localhost:8082/helloGithub_war_exploded/returnGithubInfo',
|
||||
// URL 中的查询参数
|
||||
params: {
|
||||
projectId:this.$route.query.id
|
||||
}
|
||||
}).then(function (res) {
|
||||
if(!res.data){
|
||||
return false;
|
||||
}else{
|
||||
that.github.starNum=res.data.starCount;
|
||||
that.github.language=res.data.mainLanguage;
|
||||
that.github.subscribers_count=res.data.subscriber;
|
||||
that.github.open_issues_count=res.data.issues;
|
||||
that.github.forks_count=res.data.forks;
|
||||
that.github.allow_forking=res.data.isActive;
|
||||
that.github.license=res.data.protocol;
|
||||
that.github.name=res.data.name;
|
||||
that.github.default_branch=res.data.defaultBranch;
|
||||
that.github.avatar_url=res.data.avatar;
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
|
Reference in New Issue
Block a user