dsh-tokenbank 0.1.42 → 0.1.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/client.js +11 -5
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -610,6 +610,7 @@ window.__ModuleLoader__.load({
610
610
  var rechargeOpen = React.useState(false)
611
611
  var logoutArm = React.useState(false)
612
612
  var innerToast = React.useState(null)
613
+ var checkinFlash = React.useState(null) // 签到成功闪现文案(复用获取免费模型按钮样式,2s 回原样)
613
614
  var checkin = React.useState({ busy: false, done: false })
614
615
  React.useEffect(function () {
615
616
  if (!snap.authOpen) logoutArm[1](false)
@@ -715,7 +716,8 @@ window.__ModuleLoader__.load({
715
716
  var fresh = await api('status').catch(function () { return null })
716
717
  if (fresh) { st[1](fresh); tbStore.set({ loggedIn: Boolean(fresh.loggedIn), portalUrl: fresh.portalUrl }) }
717
718
  var streakText = ci.streak > 1 ? '(' + pageT('checkinStreak').replace('{n}', String(ci.streak)) + ')' : ''
718
- innerToast[1]({ text: pageT('checkinOk') + streakText })
719
+ checkinFlash[1](pageT('checkinOk') + streakText)
720
+ window.setTimeout(function () { checkinFlash[1](null) }, 2000)
719
721
  }
720
722
  } catch (e9) {
721
723
  checkin[1]({ busy: false, done: false })
@@ -753,7 +755,7 @@ window.__ModuleLoader__.load({
753
755
  },
754
756
  h('span', { style: { color: innerToast[0].error ? '#d03050' : '#22a04a', fontWeight: 700 } }, innerToast[0].error ? '✕' : '✓'),
755
757
  h('span', { style: { flex: 1 } }, innerToast[0].text),
756
- innerToast[0].error ? null : h('button', {
758
+ (!innerToast[0].error && innerToast[0].kind === 'models') ? h('button', {
757
759
  type: 'button', style: Object.assign({}, buttonStyle, { height: 24, padding: '0 10px', fontSize: 12 }),
758
760
  onClick: function () {
759
761
  innerToast[1](null)
@@ -766,7 +768,7 @@ window.__ModuleLoader__.load({
766
768
  }
767
769
  }, 80)
768
770
  },
769
- }, pageT('goSwitch')),
771
+ }, pageT('goSwitch')) : null,
770
772
  ) : !rechargeOpen[0] ? h('button', {
771
773
  type: 'button', style: Object.assign({}, primaryButtonStyle, { justifyContent: 'center' }),
772
774
  onClick: async function () {
@@ -774,12 +776,16 @@ window.__ModuleLoader__.load({
774
776
  var models = await api('gateway-models', { accessKey: data.accessKey })
775
777
  var list = Array.isArray(models) ? models : (models.models || models.list || [])
776
778
  await addProviderToModels(runtimeCtx, data.baseURL || portal, { accessKey: data.accessKey, list: list, protocol: models.protocol })
777
- innerToast[1]({ text: pageT('modelListCount').replace('{n}', String(list.length)) })
779
+ innerToast[1]({ kind: 'models', text: pageT('modelListCount').replace('{n}', String(list.length)) })
778
780
  } catch (err) {
779
781
  tbStore.set({ notify: { kind: 'error', title: String(err.message || err), detail: '' } })
780
782
  }
781
783
  },
782
- }, pageT('addFreeModels')) : null,
784
+ }, pageT('addFreeModels'))
785
+ : checkinFlash[0] ? h('button', {
786
+ type: 'button', tabIndex: -1,
787
+ style: Object.assign({}, primaryButtonStyle, { justifyContent: 'center', cursor: 'default', opacity: 0.85 }),
788
+ }, checkinFlash[0]) : null,
783
789
  )
784
790
  : h(AuthCard, {
785
791
  mode: snap.authMode,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-tokenbank",
3
- "version": "0.1.42",
3
+ "version": "0.1.44",
4
4
  "description": "DSH 免费模型:一键注册 TokenBank 领免费 APIKey 送 $5 体验金,免费 GLM 模型直接进模型列表;自带余额查询、API Key 密钥托管(临时额度转永久)、每日签到、充值入口(支付宝),获取免费模型无需自建中转。致敬 dsh-our-free-model。官网 https://bank.skillpie.cn",
5
5
  "type": "module",
6
6
  "license": "MIT",