mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-22 17:31:03 +01:00
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user