修复xm源验证问题
parent
269b14394d
commit
2a74abdef4
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
- 修复快速切换歌曲时, 会出现播放的歌曲和界面展示的歌曲不一致的问题
|
- 修复快速切换歌曲时, 会出现播放的歌曲和界面展示的歌曲不一致的问题
|
||||||
- 修复了一个由版本更新日志显示导致的潜在远程代码执行攻击漏洞,该漏洞影响v1.6.1及之前的所有版本,请务必更新到最新版本
|
- 修复了一个由版本更新日志显示导致的潜在远程代码执行攻击漏洞,该漏洞影响v1.6.1及之前的所有版本,请务必更新到最新版本
|
||||||
|
- 修复xm搜索源验证问题
|
||||||
|
|
||||||
### 其他
|
### 其他
|
||||||
|
|
||||||
|
|
|
@ -32,22 +32,35 @@ mainHandle(ipcMainWindowNames.handle_xm_verify_open, (event, url) => new Promise
|
||||||
disableHtmlFullscreenWindowResize: true,
|
disableHtmlFullscreenWindowResize: true,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
view.webContents.on('did-finish-load', () => {
|
// view.webContents.on('did-finish-load', () => {
|
||||||
if (/punish\?/.test(view.webContents.getURL())) return
|
// if (/punish\?/.test(view.webContents.getURL())) return
|
||||||
let ses = view.webContents.session
|
// let ses = view.webContents.session
|
||||||
ses.cookies.get({ name: 'x5sec' })
|
// ses.cookies.get({ name: 'x5sec' })
|
||||||
.then(async([x5sec]) => {
|
// .then(async([x5sec]) => {
|
||||||
|
// isActioned = true
|
||||||
|
// await closeView()
|
||||||
|
// if (!x5sec) return reject(new Error('get x5sec failed'))
|
||||||
|
// resolve(x5sec.value)
|
||||||
|
// }).catch(async err => {
|
||||||
|
// isActioned = true
|
||||||
|
// await closeView()
|
||||||
|
// reject(err)
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
view.webContents.session.webRequest.onCompleted({ urls: ['*://www.xiami.com/*'] }, details => {
|
||||||
|
if (/\/_____tmd_____\/slide\?/.test(details.url)) {
|
||||||
|
for (const item of details.responseHeaders['set-cookie']) {
|
||||||
|
if (!/^x5sec=/.test(item)) continue
|
||||||
|
const x5sec = /x5sec=(\w+);.+$/.exec(item)
|
||||||
isActioned = true
|
isActioned = true
|
||||||
await closeView()
|
closeView().finally(() => {
|
||||||
if (!x5sec) return reject(new Error('get x5sec failed'))
|
if (!x5sec) return reject(new Error('get x5sec failed'))
|
||||||
resolve(x5sec.value)
|
resolve(x5sec[1])
|
||||||
}).catch(async err => {
|
})
|
||||||
isActioned = true
|
}
|
||||||
await closeView()
|
}
|
||||||
reject(err)
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
// console.log(url)
|
||||||
global.modules.mainWindow.setBrowserView(view)
|
global.modules.mainWindow.setBrowserView(view)
|
||||||
const windowSizeInfo = getWindowSizeInfo(global.appSetting)
|
const windowSizeInfo = getWindowSizeInfo(global.appSetting)
|
||||||
view.setBounds({ x: (windowSizeInfo.width - 380) / 2, y: ((windowSizeInfo.height - 320 + 52) / 2), width: 380, height: 320 })
|
view.setBounds({ x: (windowSizeInfo.width - 380) / 2, y: ((windowSizeInfo.height - 320 + 52) / 2), width: 380, height: 320 })
|
||||||
|
|
|
@ -96,7 +96,7 @@ export const xmRequest = (path, params = '') => {
|
||||||
if (resp.body.code !== 'SUCCESS' && resp.body.rgv587_flag == 'sm') {
|
if (resp.body.code !== 'SUCCESS' && resp.body.rgv587_flag == 'sm') {
|
||||||
window.globalObj.xm.isShowVerify = true
|
window.globalObj.xm.isShowVerify = true
|
||||||
return wait(300).then(() => {
|
return wait(300).then(() => {
|
||||||
return rendererInvoke(NAMES.mainWindow.handle_xm_verify_open, 'https:' + resp.body.url).then(x5sec => {
|
return rendererInvoke(NAMES.mainWindow.handle_xm_verify_open, /^https:/.test(resp.body.url) ? resp.body.url : 'https:' + resp.body.url).then(x5sec => {
|
||||||
handleSaveToken({ cookies: { x5sec } })
|
handleSaveToken({ cookies: { x5sec } })
|
||||||
// console.log(x5sec)
|
// console.log(x5sec)
|
||||||
window.globalObj.xm.isShowVerify = false
|
window.globalObj.xm.isShowVerify = false
|
||||||
|
|
Loading…
Reference in New Issue