Support running in subdirectory with base_path config

This commit is contained in:
Toby Zerner
2015-08-13 12:58:59 +09:30
parent aec83b295a
commit 9c7fab5d8c
5 changed files with 13 additions and 5 deletions

View File

@ -254,8 +254,9 @@ export default class App {
route(name, params = {}) {
const url = this.routes[name].path.replace(/:([^\/]+)/g, (m, key) => extract(params, key));
const queryString = m.route.buildQueryString(params);
const prefix = m.route.mode === 'pathname' ? app.forum.attribute('basePath') : '';
return url + (queryString ? '?' + queryString : '');
return prefix + url + (queryString ? '?' + queryString : '');
}
/**