Merge pull request #21 from crawlab-team/develop

Develop
This commit is contained in:
暗音
2020-01-23 11:05:20 +08:00
committed by GitHub
3 changed files with 12 additions and 10 deletions

View File

@@ -133,6 +133,8 @@ func main() {
anonymousGroup.POST("/login", routes.Login) // 用户登录
anonymousGroup.PUT("/users", routes.PutUser) // 添加用户
anonymousGroup.GET("/setting", routes.GetSetting) // 获取配置信息
// release版本
anonymousGroup.GET("/version", routes.GetVersion) // 获取发布的版本
}
authGroup := app.Group("/", middlewares.AuthorizationMiddleware())
{
@@ -206,8 +208,6 @@ func main() {
authGroup.DELETE("/users/:id", routes.DeleteUser) // 删除用户
authGroup.GET("/me", routes.GetMe) // 获取自己账户
authGroup.POST("/me", routes.PostMe) // 修改自己账户
// release版本
authGroup.GET("/version", routes.GetVersion) // 获取发布的版本
// 系统
authGroup.GET("/system/deps/:lang", routes.GetAllDepList) // 节点所有第三方依赖列表
authGroup.GET("/system/deps/:lang/:dep_name/json", routes.GetDepJson) // 节点第三方依赖JSON

View File

@@ -34,12 +34,14 @@ export default {
}
},
methods: {},
created () {
this.$store.dispatch('setting/getSetting')
async created () {
await this.$store.dispatch('setting/getSetting')
},
mounted () {
async mounted () {
const res = await this.$request.get('/version')
this.version = res.data.data
sessionStorage.setItem('v', this.version)
window.setUseStats = (value) => {
localStorage.setItem('useStats', value)
document.querySelector('.el-message__closeBtn').click()
if (value === 1) {
this.$st.sendPv('/allow_stats')
@@ -48,6 +50,7 @@ export default {
this.$st.sendPv('/disallow_stats')
this.$st.sendEv('全局', '允许/禁止统计', '禁止')
}
localStorage.setItem('useStats', value)
}
// first-time user

View File

@@ -47,17 +47,16 @@ export default {
},
isCollapse () {
return !this.sidebar.opened
},
version () {
return window.sessionStorage.getItem('v')
}
},
data () {
return {
version: ''
}
},
async created () {
const res = await this.$request.get('/version')
this.version = res.data.data
sessionStorage.setItem('v', this.version)
}
}
</script>