Merge pull request #991 from ramiresviana/small-fixes
This commit is contained in:
commit
d6d47bbd6b
|
@ -132,7 +132,7 @@ export default {
|
|||
return
|
||||
}
|
||||
|
||||
if (event.shiftKey) {
|
||||
if (event.shiftKey && this.selected.length > 0) {
|
||||
let fi = 0
|
||||
let la = 0
|
||||
|
||||
|
@ -145,8 +145,10 @@ export default {
|
|||
}
|
||||
|
||||
for (; fi <= la; fi++) {
|
||||
if (this.$store.state.selected.indexOf(fi) == -1) {
|
||||
this.addSelected(fi)
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
|
|
@ -12,10 +12,6 @@ export function parseToken (token) {
|
|||
|
||||
const data = JSON.parse(Base64.decode(parts[1]))
|
||||
|
||||
if (Math.round(new Date().getTime() / 1000) > data.exp) {
|
||||
throw new Error('token expired')
|
||||
}
|
||||
|
||||
localStorage.setItem('jwt', token)
|
||||
store.commit('setJWT', token)
|
||||
store.commit('setUser', data.user)
|
||||
|
|
|
@ -93,6 +93,11 @@ var resourcePostPutHandler = withUser(func(w http.ResponseWriter, r *http.Reques
|
|||
}
|
||||
}
|
||||
|
||||
action := "upload"
|
||||
if r.Method == http.MethodPut {
|
||||
action = "save"
|
||||
}
|
||||
|
||||
err := d.RunHook(func() error {
|
||||
dir, _ := filepath.Split(r.URL.Path)
|
||||
err := d.user.Fs.MkdirAll(dir, 0775)
|
||||
|
@ -120,7 +125,7 @@ var resourcePostPutHandler = withUser(func(w http.ResponseWriter, r *http.Reques
|
|||
etag := fmt.Sprintf(`"%x%x"`, info.ModTime().UnixNano(), info.Size())
|
||||
w.Header().Set("ETag", etag)
|
||||
return nil
|
||||
}, "upload", r.URL.Path, "", d.user)
|
||||
}, action, r.URL.Path, "", d.user)
|
||||
|
||||
return errToStatus(err), err
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue