sponsorkit icon indicating copy to clipboard operation
sponsorkit copied to clipboard

Afadian [售卖商品] don't expire

Open Innei opened this issue 1 year ago • 1 comments

Describe the bug

The json is

 {
    "sponsor": {
      "type": "User",
      "login": "2f81b9544cc211eab9b352540025c377",
      "name": "bi8bo",
      "avatarUrl": "https://pic1.afdiancdn.com/user/2f81b9544cc211eab9b352540025c377/avatar/36cb8815b17691ea6dcb76e4a7cdca4b_w640_h640_s46.jpg",
      "linkUrl": "https://afdian.net/u/2f81b9544cc211eab9b352540025c377"
    },
    "monthlyDollars": 12.307692307692308,
    "privacyLevel": "PUBLIC",
    "tierName": "Afdian",
    "createdAt": "2022-02-27T05:48:54.000Z",
    "expireAt": "2036-12-31T16:00:00.000Z",
    "isOneTime": true,
    "provider": "afdian",
    "raw": {
      "sponsor_plans": [
        {
          "can_ali_agreement": 0,
          "plan_id": "08eb414c930711ec8d4d52540025c377",
          "rank": 2147483647,
          "user_id": "e97ad8460df611eab74952540025c377",
          "status": 1,
          "name": "",
          "pic": "",
          "desc": "",
          "price": "80.00",
          "update_time": 1645441896,
          "timing": {
            "timing_on": 0,
            "timing_off": 0
          },
          "pay_month": 1,
          "show_price": "80.00",
          "show_price_after_adjust": "",
          "has_coupon": 0,
          "coupon": [],
          "favorable_price": -1,
          "independent": 0,
          "permanent": 0,
          "can_buy_hide": 1,
          "need_address": 0,
          "product_type": 1,
          "sale_limit_count": -1,
          "need_invite_code": false,
          "bundle_stock": 0,
          "bundle_sku_select_count": 0,
          "config": {},
          "has_plan_config": 0,
          "expire_time": 2114352000,
          "sku_processed": [
            {
              "sku_id": "08fdc2b8930711ecb30352540025c377",
              "count": 1,
              "name": "默认型号",
              "album_id": "",
              "pic": "",
              "stock": ""
            }
          ],
          "rankType": 30
        }
      ],
      "current_plan": {
        "can_ali_agreement": 0,
        "plan_id": "08eb414c930711ec8d4d52540025c377",
        "rank": 2147483647,
        "user_id": "e97ad8460df611eab74952540025c377",
        "status": 1,
   "name": "",
          "pic": "",
          "desc": "",
        "price": "80.00",
        "update_time": 1645441896,
        "timing": {
          "timing_on": 0,
          "timing_off": 0
        },
        "pay_month": 1,
        "show_price": "80.00",
        "show_price_after_adjust": "",
        "has_coupon": 0,
        "coupon": [],
        "favorable_price": -1,
        "independent": 0,
        "permanent": 0,
        "can_buy_hide": 1,
        "need_address": 0,
        "product_type": 1,
        "sale_limit_count": -1,
        "need_invite_code": false,
        "bundle_stock": 0,
        "bundle_sku_select_count": 0,
        "config": {},
        "has_plan_config": 0,
        "expire_time": 2114352000,
        "sku_processed": [
          {
            "sku_id": "08fdc2b8930711ecb30352540025c377",
            "count": 1,
            "name": "默认型号",
            "album_id": "",
            "pic": "",
            "stock": ""
          }
        ],
        "rankType": 30
      },
      "all_sum_amount": "80.00",
      "first_pay_time": 1645940934,
      "last_pay_time": 1645940934,
      "user": {
        "user_id": "2f81b9544cc211eab9b352540025c377",
        "name": "bi8bo",
        "avatar": "https://pic1.afdiancdn.com/user/2f81b9544cc211eab9b352540025c377/avatar/36cb8815b17691ea6dcb76e4a7cdca4b_w640_h640_s46.jpg",
        "user_private_id": "cef6ca339705e53384f3867031edc5844d5873ee"
      }
    }
  },

This is the [售卖商品](https://afdian.net/setting/shop), and for a onetime sponsor. But not expired.

    "createdAt": "2022-02-27T05:48:54.000Z",
    "expireAt": "2036-12-31T16:00:00.000Z",
    "isOneTime": true,

Reproduction

I cannot provide reproduction. There is already a complete JSON above, or you can add product sales on "爱发电"

System Info

System:
    OS: macOS 14.0
    CPU: (8) arm64 Apple M2
    Memory: 192.31 MB / 24.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.17.1 - ~/.n/bin/node
    Yarn: 1.22.19 - ~/.n/bin/yarn
    npm: 8.19.4 - ~/.n/bin/npm
    pnpm: 8.7.0 - ~/.n/bin/pnpm
    Watchman: 2023.09.04.00 - /opt/homebrew/bin/watchman
  Browsers:
    Safari: 17.0

Used Package Manager

pnpm

Validations

  • [X] Follow our Code of Conduct
  • [X] Read the Contributing Guide.
  • [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • [X] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • [X] The provided reproduction is a minimal reproducible of the bug.

Innei avatar Sep 15 '23 07:09 Innei

PR is welcome if you found a fix.

antfu avatar Sep 15 '23 08:09 antfu

I also have this problem, maybe we can add a config that prevents oneTime purchase(商品购买)?

xiaodong2008 avatar May 12 '24 03:05 xiaodong2008