feat: 支持二维码登录 (#1443)

* fix: 使用replaceAll和正则来替换HTTPOnly

* feat: 支持二维码登录

* fix: 不使用replaceAll

* refactor: 使用react-query重写二维码登录

* refactor: 用useMemo来计算 qrCodeUrl

* update

* update

* update

* update
This commit is contained in:
BakerBunker 2022-03-27 16:04:09 +08:00 committed by GitHub
parent 9f890072d3
commit 4d7bc14827
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 86 additions and 27 deletions

View file

@ -1,7 +1,7 @@
import Cookies from 'js-cookie'
export function setCookies(string: string) {
const cookies = string.replace('HTTPOnly', '').split(';;')
const cookies = string.replace(/;.*?HTTPOnly.*?;/g, ';;').split(';;')
cookies.map(cookie => {
const cookieKeyValue = cookie.split(';')[0].split('=')
const [key, value] = cookieKeyValue