diff --git a/src/assets/json/advance.json b/src/assets/json/advance.json index 28cce77d5..c9c911b0d 100755 --- a/src/assets/json/advance.json +++ b/src/assets/json/advance.json @@ -10,11 +10,14 @@ "184601": "a|10", "188059": "w|23", "220948": "a|10", + "223863": "a|100", "232134": "a|10", "238056": "w|10", + "250878": "a|20", "253163": "a|20", "253879": "w|10", "254471": "a|10", + "254570": "a|50", "258785": "w|10", "269667": "a|20", "270153": "w|5", @@ -26,6 +29,7 @@ "279774": "w|20", "279883": "a|10", "290948": "a|10", + "291899": "a|10", "294833": "w|30", "296358": "a|10", "301523": "a|50", @@ -44,6 +48,7 @@ "345417": "w|10", "350781": "w|10", "357460": "a|18.88", + "358487": "w|10", "371185": "w|15", "383342": "a|10", "385182": "a|66", @@ -56,6 +61,7 @@ "405552": "w|10", "406357": "a|50", "409163": "a|50", + "411820": "a|10", "411833": "a|10", "412584": "a|13", "414834": "w|10", @@ -63,6 +69,7 @@ "418217": "w|100", "422075": "a|18.8", "423724": "a|8.8", + "423792": "w|10", "424259": "a|10", "425035": "w|10", "425086": "a|10", @@ -75,10 +82,12 @@ "443203": "a|10", "444688": "w|20", "444959": "a|5", + "445083": "a|10", "445111": "a|10", "445296": "w|10", "449242": "a|6", "449635": "a|10", + "450682": "a|10", "450979": "a|10", "455696": "a|18", "459488": "a|10", @@ -93,7 +102,7 @@ "474268": "w|30", "477456": 1, "477726": "a|20", - "478048": "w|5", + "478048": "w|20", "478916": "a|5", "481629": "a|11", "485733": "w|10", @@ -118,9 +127,11 @@ "513600": "a|10", "513607": "w|10", "516549": "w|10", + "516608": "a|30", "516643": "w|20", "517918": "w|6", "518693": "a|10", + "518721": "a|13", "519130": "w|15", "519255": "a|10", "519359": "a|10", @@ -128,6 +139,7 @@ "520369": "a|99", "520759": "w|10", "520816": "a|10", + "520921": "w|10", "521403": "a|20", "521701": "w|10", "521871": "w|10", @@ -144,7 +156,8 @@ "527642": "a|23.3", "528559": "w|10", "530761": "a|23", - "531747": "a|10", + "531334": "w|10", + "531747": "w|24", "535493": "a|30", "536381": "a|10", "537230": "w|10", @@ -208,16 +221,20 @@ "563404": "w|2.33", "564374": "w|15", "565238": "w|6", + "565462": "a|10", "565806": "w|10", "567138": "w|10", + "568050": "a|15", "568931": "w|10", "569473": "w|10", "569506": "a|10.66", "569814": "a|20", "570016": "a|10", + "571178": "w|15", "571295": "a|6.66", "571681": "w|10", "572251": "w|10", + "572318": "w|10", "572403": "w|10", "572404": "w|10", "573020": "a|10", @@ -260,6 +277,7 @@ "593226": 1, "593301": "a|10", "595371": "a|10", + "595513": "w|10", "596146": 1, "596483": "a|3", "597187": "a|10", @@ -269,6 +287,7 @@ "598252": "w|30", "599466": "a|5", "599584": "a|11", + "601413": "w|11.11", "601481": "w|10", "603776": "a|20.48", "604980": "w|11", @@ -287,6 +306,8 @@ "612289": "w|20", "612530": "a|10", "612638": "w|10", + "612813": "w|15", + "613496": "w|20", "613885": "w|10", "615400": "w|10", "615515": "a|1", @@ -294,8 +315,10 @@ "616732": "w|20", "617974": 1, "618570": "a|30", + "619160": "a|1", "619426": 1, "619650": 1, + "619734": "a|10", "620049": 1, "620055": "w|10", "620218": "a|10", @@ -313,6 +336,7 @@ "624633": "a|5", "625030": "w|10", "625084": "w|6.66", + "625291": "w|11", "625461": "a|50", "625728": "w|10", "626000": 1, @@ -327,6 +351,7 @@ "633280": "a|10", "635133": "w|6.88", "635761": "w|10", + "635891": "w|15", "636346": "w|5", "637378": "a|10", "637552": "a|25", @@ -361,6 +386,7 @@ "652198": "a|10", "652245": "a|25", "652745": "a|8", + "653058": "a|20", "653298": 1, "654646": 1, "654807": "a|10", @@ -373,6 +399,7 @@ "658057": "w|10", "658306": 1, "658718": "w|30", + "658872": "a|10", "659125": 1, "660289": 1, "660952": "a|11.10", @@ -386,6 +413,7 @@ "665093": "a|10", "665162": "w|15", "665672": "w|15.98", + "666463": "a|10.46", "667809": "w|10", "668771": "w|10", "668928": 1, @@ -394,10 +422,10 @@ "669965": "a|10", "670228": "a|33", "670350": "a|6", - "670928": "a|28", + "670928": "a|48", "671175": "w|10", "671916": "a|7", - "672272": "w|10", + "672272": "w|20", "672545": "a|1", "672826": "w|10", "673013": "w|3", @@ -423,9 +451,11 @@ "679793": "w|13.88", "679806": "w|10", "680101": "a|30", + "680804": "w|23", "681135": "w|30", "681772": "w|10.10", "681828": "a|20", + "681938": "w|10", "682995": "w|5", "683044": "w|10", "683344": "a|10.33", @@ -448,6 +478,7 @@ "689079": "w|10", "689084": "a|10", "689088": "a|5", + "689204": "a|66", "690444": "w|20", "690827": "w|10", "691184": "w|6", @@ -471,12 +502,15 @@ "704559": "a|30", "704599": "w|16.66", "704715": "a|10", + "704939": "w|20", "705034": "a|10", "705163": "w|20", "705678": "a|10", + "706488": "a|18.88", "707114": "a|30", "707335": "w|20", "708199": "w|11", + "708255": "a|16", "709865": "w|10", "710245": "w|10", "710510": "w|10", @@ -486,6 +520,7 @@ "711942": "w|20", "712724": "w|11", "713298": "w|10", + "713925": "a|10", "714185": "w|20", "714950": "w|10", "715925": "w|10", @@ -493,19 +528,24 @@ "717039": "a|12", "717974": "a|10", "718479": "w|5", + "719305": "a|0", + "719308": "a|15", "720730": "a|10", "720817": "w|30", "720821": "a|15", - "721160": "w|8", + "721160": "w|12", "721631": "a|10", "722481": "a|15", + "723138": "a|10", "723286": "w|10", "726178": "a|10", "726197": "w|38", "726565": "a|10", + "728059": "w|10", "730351": "a|10", "731810": "a|15.54", "733347": "a|20", + "733704": "w|30", "734240": "w|10", "736173": "w|10", "736701": "w|10.8", @@ -519,7 +559,9 @@ "744877": "w|20", "746483": "w|10", "746715": "a|30", + "746810": "w|12", "747680": "a|10", + "748436": "a|50", "749177": "a|1", "749421": "a|10", "749635": "a|15", @@ -528,6 +570,7 @@ "751280": "a|10", "751692": "a|10", "752905": "w|10", + "752945": "w|10", "752969": "w|20", "754334": "a|20", "755108": "a|29.99", @@ -543,25 +586,42 @@ "767266": "w|10", "770045": "a|30", "770106": "a|10", + "771336": "w|8", "773542": "a|30", + "773713": "a|10", + "773836": "w|10", "775865": "w|10", "776476": "w|10", "776637": "w|10", "777251": "w|10", + "778519": "w|10", "780110": "w|10", "780546": "a|10", + "781273": "w|10", "781842": "w|22.33", "782605": "w|10", "782853": "w|10", "783139": "w|20", "783589": "w|10", "784788": "a|20", + "785029": "a|10", "786007": "a|10", + "787878": "w|10", "788008": "a|10", "789419": "a|30", "789655": "w|10", "790524": "a|10", + "793994": "w|1", "795536": "a|10", + "795947": "a|15", + "796329": "w|10", + "797282": "w|20", + "800603": "w|10", + "803555": "w|10", + "805982": "w|11", + "809603": "w|30", + "810715": "a|20", + "813821": "a|10", "abness": "a|200", "aeieop": 1, "argonautes": "a|20", @@ -609,7 +669,7 @@ "yyyy52": "w|5", "pereza": "a|8.88", "rasis": "w|25", - "wang2025": "w|5", + "wang2025": "w|6", "wstznqwe": "w|6", "ekibun": "1", "fy939": "1", @@ -626,5 +686,8 @@ "sweetmurph": "a|20", "lhr622": "w|10", "abracadabra": "w|50", - "yyds": "w|30" + "yyds": "w|30", + "ban": "w|10", + "myth333": "w|10", + "ywgs": "a|20" } diff --git a/src/constants/constants/index.ts b/src/constants/constants/index.ts index 487d18615..bffbb698b 100644 --- a/src/constants/constants/index.ts +++ b/src/constants/constants/index.ts @@ -175,12 +175,13 @@ export const GITHUB_RELEASE = `${GITHUB_PROJECT}/releases` export const GITHUB_RELEASE_REPOS = 'https://api.github.com/repos/czy0729/Bangumi/releases' +export const GITHUB_HOST = 'https://gitee.com/a296377710/bangumi-pro' + /** 热数据地址 */ export const GITHUB_DATA = 'https://gitee.com/a296377710/bangumi/raw/master/data.json' /** 高级会员地址 */ -export const GITHUB_ADVANCE = - 'https://gitee.com/a296377710/bangumi/raw/master/advance.json' +export const GITHUB_ADVANCE = `${GITHUB_HOST}/raw/master/advance.json` /** 占位底图 */ export const IMG_EMPTY = { diff --git a/src/screens/login/v2/ds.ts b/src/screens/login/v2/ds.ts index 04e54f4b7..d5ab2291a 100644 --- a/src/screens/login/v2/ds.ts +++ b/src/screens/login/v2/ds.ts @@ -5,6 +5,7 @@ * @Last Modified time: 2023-06-27 10:04:54 */ import { getTimestamp } from '@utils' +import { GITHUB_HOST } from '@constants' export const TITLE = '登录' @@ -13,7 +14,7 @@ export const NAMESPACE = 'LoginV2' export const AUTH_RETRY_COUNT = 4 export const URL_TOURIST = - `https://gitee.com/a296377710/bangumi/raw/master/tourist.json?t=${getTimestamp()}` as const + `${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' diff --git a/src/screens/user/dev/db.ts b/src/screens/user/dev/db.ts index d03fc96f5..c7560f97c 100755 --- a/src/screens/user/dev/db.ts +++ b/src/screens/user/dev/db.ts @@ -8,15 +8,17 @@ import Constants from 'expo-constants' import Crypto from '@utils/crypto' import { xhrCustom as xhr } from '@utils/fetch' import Base64 from '@utils/thirdParty/base64' +import { GITHUB_HOST } from '@constants' const oauthData = Crypto.get( // eslint-disable-next-line max-len 'U2FsdGVkX19fLWKIpcMloDjdAz++NCIuNnc4GAf/tZF9WpcAWWGZaXujErTngZ1aYg487rZ6AAR+ve0ayzlTvw5nl1m4VNVazEzJNFuJCEVYNYCl7UY93qrYaJft7uwzLOAiJyCdFSzgnmJQLKKQ8QZZf2iLaBrwqnginL/lpVY6puBnmBQyKPKT/e+LtNKjjxItXQXbK7eEpcilLK/vmVdWKTUfbaJARriu3zpIw2ARh5C61hZKcerUwzmpaBagv77hPhR0E9JaHP2lVDiE5JcvQ5eDoLGtsDVenRSuS88v1CDjPE3XEM0hm05oUa0AQB0FBKgUayOszrf8NjSSAjJESpSFiikapkYUhz6lYWoYOrx6ZCdgn2U2auwSBp8sJqYY+VeHRSfESxrd9cAgAQJcxMdmbW53OBUn2+Oz1h4=' ) +const [, , , owner, repo] = GITHUB_HOST.split('/') const repoData = { - owner: 'a296377710', - repo: 'bangumi' + owner, + repo } let accessToken = '' diff --git a/src/screens/user/dev/update-advance/index.tsx b/src/screens/user/dev/update-advance/index.tsx index 7c7832a33..7e4792ece 100644 --- a/src/screens/user/dev/update-advance/index.tsx +++ b/src/screens/user/dev/update-advance/index.tsx @@ -16,7 +16,7 @@ import { read, put } from '../db' import { memoStyles } from './styles' function UpdateAdvance({ navigation }: NavigationProps) { - const [show, setShow] = useState(false) + const [show, setShow] = useState(true) const [uid, setUid] = useState('') const [val, setVal] = useState('') const [payType, setPayType] = useState('w') diff --git a/src/screens/user/dev/update-tourist/index.tsx b/src/screens/user/dev/update-tourist/index.tsx index 0c5f115cc..ae3923061 100644 --- a/src/screens/user/dev/update-tourist/index.tsx +++ b/src/screens/user/dev/update-tourist/index.tsx @@ -12,6 +12,7 @@ import { ItemSetting } from '@_' import { _ } from '@stores' import { open, info } from '@utils' import { useObserver } from '@utils/hooks' +import { GITHUB_HOST } from '@constants' import { put } from '../db' import { doLogin, getConfig } from './utils' import { memoStyles } from './styles' @@ -103,9 +104,7 @@ function UpdateTourist() { - open('https://gitee.com/a296377710/bangumi/commits/master/tourist.json') - } + onPress={() => open(`${GITHUB_HOST}/commits/master/tourist.json`)} > diff --git a/src/screens/user/setting/cdn/index.tsx b/src/screens/user/setting/cdn/index.tsx index 3f052c797..a9bc862e0 100644 --- a/src/screens/user/setting/cdn/index.tsx +++ b/src/screens/user/setting/cdn/index.tsx @@ -21,6 +21,7 @@ import { IOS, STORYBOOK } from '@constants' +import DS from '@assets/json/advance.json' import { SettingCDNOrigin, SettingCDNOriginCn } from '@types' import { getShows, getYuqueThumbs } from '../utils' import commonStyles from '../styles' @@ -145,15 +146,34 @@ function CDN({ navigation, filter }) { return } + // 是否达到条件 + let flag = false + + const { myId, myUserId } = userStore + if (myId || myUserId) { + const value = DS[myId] || DS[myUserId] + if (value == 1) { + flag = true + info('你是老打赏用户或特殊关照会员,允许开启') + } else { + const [, amount] = String(value).split('|') + if (Number(amount || 0) >= ADVANCE_CDN) { + flag = true + } + } + } + // 获取历史打赏金额 - const value = await systemStore.fetchAdvanceDetail() - if (value == 1) { - info('你是老打赏用户或特殊关照会员,允许开启') - } else { - const [, amount] = String(value).split('|') - if (Number(amount || 0) < ADVANCE_CDN) { - info(`历史打赏为 ${amount},不足条件 ${ADVANCE_CDN}`) - return + if (!flag) { + const value = await systemStore.fetchAdvanceDetail() + if (value == 1) { + info('你是老打赏用户或特殊关照会员,允许开启') + } else { + const [, amount] = String(value).split('|') + if (Number(amount || 0) < ADVANCE_CDN) { + info(`历史打赏为 ${amount},不足条件 ${ADVANCE_CDN}`) + return + } } } @@ -272,15 +292,34 @@ function CDN({ navigation, filter }) { return } + // 是否达到条件 + let flag = false + + const { myId, myUserId } = userStore + if (myId || myUserId) { + const value = DS[myId] || DS[myUserId] + if (value == 1) { + flag = true + info('你是老打赏用户或特殊关照会员,允许开启') + } else { + const [, amount] = String(value).split('|') + if (Number(amount || 0) >= ADVANCE_CDN) { + flag = true + } + } + } + // 获取历史打赏金额 - const value = await systemStore.fetchAdvanceDetail() - if (value == 1) { - info('你是老打赏用户或特殊关照会员,允许开启') - } else { - const [, amount] = String(value).split('|') - if (Number(amount || 0) < ADVANCE_CDN) { - info(`历史打赏为 ${amount},不足条件 ${ADVANCE_CDN}`) - return + if (!flag) { + const value = await systemStore.fetchAdvanceDetail() + if (value == 1) { + info('你是老打赏用户或特殊关照会员,允许开启') + } else { + const [, amount] = String(value).split('|') + if (Number(amount || 0) < ADVANCE_CDN) { + info(`历史打赏为 ${amount},不足条件 ${ADVANCE_CDN}`) + return + } } } diff --git a/src/screens/user/user-setting/store.ts b/src/screens/user/user-setting/store.ts index 485ada2f5..4130b95b1 100755 --- a/src/screens/user/user-setting/store.ts +++ b/src/screens/user/user-setting/store.ts @@ -10,10 +10,10 @@ import { getTimestamp, HTMLDecode, info, feedback } from '@utils' import store from '@utils/store' import { t } from '@utils/fetch' import { randomAvatars } from '@utils/user-setting' -import { API_SETU } from '@constants' +import { API_SETU, GITHUB_HOST } from '@constants' const namespace = 'ScreenUserSetting' -const onlineBgsUrl = 'https://gitee.com/a296377710/bangumi/raw/master/bg.json' +const onlineBgsUrl = `${GITHUB_HOST}/raw/master/bg.json` const regBg = /\[bg\](.+?)\[\/bg\]/ const regAvatar = /\[avatar\](.+?)\[\/avatar\]/ const regFixed = diff --git a/src/stores/tinygrail/fetch.ts b/src/stores/tinygrail/fetch.ts index a1702816a..c5beaac24 100644 --- a/src/stores/tinygrail/fetch.ts +++ b/src/stores/tinygrail/fetch.ts @@ -41,6 +41,7 @@ import { API_TINYGRAIL_USER_TEMPLE_TOTAL, API_TINYGRAIL_VALHALL_CHARA, API_TINYGRAIL_VALHALL_LIST, + GITHUB_HOST, LIST_EMPTY, TINYGRAIL_ASSETS_LIMIT } from '@constants' @@ -104,8 +105,7 @@ export default class Fetch extends Computed { if (!UserStore.myId) return false try { const { _response } = await xhrCustom({ - // url: 'https://czy0729.github.io/Bangumi/web/advance.json' - url: `https://gitee.com/a296377710/bangumi/raw/master/advance.json?t=${getTimestamp()}` + url: `${GITHUB_HOST}/raw/master/advance.json?t=${getTimestamp()}` }) const advanceUserMap = JSON.parse(_response)