Skip to content

Commit

Permalink
Merge pull request #48 from cmux/0.7
Browse files Browse the repository at this point in the history
[koo] fix an issue that cannot save localeId at client-side
  • Loading branch information
Diablohu authored Dec 11, 2018
2 parents 6ef6ac6 + 8ea4701 commit 05ff210
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
5 changes: 5 additions & 0 deletions packages/koot/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.7.8
**2018-12-11**
- 错误修正
- 修复客户端无法保存当前语种ID的问题

## 0.7.7
**2018-12-11**
- 核心
Expand Down
13 changes: 7 additions & 6 deletions packages/koot/i18n/set-cookie.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ module.exports = (localeId, ctx) => {
}

if (__SERVER__) {
// TODO: set cookie on server
// console.log('ctx.host', ctx.host)
// console.log('ctx.hostname', ctx.hostname)
// console.log(process.env.KOOT_I18N_COOKIE_KEY, localeId, { domain: ctx.hostname, ...options })
ctx.cookies.set(process.env.KOOT_I18N_COOKIE_KEY, localeId, {
domain: ctx.hostname,
maxAge: maxDate * 24 * 60 * 60 * 1000,
signed: false,
...options
})
// ctx.cookies.set(process.env.KOOT_I18N_COOKIE_KEY, localeId, {
// domain: ctx.hostname,
// maxAge: maxDate * 24 * 60 * 60 * 1000,
// signed: false,
// ...options
// })
}
}

0 comments on commit 05ff210

Please sign in to comment.