forked from reruin/sharelist
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
481 additions
and
231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,13 @@ | ||
const decode = require('../utils/format').decode | ||
const parse_path = require('../utils/base').parse_path | ||
|
||
module.exports = async (ctx , next)=>{ | ||
let url = ctx.request.path.substring(1) | ||
if(url){ | ||
let raw = url.split('/') | ||
let paths = [] | ||
for(let i = 0 ; i< raw.length ; i++){ | ||
if( i == 0 || /[^!]$/.test(raw[i-1]) ){ | ||
paths.push(decode(raw[i].replace(/!$/,''))) | ||
} | ||
} | ||
// let paths = raw.filter((i)=>(!/^!/.test(i))) | ||
ctx.paths = paths | ||
ctx.paths_raw = raw | ||
}else{ | ||
ctx.paths = [] | ||
ctx.paths_raw = [] | ||
module.exports = async(ctx, next) => { | ||
if (!ctx.session.access) { | ||
ctx.session.access = new Set() | ||
} | ||
let url = ctx.request.path.substring(1) | ||
let [paths, paths_raw] = parse_path(url) | ||
ctx.paths = paths | ||
ctx.paths_raw = paths_raw | ||
|
||
await next() | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.