提交 6c095e44 编写于 作者: AndroidLeaves's avatar AndroidLeaves

update

上级 db8bd0ca
......@@ -27,6 +27,7 @@ const { BaseWidget } = require(dependencyFileName);
class Widget extends BaseWidget {
defaultPreference = {
version: 20221212,
domain: 'https://tophub.today',
hotban: [{ title: '微博 · 热搜榜', link: 'https://tophub.today/n/KqndgxeLl9' }],
weiboOpenOptions: [
......@@ -37,11 +38,10 @@ class Widget extends BaseWidget {
// --------------------------
// 网络请求头
phoneHeaders: [
{ "user-agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1" },
{ "user-agent": "Mozilla/5.0 (Linux; Android 9; VOG-AL10 Build/HUAWEIVOG-AL10; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 Mobile Safari/537.36 T7/12.5 SP-engine/2.26.0 baiduboxapp/12.5.1.11 (Baidu; P1 9) NABar/1.0" },
{ "user-agent": "Mozilla/5.0 (Linux; U; Android 10; zh-CN; HMA-AL00 Build/HUAWEIHMA-AL00) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/78.0.3904.108 UCBrowser/13.1.9.1099 Mobile Safari/537.36" },
{ "user-agent": "Mozilla/5.0 (Linux; Android 10; SM-G9750 Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 COVC/045429 Mobile Safari/537.36 MQQBrowser/10.9" },
{ "user-agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 12_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.18(0x17001231) NetType/4G Language/zh_CN" },
{
"user-agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 16_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15E148 Safari/604.1",
"referer": "https://tophub.today/",
},
],
// --------------------------
titleFontSize: 16,
......@@ -553,8 +553,7 @@ class Widget extends BaseWidget {
const defaultHotArr = this.defaultPreference.hotban;
const cacheHotStr = this.useFileManager().readStringCache('hotban');
const hotbanArr = cacheHotStr ? JSON.parse(cacheHotStr) : defaultHotArr;
const index = this.carouselIndex('HotbanRandom', hotbanArr.length);
console.log(`provideWidget->index:${index}, ${hotbanArr.length}`);
const index = this.carouselIndex(`HotbanRandom${this.defaultPreference.version}`, hotbanArr.length);
const response = await this.loadHotBanRES(hotbanArr[index].link);
// 数据
const { hotTitle = '', logoUrl = '', linkArr = [], titleArr = [] } = response;
......
......@@ -8,7 +8,7 @@
*/
// 当前环境版本号
const VERSION = 20221211
const VERSION = 20221212
// 组件配置文件名
const settingConfigName = 'settings.json';
// 组件默认配置
......@@ -317,7 +317,7 @@ class BaseWidget {
let fontSize = defaultFontSize;
if (textLength >= startLength) {
let count = textLength - startLength;
let loopSize = Math.floor(count / 2.0);
let loopSize = Math.round(count / 2.0);
fontSize -= loopSize;
fontSize = fontSize < 6 ? 6 : fontSize;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册