Skip to content

Commit

Permalink
- 移除废弃 db 逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
czy0729 committed Sep 9, 2024
1 parent b523179 commit 92c2691
Show file tree
Hide file tree
Showing 46 changed files with 147 additions and 257 deletions.
5 changes: 1 addition & 4 deletions src/constants/constants/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: czy0729
* @Date: 2024-09-02 11:54:41
* @Last Modified by: czy0729
* @Last Modified time: 2024-09-09 16:35:06
* @Last Modified time: 2024-09-09 20:42:09
*/

/** App ID https://bgm.tv/dev/app */
Expand Down Expand Up @@ -52,6 +52,3 @@ export const GITHUB_RELEASE_REPOS = 'https://api.github.com/repos/czy0729/Bangum

/** @deprecated */
export const GITHUB_HOST = 'https://gitee.com/a296377710/bangumi-pro'

/** @deprecated 高级会员地址 */
export const GITHUB_ADVANCE = `${GITHUB_HOST}/raw/master/advance.json`
4 changes: 2 additions & 2 deletions src/screens/discovery/anime/store/computed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: czy0729
* @Date: 2024-07-25 06:12:20
* @Last Modified by: czy0729
* @Last Modified time: 2024-07-25 07:00:42
* @Last Modified time: 2024-09-09 20:37:09
*/
import { computed } from 'mobx'
import { collectionStore, otaStore, systemStore } from '@stores'
Expand Down Expand Up @@ -32,7 +32,7 @@ export default class Computed extends State {
}

if (!systemStore.advance) {
list = list.filter((item, index) => index < ADVANCE_LIMIT)
list = list.filter((_item, index) => index < ADVANCE_LIMIT)
}

return list
Expand Down
4 changes: 2 additions & 2 deletions src/screens/discovery/game/store/computed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: czy0729
* @Date: 2024-07-25 20:31:00
* @Last Modified by: czy0729
* @Last Modified time: 2024-07-25 21:23:12
* @Last Modified time: 2024-09-09 20:37:04
*/
import { computed } from 'mobx'
import { collectionStore, otaStore, systemStore } from '@stores'
Expand Down Expand Up @@ -32,7 +32,7 @@ export default class Computed extends State {
}

if (!systemStore.advance) {
list = list.filter((item, index) => index < ADVANCE_LIMIT)
list = list.filter((_item, index) => index < ADVANCE_LIMIT)
}

return list
Expand Down
4 changes: 2 additions & 2 deletions src/screens/discovery/hentai/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @Author: czy0729
* @Date: 2019-06-22 15:38:18
* @Last Modified by: czy0729
* @Last Modified time: 2023-12-17 08:32:12
* @Last Modified time: 2024-09-09 20:37:00
*/
import { computed, observable } from 'mobx'
import { collectionStore, otaStore, systemStore, userStore } from '@stores'
Expand Down Expand Up @@ -90,7 +90,7 @@ export default class ScreenHentai extends store<typeof STATE> {
}

if (!systemStore.advance) {
list = list.filter((item, index) => index < ADVANCE_LIMIT)
list = list.filter((_item, index) => index < ADVANCE_LIMIT)
}

return list
Expand Down
4 changes: 2 additions & 2 deletions src/screens/discovery/manga/store/computed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: czy0729
* @Date: 2024-07-26 05:07:29
* @Last Modified by: czy0729
* @Last Modified time: 2024-07-26 05:18:04
* @Last Modified time: 2024-09-09 20:36:10
*/
import { computed } from 'mobx'
import { collectionStore, otaStore, systemStore } from '@stores'
Expand Down Expand Up @@ -32,7 +32,7 @@ export default class Computed extends State {
}

if (!systemStore.advance) {
list = list.filter((item, index) => index < ADVANCE_LIMIT)
list = list.filter((_item, index) => index < ADVANCE_LIMIT)
}

return list
Expand Down
4 changes: 2 additions & 2 deletions src/screens/discovery/nsfw/store/computed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: czy0729
* @Date: 2024-07-20 10:35:12
* @Last Modified by: czy0729
* @Last Modified time: 2024-07-20 11:23:13
* @Last Modified time: 2024-09-09 20:36:04
*/
import { computed } from 'mobx'
import { collectionStore, otaStore, systemStore } from '@stores'
Expand Down Expand Up @@ -33,7 +33,7 @@ export default class Computed extends State {
}

if (!systemStore.advance) {
list = list.filter((item, index) => index < ADVANCE_LIMIT)
list = list.filter((_item, index) => index < ADVANCE_LIMIT)
}

return list
Expand Down
4 changes: 2 additions & 2 deletions src/screens/discovery/wenku/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: czy0729
* @Date: 2020-09-03 10:44:02
* @Last Modified by: czy0729
* @Last Modified time: 2024-07-26 13:31:42
* @Last Modified time: 2024-09-09 20:35:55
*/
import { computed, observable } from 'mobx'
import { collectionStore, otaStore, systemStore } from '@stores'
Expand Down Expand Up @@ -74,7 +74,7 @@ export default class ScreenWenku extends store<typeof STATE> {
}

if (!systemStore.advance) {
list = list.filter((item, index) => index < ADVANCE_LIMIT)
list = list.filter((_item, index) => index < ADVANCE_LIMIT)
}

return list
Expand Down
8 changes: 1 addition & 7 deletions src/screens/login/v2/ds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,13 @@
* @Author: czy0729
* @Date: 2023-06-27 10:01:16
* @Last Modified by: czy0729
* @Last Modified time: 2023-06-27 10:04:54
* @Last Modified time: 2024-09-09 21:09:41
*/
import { getTimestamp } from '@utils'
import { GITHUB_HOST } from '@constants'

export const TITLE = '登录'

export const NAMESPACE = 'LoginV2'

export const AUTH_RETRY_COUNT = 4

export const URL_TOURIST =
`${GITHUB_HOST}/raw/master/tourist.json?t=${getTimestamp()}` as const

export const UA_EKIBUN_BANGUMI_APP =
'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Mobile Safari/537.36'
12 changes: 5 additions & 7 deletions src/screens/login/v2/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: czy0729
* @Date: 2019-06-30 15:48:46
* @Last Modified by: czy0729
* @Last Modified time: 2024-09-02 15:56:50
* @Last Modified time: 2024-09-09 21:09:31
*/
import React from 'react'
import { View } from 'react-native'
Expand All @@ -22,7 +22,8 @@ import {
urlStringify
} from '@utils'
import { ob } from '@utils/decorators'
import { hm, queue, t, xhrCustom } from '@utils/fetch'
import { hm, queue, t } from '@utils/fetch'
import { get } from '@utils/kv'
import axios from '@utils/thirdParty/axios'
import {
APP_ID,
Expand All @@ -38,7 +39,7 @@ import { HOST_PROXY } from '@/config'
import { Navigation } from '@types'
import Form from './form'
import Preview from './preview'
import { AUTH_RETRY_COUNT, NAMESPACE, UA_EKIBUN_BANGUMI_APP, URL_TOURIST } from './ds'
import { AUTH_RETRY_COUNT, NAMESPACE, UA_EKIBUN_BANGUMI_APP } from './ds'
import { memoStyles } from './styles'

/** 账号密码登录 */
Expand Down Expand Up @@ -104,10 +105,7 @@ class LoginV2 extends React.Component<{
try {
info('正在从github获取游客cookie...')

const { _response } = await xhrCustom({
url: URL_TOURIST
})
const { accessToken, userCookie } = JSON.parse(_response)
const { accessToken, userCookie } = await get('tourist')
userStore.updateAccessToken(accessToken)

const { navigation } = this.props
Expand Down
12 changes: 5 additions & 7 deletions src/screens/tinygrail/advance-ask/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* @Author: czy0729
* @Date: 2020-01-08 11:42:58
* @Last Modified by: czy0729
* @Last Modified time: 2022-11-08 05:47:31
* @Last Modified time: 2024-09-09 20:31:20
*/
import { observable, computed } from 'mobx'
import { tinygrailStore, userStore } from '@stores'
import { computed, observable } from 'mobx'
import { systemStore, tinygrailStore, userStore } from '@stores'
import { getTimestamp, info } from '@utils'
import store from '@utils/store'
import { DEV } from '@constants'
Expand Down Expand Up @@ -50,7 +50,7 @@ export default class ScreenTinygrailAdvanceAsk extends store {
}

@computed get advance() {
return tinygrailStore.advance
return systemStore.advance
}

@computed get advanceList() {
Expand All @@ -76,9 +76,7 @@ export default class ScreenTinygrailAdvanceAsk extends store {
@computed get levelMap() {
const { list } = this.advanceList
const data = {}
list.forEach(item =>
data[item.level] ? (data[item.level] += 1) : (data[item.level] = 1)
)
list.forEach(item => (data[item.level] ? (data[item.level] += 1) : (data[item.level] = 1)))
return data
}

Expand Down
14 changes: 6 additions & 8 deletions src/screens/tinygrail/advance-auction/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
* @Author: czy0729
* @Date: 2020-01-09 19:43:29
* @Last Modified by: czy0729
* @Last Modified time: 2022-11-08 05:56:01
* @Last Modified time: 2024-09-09 20:27:32
*/
import { observable, computed } from 'mobx'
import { tinygrailStore, userStore } from '@stores'
import { computed, observable } from 'mobx'
import { systemStore, tinygrailStore, userStore } from '@stores'
import { getTimestamp, info } from '@utils'
import store from '@utils/store'
import { DEV } from '@constants'
import { levelList, sortList, SORT_GF } from '@tinygrail/_/utils'
import { levelList, SORT_GF, sortList } from '@tinygrail/_/utils'

export const sortDS = [SORT_GF] as const

Expand Down Expand Up @@ -62,7 +62,7 @@ export default class ScreenTinygrailAdvanceAuction extends store {
}

@computed get advance() {
return tinygrailStore.advance
return systemStore.advance
}

@computed get advanceAuctionList() {
Expand Down Expand Up @@ -95,9 +95,7 @@ export default class ScreenTinygrailAdvanceAuction extends store {
@computed get levelMap() {
const { list } = this.advanceAuctionList
const data = {}
list.forEach(item =>
data[item.level] ? (data[item.level] += 1) : (data[item.level] = 1)
)
list.forEach(item => (data[item.level] ? (data[item.level] += 1) : (data[item.level] = 1)))
return data
}

Expand Down
14 changes: 6 additions & 8 deletions src/screens/tinygrail/advance-auction2/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
* @Author: czy0729
* @Date: 2020-01-09 19:43:29
* @Last Modified by: czy0729
* @Last Modified time: 2022-11-08 06:01:40
* @Last Modified time: 2024-09-09 20:27:12
*/
import { observable, computed } from 'mobx'
import { tinygrailStore, userStore } from '@stores'
import { computed, observable } from 'mobx'
import { systemStore, tinygrailStore, userStore } from '@stores'
import { getTimestamp, info } from '@utils'
import store from '@utils/store'
import { DEV } from '@constants'
import { levelList, sortList, SORT_GF } from '@tinygrail/_/utils'
import { levelList, SORT_GF, sortList } from '@tinygrail/_/utils'

export const sortDS = [SORT_GF] as const

Expand Down Expand Up @@ -64,7 +64,7 @@ export default class ScreenTinygrailAdvanceAuction2 extends store {
}

@computed get advance() {
return tinygrailStore.advance
return systemStore.advance
}

@computed get advanceAuctionList() {
Expand Down Expand Up @@ -97,9 +97,7 @@ export default class ScreenTinygrailAdvanceAuction2 extends store {
@computed get levelMap() {
const { list } = this.advanceAuctionList
const data = {}
list.forEach(item =>
data[item.level] ? (data[item.level] += 1) : (data[item.level] = 1)
)
list.forEach(item => (data[item.level] ? (data[item.level] += 1) : (data[item.level] = 1)))
return data
}

Expand Down
12 changes: 5 additions & 7 deletions src/screens/tinygrail/advance-bid/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* @Author: czy0729
* @Date: 2020-01-08 11:42:58
* @Last Modified by: czy0729
* @Last Modified time: 2022-11-08 06:07:27
* @Last Modified time: 2024-09-09 20:26:29
*/
import { observable, computed } from 'mobx'
import { tinygrailStore, userStore } from '@stores'
import { computed, observable } from 'mobx'
import { systemStore, tinygrailStore, userStore } from '@stores'
import { getTimestamp, info } from '@utils'
import store from '@utils/store'
import { DEV } from '@constants'
Expand Down Expand Up @@ -50,7 +50,7 @@ export default class ScreenTinygrailAdvanceBid extends store {
}

@computed get advance() {
return tinygrailStore.advance
return systemStore.advance
}

@computed get advanceBidList() {
Expand All @@ -76,9 +76,7 @@ export default class ScreenTinygrailAdvanceBid extends store {
@computed get levelMap() {
const { list } = this.advanceBidList
const data = {}
list.forEach(item =>
data[item.level] ? (data[item.level] += 1) : (data[item.level] = 1)
)
list.forEach(item => (data[item.level] ? (data[item.level] += 1) : (data[item.level] = 1)))
return data
}

Expand Down
6 changes: 3 additions & 3 deletions src/screens/tinygrail/advance-sacrifice/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* @Author: czy0729
* @Date: 2020-01-25 20:20:06
* @Last Modified by: czy0729
* @Last Modified time: 2022-11-08 06:11:58
* @Last Modified time: 2024-09-09 20:26:09
*/
import { computed } from 'mobx'
import { tinygrailStore, userStore } from '@stores'
import { systemStore, tinygrailStore, userStore } from '@stores'
import { getTimestamp, info } from '@utils'
import store from '@utils/store'
import { DEV } from '@constants'
Expand Down Expand Up @@ -40,7 +40,7 @@ export default class ScreenTinygrailAdvanceAuction extends store {

// -------------------- get --------------------
@computed get advance() {
return tinygrailStore.advance
return systemStore.advance
}

@computed get advanceSacrificeList() {
Expand Down
12 changes: 5 additions & 7 deletions src/screens/tinygrail/advance-state/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* @Author: czy0729
* @Date: 2021-03-14 18:00:02
* @Last Modified by: czy0729
* @Last Modified time: 2022-11-08 06:23:46
* @Last Modified time: 2024-09-09 20:25:38
*/
import { observable, computed } from 'mobx'
import { tinygrailStore, userStore } from '@stores'
import { computed, observable } from 'mobx'
import { systemStore, tinygrailStore, userStore } from '@stores'
import { getTimestamp, info } from '@utils'
import store from '@utils/store'
import { DEV } from '@constants'
Expand Down Expand Up @@ -50,7 +50,7 @@ export default class ScreenTinygrailAdvanceState extends store {
}

@computed get advance() {
return tinygrailStore.advance
return systemStore.advance
}

@computed get advanceState() {
Expand All @@ -76,9 +76,7 @@ export default class ScreenTinygrailAdvanceState extends store {
@computed get levelMap() {
const { list } = this.advanceState
const data = {}
list.forEach(item =>
data[item.level] ? (data[item.level] += 1) : (data[item.level] = 1)
)
list.forEach(item => (data[item.level] ? (data[item.level] += 1) : (data[item.level] = 1)))
return data
}

Expand Down
Loading

0 comments on commit 92c2691

Please sign in to comment.