feat: login rest
This commit is contained in:
@@ -1,235 +1,3 @@
|
||||
export const MOCK_PLANTS = [
|
||||
{
|
||||
id: '1',
|
||||
name: '龟背竹',
|
||||
images: ['https://images.unsplash.com/photo-1614594975525-e45190c55d0b?w=400', 'https://images.unsplash.com/photo-1459411552884-841db9b3cc2a?w=400'],
|
||||
daysPlanted: 45,
|
||||
adoptionDate: '2025-12-19',
|
||||
location: '客厅窗边',
|
||||
scientificName: 'Monstera deliciosa',
|
||||
family: '天南星科',
|
||||
genus: '龟背竹属',
|
||||
description: '龟背竹叶形奇特,孔裂纹状,极像龟背。茎节粗壮又似罗汉竹,深褐色气生根,纵横交错,形如电线。其叶常年碧绿,极为耐阴,是有名的室内大型盆叶植物。',
|
||||
origin: '墨西哥',
|
||||
difficulty: '⭐️⭐️',
|
||||
toxicity: '汁液微毒',
|
||||
flowerMsg: '健康长寿'
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
name: '多肉拼盘',
|
||||
images: ['https://images.unsplash.com/photo-1459411552884-841db9b3cc2a?w=400', 'https://images.unsplash.com/photo-1599598425947-634fd4b9868f?w=400'],
|
||||
daysPlanted: 120,
|
||||
adoptionDate: '2025-10-05',
|
||||
location: '阳台花架',
|
||||
scientificName: 'Echeveria spp.',
|
||||
family: '景天科',
|
||||
genus: '拟石莲属',
|
||||
description: '多肉植物凭借其肥厚的叶片和多变的形态深受喜爱。它们储水能力强,喜欢阳光充足、通风良好的环境,是非常适合懒人养护的治愈系植物。',
|
||||
origin: '美洲/非洲',
|
||||
difficulty: '⭐️',
|
||||
toxicity: '无毒',
|
||||
flowerMsg: '顽强可爱'
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
name: '虎皮兰',
|
||||
images: ['https://images.unsplash.com/photo-1599598425947-634fd4b9868f?w=400', 'https://images.unsplash.com/photo-1614594975525-e45190c55d0b?w=400'],
|
||||
daysPlanted: 30,
|
||||
adoptionDate: '2026-01-03',
|
||||
location: '书房电脑旁',
|
||||
scientificName: 'Sansevieria trifasciata',
|
||||
family: '百合科',
|
||||
genus: '虎尾兰属',
|
||||
description: '虎皮兰叶片直立,有虎尾状横带斑纹,姿态刚毅,奇特有趣。它对环境的适应能力极强,是公认的空气净化小能手,能昼夜释放氧气。',
|
||||
origin: '西非',
|
||||
difficulty: '⭐️',
|
||||
toxicity: '汁液微毒',
|
||||
flowerMsg: '坚定刚毅'
|
||||
},
|
||||
{
|
||||
id: '4',
|
||||
name: '绿萝',
|
||||
images: ['monstera_plant_1769757312755.png'],
|
||||
daysPlanted: 10,
|
||||
adoptionDate: '2026-01-20',
|
||||
location: '浴室',
|
||||
scientificName: 'Epipremnum aureum',
|
||||
family: '天南星科',
|
||||
genus: '麒麟叶属',
|
||||
description: '遇水即活,生命力极其顽强,被称为“生命之花”。',
|
||||
origin: '所罗门群岛',
|
||||
difficulty: '⭐️',
|
||||
toxicity: '汁液微毒',
|
||||
flowerMsg: '守望幸福'
|
||||
},
|
||||
{
|
||||
id: '5',
|
||||
name: '发财树',
|
||||
images: ['succulent_garden_1769757406309.png'],
|
||||
daysPlanted: 200,
|
||||
adoptionDate: '2025-07-15',
|
||||
location: '办公室',
|
||||
scientificName: 'Pachira aquatica',
|
||||
family: '锦葵科',
|
||||
genus: '瓜栗属',
|
||||
description: '株形美观,茎干叶片全年青翠,是十分流行的室内观叶植物。',
|
||||
origin: '中美洲',
|
||||
difficulty: '⭐️⭐️',
|
||||
toxicity: '无毒',
|
||||
flowerMsg: '招财进宝'
|
||||
},
|
||||
{
|
||||
id: '6',
|
||||
name: '琴叶榕',
|
||||
images: ['snake_plant_1769757638773.png'],
|
||||
daysPlanted: 5,
|
||||
adoptionDate: '2026-01-25',
|
||||
location: '客厅角落',
|
||||
scientificName: 'Ficus lyrata',
|
||||
family: '桑科',
|
||||
genus: '榕属',
|
||||
description: '叶片巨大,形似提琴,极具北欧风情。',
|
||||
origin: '西非',
|
||||
difficulty: '⭐️⭐️⭐️',
|
||||
toxicity: '汁液有毒',
|
||||
flowerMsg: '和蔼可亲'
|
||||
},
|
||||
{
|
||||
id: '7',
|
||||
name: '富贵竹',
|
||||
images: ['monstera_plant_1769757312755.png'],
|
||||
daysPlanted: 88,
|
||||
adoptionDate: '2025-11-11',
|
||||
location: '玄关',
|
||||
scientificName: 'Dracaena sanderiana',
|
||||
family: '天门冬科',
|
||||
genus: '龙血树属',
|
||||
description: '象征花开富贵、竹报平安。',
|
||||
origin: '非洲',
|
||||
difficulty: '⭐️',
|
||||
toxicity: '无毒',
|
||||
flowerMsg: '富贵一生'
|
||||
},
|
||||
{
|
||||
id: '8',
|
||||
name: '吊兰',
|
||||
images: ['succulent_garden_1769757406309.png'],
|
||||
daysPlanted: 60,
|
||||
adoptionDate: '2025-12-01',
|
||||
location: '厨房',
|
||||
scientificName: 'Chlorophytum comosum',
|
||||
family: '天门冬科',
|
||||
genus: '吊兰属',
|
||||
description: '空气卫士,能吸收空气中95%的一氧化碳和85%的甲醛。',
|
||||
origin: '南非',
|
||||
difficulty: '⭐️',
|
||||
toxicity: '无毒',
|
||||
flowerMsg: '无奈而又给人希望'
|
||||
},
|
||||
{
|
||||
id: '9',
|
||||
name: '常春藤',
|
||||
images: ['snake_plant_1769757638773.png'],
|
||||
daysPlanted: 150,
|
||||
adoptionDate: '2025-09-01',
|
||||
location: '书架顶部',
|
||||
scientificName: 'Hedera helix',
|
||||
family: '五加科',
|
||||
genus: '常春藤属',
|
||||
description: '叶形优美,四季常青,是垂直绿化的优良植物。',
|
||||
origin: '欧洲',
|
||||
difficulty: '⭐️⭐️',
|
||||
toxicity: '微毒',
|
||||
flowerMsg: '结合的爱'
|
||||
},
|
||||
{
|
||||
id: '10',
|
||||
name: '红掌',
|
||||
images: ['monstera_plant_1769757312755.png'],
|
||||
daysPlanted: 40,
|
||||
adoptionDate: '2025-12-25',
|
||||
location: '茶几',
|
||||
scientificName: 'Anthurium andraeanum',
|
||||
family: '天南星科',
|
||||
genus: '花烛属',
|
||||
description: '花期持久,佛焰苞鲜红亮丽,寓意大展宏图。',
|
||||
origin: '南美洲',
|
||||
difficulty: '⭐️⭐️⭐️',
|
||||
toxicity: '汁液有毒',
|
||||
flowerMsg: '大展宏图'
|
||||
},
|
||||
{
|
||||
id: '11',
|
||||
name: '白掌',
|
||||
images: ['succulent_garden_1769757406309.png'],
|
||||
daysPlanted: 55,
|
||||
adoptionDate: '2025-12-10',
|
||||
location: '卫生间',
|
||||
scientificName: 'Spathiphyllum kochii',
|
||||
family: '天南星科',
|
||||
genus: '白鹤芋属',
|
||||
description: '花叶兼美,清新素雅,能过滤由于氨气和丙酮引起的异味。',
|
||||
origin: '美洲热带',
|
||||
difficulty: '⭐️⭐️',
|
||||
toxicity: '汁液有毒',
|
||||
flowerMsg: '一帆风顺'
|
||||
},
|
||||
{
|
||||
id: '12',
|
||||
name: '橡皮树',
|
||||
images: ['snake_plant_1769757638773.png'],
|
||||
daysPlanted: 300,
|
||||
adoptionDate: '2025-04-10',
|
||||
location: '阳台角',
|
||||
scientificName: 'Ficus elastica',
|
||||
family: '桑科',
|
||||
genus: '榕属',
|
||||
description: '叶片肥厚黑亮,四季常青,气势雄伟。',
|
||||
origin: '印度/马来西亚',
|
||||
difficulty: '⭐️⭐️',
|
||||
toxicity: '汁液有毒',
|
||||
flowerMsg: '稳重诚实',
|
||||
careSchedule: [
|
||||
{ id: '1', taskName: '浇水', frequencyValue: 10, frequencyUnit: 'day' },
|
||||
{ id: '2', taskName: '擦拭叶片', frequencyValue: 2, frequencyUnit: 'week' }
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
export const MOCK_FAVORITES = [
|
||||
{ id: '1', type: 'plant', name: '龟背竹', image: 'monstera_plant_1769757312755.png', meta: '百科 · 天南星科' },
|
||||
{ id: '2', type: 'article', name: '晒晒我的多肉拼盘', image: 'succulent_garden_1769757406309.png', meta: '社区 · 多肉资深玩家' },
|
||||
{ id: '3', type: 'plant', name: '虎皮兰', image: 'snake_plant_1769757638773.png', meta: '百科 · 百合科' },
|
||||
{ id: '4', type: 'article', name: '龟背竹长出了新叶子', image: 'monstera_plant_1769757312755.png', meta: '社区 · 花房姑娘' },
|
||||
];
|
||||
|
||||
export const MOCK_MY_POSTS = [
|
||||
{
|
||||
id: 'p1',
|
||||
content: '终于把这个小角落布置好了,每天下班看到都很开心。🌱 #阳台花园',
|
||||
images: ['monstera_plant_1769757312755.png'],
|
||||
time: '刚刚',
|
||||
likes: 12,
|
||||
comments: 2
|
||||
},
|
||||
{
|
||||
id: 'p2',
|
||||
content: '分享一下我的养护心得,龟背竹真的很好养!',
|
||||
images: ['monstera_plant_1769757312755.png', 'snake_plant_1769757638773.png'],
|
||||
time: '3天前',
|
||||
likes: 45,
|
||||
comments: 8
|
||||
},
|
||||
{
|
||||
id: 'p3',
|
||||
content: '新入手的多肉,大家看看怎么样?',
|
||||
images: ['succulent_garden_1769757406309.png'],
|
||||
time: '2026-01-25',
|
||||
likes: 28,
|
||||
comments: 5
|
||||
}
|
||||
];
|
||||
|
||||
// 预置养护图标 - 模拟从后端加载
|
||||
export const CARE_TASK_ICONS = [
|
||||
@@ -257,339 +25,6 @@ export const MOCK_BADGES = [
|
||||
{ id: 'b6', name: '社交之星', desc: '获得 50 个赞', icon: 'heart', color: '#E91E63', unlocked: false, progress: '42/50' },
|
||||
];
|
||||
|
||||
export const MOCK_TASKS_DATA = [
|
||||
{ id: '1', plantName: '龟背竹', plantImage: 'monstera_plant_1769757312755.png', taskType: 'water', taskIcon: { icon: 'water', color: '#2196F3', bgColor: '#E3F2FD' }, dueDate: '今天', isOverdue: false },
|
||||
{ id: '1-2', plantName: '龟背竹', plantImage: 'monstera_plant_1769757312755.png', taskType: 'fertilize', taskIcon: { icon: 'gift', color: '#8BC34A', bgColor: '#F1F8E9' }, dueDate: '今天', isOverdue: false },
|
||||
{ id: '2', plantName: '虎皮兰', plantImage: 'snake_plant_1769757638773.png', taskType: 'fertilize', taskIcon: { icon: 'gift', color: '#8BC34A', bgColor: '#F1F8E9' }, dueDate: '2天前', isOverdue: true, overdueDays: 2 },
|
||||
{ id: '3', plantName: '多肉拼盘', plantImage: 'succulent_garden_1769757406309.png', taskType: 'repot', taskIcon: { icon: 'home', color: '#9C27B0', bgColor: '#F3E5F5' }, dueDate: '今天', isOverdue: false },
|
||||
{ id: '4', plantName: '天堂鸟', taskType: 'prune', taskIcon: { icon: 'cut', color: '#FF9800', bgColor: '#FFF3E0' }, dueDate: '5天前', isOverdue: true, overdueDays: 5 },
|
||||
{ id: '4-2', plantName: '天堂鸟', taskType: 'water', taskIcon: { icon: 'water', color: '#2196F3', bgColor: '#E3F2FD' }, dueDate: '今天', isOverdue: false },
|
||||
{ id: '5', plantName: '绿萝', plantImage: 'monstera_plant_1769757312755.png', taskType: 'water', taskIcon: { icon: 'water', color: '#2196F3', bgColor: '#E3F2FD' }, dueDate: '今天', isOverdue: false },
|
||||
{ id: '5-2', plantName: '绿萝', plantImage: 'monstera_plant_1769757312755.png', taskType: 'prune', taskIcon: { icon: 'cut', color: '#FF9800', bgColor: '#FFF3E0' }, dueDate: '今天', isOverdue: false },
|
||||
{ id: '6', plantName: '吊兰', plantImage: 'snake_plant_1769757638773.png', taskType: 'water', taskIcon: { icon: 'water', color: '#2196F3', bgColor: '#E3F2FD' }, dueDate: '1天前', isOverdue: true, overdueDays: 1 },
|
||||
{ id: '6-2', plantName: '吊兰', plantImage: 'snake_plant_1769757638773.png', taskType: 'spray', taskIcon: { icon: 'cloud', color: '#03A9F4', bgColor: '#E1F5FE' }, dueDate: '今天', isOverdue: false },
|
||||
{ id: '7', plantName: '仙人掌', plantImage: 'succulent_garden_1769757406309.png', taskType: 'repot', taskIcon: { icon: 'home', color: '#9C27B0', bgColor: '#F3E5F5' }, dueDate: '3天前', isOverdue: true, overdueDays: 3 },
|
||||
{ id: '8', plantName: '发财树', taskType: 'water', taskIcon: { icon: 'water', color: '#2196F3', bgColor: '#E3F2FD' }, dueDate: '今天', isOverdue: false },
|
||||
{ id: '8-2', plantName: '发财树', taskType: 'clean', taskIcon: { icon: 'browse', color: '#607D8B', bgColor: '#ECEFF1' }, dueDate: '今天', isOverdue: false },
|
||||
{ id: '9', plantName: '橡皮树', plantImage: 'monstera_plant_1769757312755.png', taskType: 'sun', taskIcon: { icon: 'sunny', color: '#FFC107', bgColor: '#FFFDE7' }, dueDate: '今天', isOverdue: false },
|
||||
{ id: '10', plantName: '芦荟', plantImage: 'succulent_garden_1769757406309.png', taskType: 'water', taskIcon: { icon: 'water', color: '#2196F3', bgColor: '#E3F2FD' }, dueDate: '2天前', isOverdue: true, overdueDays: 2 },
|
||||
{ id: '10-2', plantName: '芦荟', plantImage: 'succulent_garden_1769757406309.png', taskType: 'rotate', taskIcon: { icon: 'refresh', color: '#00BCD4', bgColor: '#E0F7FA' }, dueDate: '今天', isOverdue: false },
|
||||
{ id: '11', plantName: '文竹', taskType: 'spray', taskIcon: { icon: 'cloud', color: '#03A9F4', bgColor: '#E1F5FE' }, dueDate: '今天', isOverdue: false },
|
||||
{ id: '11-2', plantName: '文竹', taskType: 'prune', taskIcon: { icon: 'cut', color: '#FF9800', bgColor: '#FFF3E0' }, dueDate: '今天', isOverdue: false },
|
||||
{ id: '12', plantName: '常春藤', plantImage: 'snake_plant_1769757638773.png', taskType: 'check', taskIcon: { icon: 'search', color: '#4CAF50', bgColor: '#E8F5E9' }, dueDate: '4天前', isOverdue: true, overdueDays: 4 },
|
||||
];
|
||||
|
||||
|
||||
export const MOCK_POSTS = [
|
||||
{
|
||||
id: '1',
|
||||
user: '花房姑娘',
|
||||
content: '今天天气真好,家里的龟背竹长出了新叶子!🌿 看着它们一点点长大,心里充满了成就感。大家周末都在做什么呢?',
|
||||
images: ['monstera_plant_1769757312755.png', 'succulent_garden_1769757406309.png', 'snake_plant_1769757638773.png'],
|
||||
time: '2小时前',
|
||||
likes: ['植欲生活', '多肉资深玩家', '阳台园艺家'],
|
||||
comments: [
|
||||
{ id: 'c1', user: '植欲生活', content: '新叶子太可爱了!' },
|
||||
{ id: 'c2', user: '多肉资深玩家', content: '我也想养一盆龟背竹了' }
|
||||
]
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
user: '多肉资深玩家',
|
||||
content: '晒晒我的多肉拼盘,是不是很治愈?✨ 最近入坑了好多新品种,完全停不下来。',
|
||||
images: ['succulent_garden_1769757406309.png'],
|
||||
time: '5小时前',
|
||||
likes: ['花房姑娘', 'Alice'],
|
||||
comments: []
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
user: '植欲生活',
|
||||
content: '分享一些养护小知识:虎皮兰真的超级耐旱,半个月浇一次水就足够了。适合懒人养!💧',
|
||||
images: ['snake_plant_1769757638773.png', 'monstera_plant_1769757312755.png'],
|
||||
time: '昨天',
|
||||
likes: ['阳台园艺家'],
|
||||
comments: [
|
||||
{ id: 'c3', user: '新手花农', content: '学到了,谢谢分享!' }
|
||||
]
|
||||
},
|
||||
{
|
||||
id: '4',
|
||||
user: '我的花园',
|
||||
content: '终于把这个小角落布置好了,每天下班看到都很开心。🌱 #阳台花园',
|
||||
images: ['monstera_plant_1769757312755.png'],
|
||||
time: '刚刚',
|
||||
likes: [],
|
||||
comments: []
|
||||
}
|
||||
];
|
||||
|
||||
export const MOCK_WIKI = [
|
||||
{
|
||||
id: '1',
|
||||
name: '龟背竹',
|
||||
scientificName: 'Monstera deliciosa',
|
||||
family: '天南星科',
|
||||
images: ['monstera_plant_1769757312755.png', 'succulent_garden_1769757406309.png'],
|
||||
category: '观叶',
|
||||
tags: ['耐阴', '净化空气', '新手友好'],
|
||||
difficulty: 'Easy',
|
||||
description: '龟背竹是天南星科龟背竹属的多年生常绿灌木,因其叶片形状奇特,裂纹状似龟背而得名。它不仅观赏价值极高,还具有极强的空气净化能力。',
|
||||
origin: '墨西哥及中美洲',
|
||||
toxicity: '汁液有轻微毒性',
|
||||
light: { level: '中等光照', description: '喜欢明亮的散射光,忌强光直射。夏季需遮阴。' },
|
||||
water: { frequency: '每周1-2次', description: '保持土壤湿润但不过湿。夏季需经常向叶面喷水增加湿度。' },
|
||||
temperature: '20-30℃',
|
||||
humidity: '60%-80%',
|
||||
soil: '疏松肥沃、排水良好的微酸性土壤。',
|
||||
fertilizer: '生长季每半月施一次稀薄液肥。',
|
||||
commonPests: ['介壳虫', '红蜘蛛'],
|
||||
careTips: ['定期擦拭叶片', '不要轻易剪除气根', '保持环境通风']
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
name: '虎皮兰',
|
||||
scientificName: 'Sansevieria trifasciata',
|
||||
family: '百合科',
|
||||
images: ['snake_plant_1769757638773.png'],
|
||||
category: '观叶',
|
||||
tags: ['耐旱', '吸甲醛', '卧室绿植'],
|
||||
difficulty: 'Easy',
|
||||
description: '虎皮兰生命力极强,对环境适应性好,能释放大量氧气,尤其是在夜间。非常适合摆放在卧室或客厅。',
|
||||
origin: '西非',
|
||||
toxicity: '微毒,避免误食',
|
||||
light: { level: '低至高光照', description: '对光照适应性强,耐阴,也耐强光。长期在阴暗处斑纹会变淡。' },
|
||||
water: { frequency: '每2-3周1次', description: '极其耐旱,宁干勿湿。盆土完全干透再浇水。' },
|
||||
temperature: '18-30℃',
|
||||
humidity: '适应性强,耐干燥',
|
||||
soil: '透气性极佳的沙质土壤。',
|
||||
fertilizer: '生长季每月施一次复合肥即可。',
|
||||
commonPests: ['炭疽病', '烂根'],
|
||||
careTips: ['最怕积水', '建议用浅盆种植', '保持叶面清洁']
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
name: '月季',
|
||||
scientificName: 'Rosa chinensis',
|
||||
family: '蔷薇科',
|
||||
images: ['garden_banner.png'],
|
||||
category: '观花',
|
||||
tags: ['花期长', '芳香', '喜阳'],
|
||||
difficulty: 'Medium',
|
||||
description: '月季花被称为"花中皇后",四季开花,花色丰富,芳香宜人。是中国十大名花之一。',
|
||||
origin: '中国',
|
||||
toxicity: '无毒',
|
||||
light: { level: '高光照', description: '喜阳光充足,每天至少需要6小时直射光。光照不足会导致开花少。' },
|
||||
water: { frequency: '见干见湿', description: '生长期保持土壤湿润,不可积水。夏季早晚各浇一次。' },
|
||||
temperature: '15-26℃',
|
||||
humidity: '喜通风良好环境',
|
||||
soil: '富含有机质、排水良好的微酸性土壤。',
|
||||
fertilizer: '喜肥,勤施薄肥。花期需追肥。',
|
||||
commonPests: ['蚜虫', '黑斑病', '白粉病'],
|
||||
careTips: ['花后及时剪去残花', '注意通风预防病害', '冬季进行重剪']
|
||||
},
|
||||
{
|
||||
id: '4',
|
||||
name: '多肉拼盘',
|
||||
scientificName: 'Echeveria spp.',
|
||||
family: '景天科',
|
||||
images: ['succulent_garden_1769757406309.png'],
|
||||
category: '多肉',
|
||||
tags: ['可爱', '治愈系', '懒人植物'],
|
||||
difficulty: 'Easy',
|
||||
description: '多肉植物形态各异,叶片肥厚多汁,适合组合盆栽。',
|
||||
origin: '美洲'
|
||||
},
|
||||
{
|
||||
id: '5',
|
||||
name: '发财树',
|
||||
scientificName: 'Pachira aquatica',
|
||||
family: '锦葵科',
|
||||
images: ['monstera_plant_1769757312755.png'],
|
||||
category: '观叶',
|
||||
tags: ['寓意好', '耐旱', '办公桌'],
|
||||
difficulty: 'Medium',
|
||||
description: '株形美观,茎干叶片全年青翠,寓意招财进宝。',
|
||||
origin: '中美洲'
|
||||
},
|
||||
{
|
||||
id: '6',
|
||||
name: '绿萝',
|
||||
scientificName: 'Epipremnum aureum',
|
||||
family: '天南星科',
|
||||
images: ['monstera_plant_1769757312755.png'],
|
||||
category: '观叶',
|
||||
tags: ['新手必入', '遇水即活', '垂吊'],
|
||||
difficulty: 'Easy',
|
||||
description: '生命力顽强,有"生命之花"的美誉,极易扦插繁殖。',
|
||||
origin: '所罗门群岛'
|
||||
},
|
||||
{
|
||||
id: '7',
|
||||
name: '琴叶榕',
|
||||
scientificName: 'Ficus lyrata',
|
||||
family: '桑科',
|
||||
images: ['snake_plant_1769757638773.png'],
|
||||
category: '观叶',
|
||||
tags: ['北欧风', '网红植物', '大叶'],
|
||||
difficulty: 'Hard',
|
||||
description: '叶片巨大,形似提琴,是极具格调的室内大型盆栽。',
|
||||
origin: '西非'
|
||||
},
|
||||
{
|
||||
id: '8',
|
||||
name: '蝴蝶兰',
|
||||
scientificName: 'Phalaenopsis aphrodite',
|
||||
family: '兰科',
|
||||
images: ['garden_banner.png'],
|
||||
category: '观花',
|
||||
tags: ['高雅', '花期长', '年宵花'],
|
||||
difficulty: 'Medium',
|
||||
description: '花朵形似蝴蝶飞舞,色彩艳丽,素有"洋兰皇后"之称。',
|
||||
origin: '热带亚洲'
|
||||
},
|
||||
{
|
||||
id: '9',
|
||||
name: '仙人掌',
|
||||
scientificName: 'Opuntia stricta',
|
||||
family: '仙人掌科',
|
||||
images: ['succulent_garden_1769757406309.png'],
|
||||
category: '多肉',
|
||||
tags: ['超耐旱', '抗辐射', '奇特'],
|
||||
difficulty: 'Easy',
|
||||
description: '茎肉质,叶退化为刺,极度耐旱,无需频繁打理。',
|
||||
origin: '美洲'
|
||||
},
|
||||
{
|
||||
id: '10',
|
||||
name: '栀子花',
|
||||
scientificName: 'Gardenia jasminoides',
|
||||
family: '茜草科',
|
||||
images: ['garden_banner.png'],
|
||||
category: '观花',
|
||||
tags: ['芳香', '洁白', '喜酸性土'],
|
||||
difficulty: 'Medium',
|
||||
description: '花色洁白,芳香馥郁,叶色四季常绿。',
|
||||
origin: '中国'
|
||||
},
|
||||
{
|
||||
id: '11',
|
||||
name: '散尾葵',
|
||||
scientificName: 'Dypsis lutescens',
|
||||
family: '棕榈科',
|
||||
images: ['monstera_plant_1769757312755.png'],
|
||||
category: '观叶',
|
||||
tags: ['热带风情', '加湿器', '大型'],
|
||||
difficulty: 'Medium',
|
||||
description: '羽状叶片飘逸,具有浓郁的热带风情,能有效增加空气湿度。',
|
||||
origin: '马达加斯加'
|
||||
},
|
||||
{
|
||||
id: '12',
|
||||
name: '生石花',
|
||||
scientificName: 'Lithops',
|
||||
family: '番杏科',
|
||||
images: ['succulent_garden_1769757406309.png'],
|
||||
category: '多肉',
|
||||
tags: ['屁屁花', '软萌', '奇趣'],
|
||||
difficulty: 'Medium',
|
||||
description: '外形酷似彩色鹅卵石,也被称为"有生命的石头"。',
|
||||
origin: '南非'
|
||||
},
|
||||
{
|
||||
id: '13',
|
||||
name: '茉莉花',
|
||||
scientificName: 'Jasminum sambac',
|
||||
family: '木犀科',
|
||||
images: ['garden_banner.png'],
|
||||
category: '观花',
|
||||
tags: ['天下第一香', '泡茶', '喜阳'],
|
||||
difficulty: 'Medium',
|
||||
description: '花香浓郁,素洁光润,花语主要为忠贞、尊敬、清纯。',
|
||||
origin: '印度'
|
||||
},
|
||||
{
|
||||
id: '14',
|
||||
name: '天堂鸟',
|
||||
scientificName: 'Strelitzia reginae',
|
||||
family: '旅人蕉科',
|
||||
images: ['monstera_plant_1769757312755.png'],
|
||||
category: '观叶',
|
||||
tags: ['高大', '气派', 'ins风'],
|
||||
difficulty: 'Medium',
|
||||
description: '叶片宽大厚实,四季常青,是室内大型盆栽的优选。',
|
||||
origin: '南非'
|
||||
},
|
||||
{
|
||||
id: '15',
|
||||
name: '芦荟',
|
||||
scientificName: 'Aloe vera',
|
||||
family: '阿福花科',
|
||||
images: ['succulent_garden_1769757406309.png'],
|
||||
category: '多肉',
|
||||
tags: ['美容', '药用', '净化空气'],
|
||||
difficulty: 'Easy',
|
||||
description: '叶片肥厚多汁,含有丰富的胶质,具有一定的美容和药用价值。',
|
||||
origin: '非洲'
|
||||
},
|
||||
{
|
||||
id: '16',
|
||||
name: '长寿花',
|
||||
scientificName: 'Kalanchoe blossfeldiana',
|
||||
family: '景天科',
|
||||
images: ['garden_banner.png'],
|
||||
category: '观花',
|
||||
tags: ['花期超长', '吉祥', '好养'],
|
||||
difficulty: 'Easy',
|
||||
description: '叶片密集翠绿,花色丰富,花期可长达4-5个月。',
|
||||
origin: '马达加斯加'
|
||||
},
|
||||
{
|
||||
id: '17',
|
||||
name: '玉露',
|
||||
scientificName: 'Haworthia cooperi',
|
||||
family: '阿福花科',
|
||||
images: ['succulent_garden_1769757406309.png'],
|
||||
category: '多肉',
|
||||
tags: ['晶莹剔透', '窗窗', '小巧'],
|
||||
difficulty: 'Medium',
|
||||
description: '叶顶端有透明的"窗",逆光观察如同有生命的工艺品。',
|
||||
origin: '南非'
|
||||
},
|
||||
{
|
||||
id: '18',
|
||||
name: '君子兰',
|
||||
scientificName: 'Clivia miniata',
|
||||
family: '石蒜科',
|
||||
images: ['garden_banner.png'],
|
||||
category: '观花',
|
||||
tags: ['富贵', '寿命长', '半阴'],
|
||||
difficulty: 'Medium',
|
||||
description: '叶片排列整齐,花色艳丽,果实红亮,具有很高的观赏价值。',
|
||||
origin: '南非'
|
||||
},
|
||||
{
|
||||
id: '19',
|
||||
name: '豆瓣绿',
|
||||
scientificName: 'Peperomia tetraphylla',
|
||||
family: '胡椒科',
|
||||
images: ['monstera_plant_1769757312755.png'],
|
||||
category: '观叶',
|
||||
tags: ['电脑伴侣', '护眼', '小清新'],
|
||||
difficulty: 'Easy',
|
||||
description: '叶片碧绿光亮,小巧可爱,适合摆放在办公桌案头。',
|
||||
origin: '美洲热带'
|
||||
},
|
||||
{
|
||||
id: '20',
|
||||
name: '绣球花',
|
||||
scientificName: 'Hydrangea macrophylla',
|
||||
family: '绣球花科',
|
||||
images: ['garden_banner.png'],
|
||||
category: '观花',
|
||||
tags: ['梦幻', '调色', '夏季'],
|
||||
difficulty: 'Medium',
|
||||
description: '花序硕大,花色随土壤酸碱度变化而变化,红蓝交相辉映。',
|
||||
origin: '中国/日本'
|
||||
}
|
||||
];
|
||||
|
||||
+47
-15
@@ -38,13 +38,20 @@ class WxRequest {
|
||||
method: options.method || 'GET',
|
||||
data: options.data || {},
|
||||
header: header,
|
||||
timeout: options.timeout || 60000
|
||||
timeout: options.timeout || 60000,
|
||||
skipToken: options.skipToken || false
|
||||
};
|
||||
|
||||
// Apply request interceptor
|
||||
config = this.interceptors.request(config);
|
||||
return new Promise(async (resolve, reject) => {
|
||||
// Apply request interceptor (Async)
|
||||
try {
|
||||
config = await Promise.resolve(this.interceptors.request(config));
|
||||
} catch (ignore) {
|
||||
// If interceptor fails/rejects, likely means we shouldn't proceed
|
||||
// But for now let's just log or reject
|
||||
console.warn('Interceptor warning', ignore);
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
wx.request({
|
||||
...config,
|
||||
success: (res) => {
|
||||
@@ -114,11 +121,14 @@ class WxRequest {
|
||||
formData: formData
|
||||
};
|
||||
|
||||
// Apply request interceptor (reuse logic for token injection)
|
||||
// Note: wx.uploadFile doesn't support method/data in the same way, but we use interceptor for header mainly
|
||||
config = this.interceptors.request(config);
|
||||
// Apply request interceptor (Async)
|
||||
return new Promise(async (resolve, reject) => {
|
||||
try {
|
||||
config = await Promise.resolve(this.interceptors.request(config));
|
||||
} catch (ignore) {
|
||||
console.warn('Interceptor warning', ignore);
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
wx.uploadFile({
|
||||
url: config.url,
|
||||
filePath: config.filePath,
|
||||
@@ -182,9 +192,13 @@ class WxRequest {
|
||||
formData: formData
|
||||
};
|
||||
|
||||
config = this.interceptors.request(config);
|
||||
return new Promise(async (resolve, reject) => {
|
||||
try {
|
||||
config = await Promise.resolve(this.interceptors.request(config));
|
||||
} catch (ignore) {
|
||||
console.warn('Interceptor warning', ignore);
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
wx.uploadFile({
|
||||
url: config.url,
|
||||
filePath: config.filePath,
|
||||
@@ -238,19 +252,37 @@ class WxRequest {
|
||||
|
||||
// Initialize with default instance
|
||||
const request = new WxRequest({
|
||||
baseUrl: 'http://192.168.0.184:8889',
|
||||
//baseUrl: 'https://go.sundynix.cn/api',
|
||||
//baseUrl: 'http://192.168.0.184:8889',
|
||||
baseUrl: 'https://go.sundynix.cn/api',
|
||||
header: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
});
|
||||
|
||||
// Example: Setup default interceptors
|
||||
request.setRequestInterceptor((config) => {
|
||||
request.setRequestInterceptor(async (config) => {
|
||||
// Skip checking token for login API itself
|
||||
if (config.url.includes('/auth/miniLogin') || config.skipToken) {
|
||||
return config;
|
||||
}
|
||||
|
||||
let token = wx.getStorageSync('token');
|
||||
|
||||
// If no token, attempt to wait for login
|
||||
if (!token) {
|
||||
const app = getApp();
|
||||
if (app && app.ensureLogin) {
|
||||
try {
|
||||
token = await app.ensureLogin();
|
||||
} catch (e) {
|
||||
// Login failed
|
||||
console.warn('Auto-login failed in interceptor', e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Inject token if available
|
||||
const token = wx.getStorageSync('token');
|
||||
if (token) {
|
||||
// User requested: Bearer + token
|
||||
config.header['Authorization'] = `Bearer ${token}`;
|
||||
}
|
||||
return config;
|
||||
|
||||
Reference in New Issue
Block a user