dsh-tokenbank 0.1.28 → 0.1.30

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 +15 -15
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -426,15 +426,18 @@ window.__ModuleLoader__.load({
426
426
  }
427
427
  /** 当前档位提示:用户固定的四组文案。 */
428
428
  var RECHARGE_HINTS = { 1000: 38460000, 5000: 192300000, 10000: 384600000, 30000: 1154000000 }
429
+ function pickedCredit(fen) {
430
+ var list = packs && packs[0] || []
431
+ for (var i = 0; i < list.length; i++) {
432
+ if (list[i].fen === fen && typeof list[i].creditNano === 'number') return list[i].creditNano
433
+ }
434
+ return undefined
435
+ }
429
436
  function rechargeHint(fen, creditNano) {
430
- // 换算固定用原四组值(万 TOKEN):$1=¥6.50,1 TOKEN≈1e6 nano
431
437
  var tokens = RECHARGE_HINTS[fen]
432
438
  var usd = (creditNano ? creditNano / 1e9 : (fen / 100 / 6.5)).toFixed(2)
433
439
  return '获得 $' + usd + ' ≈ ' + humanTokens(tokens) + ' TOKEN'
434
440
  }
435
- function humanTokens(wan) {
436
- return wan >= 10000 ? (wan / 10000).toFixed(1).replace(/\.0$/, '') + '亿' : Math.round(wan) + '万'
437
- }
438
441
 
439
442
  /** 词元数 → "1.2亿"/"3.4万"/"5000"。 */
440
443
  function humanTokens(n) {
@@ -449,13 +452,6 @@ window.__ModuleLoader__.load({
449
452
  var busy = React.useState(false)
450
453
  var err = React.useState('')
451
454
  var packs = React.useState(null) // [{fen, usd, tokens}]
452
- function pickedCredit(fen) {
453
- var list = packs[0] || []
454
- for (var i = 0; i < list.length; i++) {
455
- if (list[i].fen === fen && typeof list[i].creditNano === 'number') return list[i].creditNano
456
- }
457
- return undefined
458
- }
459
455
  React.useEffect(function () {
460
456
  var stopped = false
461
457
  Promise.all([api('recharge-config').catch(function () { return null }), api('wordcoin-market').catch(function () { return null })])
@@ -533,7 +529,11 @@ window.__ModuleLoader__.load({
533
529
  { fen: 1000 }, { fen: 5000 }, { fen: 10000 }, { fen: 30000 },
534
530
  ]).map(function (pk) {
535
531
  var label
536
- label = '¥' + (pk.fen / 100)
532
+ if (pk.usd !== undefined) {
533
+ label = '¥' + (pk.fen / 100)
534
+ } else {
535
+ label = '¥' + (pk.fen / 100)
536
+ }
537
537
  return h('button', {
538
538
  key: pk.fen, type: 'button',
539
539
  style: Object.assign({}, buttonStyle, {
@@ -629,8 +629,7 @@ window.__ModuleLoader__.load({
629
629
  right: Math.max(8, window.innerWidth - anchor.right),
630
630
  bottom: window.innerHeight - anchor.top + 8,
631
631
  maxHeight: 420, overflow: 'auto',
632
- /* 与模型选择器菜单(MenuSurface)完全一致的材质:
633
- 半透明 surface-fill + backdrop 毛玻璃 + prominent 阴影(含 0.5px 描边) */
632
+ /* 与模型选择器菜单(MenuSurface)完全一致的材质 */
634
633
  background: 'var(--dsw-menu-surface-fill)',
635
634
  backdropFilter: 'var(--dsw-menu-backdrop-filter)',
636
635
  WebkitBackdropFilter: 'var(--dsw-menu-backdrop-filter)',
@@ -639,6 +638,7 @@ window.__ModuleLoader__.load({
639
638
  border: 0,
640
639
  '--dsw-elevation-stroke-color': 'var(--dsw-alias-border-l1)',
641
640
  boxShadow: 'var(--dsw-elevation-prominent)',
641
+ border: '1px solid var(--dsw-alias-border-l1)',
642
642
  },
643
643
  onClick: function (e) { e.stopPropagation() },
644
644
  },
@@ -659,7 +659,7 @@ window.__ModuleLoader__.load({
659
659
  type: 'button', title: pageT('logout'), 'aria-label': pageT('logout'),
660
660
  style: logoutArm[0]
661
661
  ? Object.assign({}, buttonStyle, { height: 24, padding: '0 8px', fontSize: 11, color: '#d03050', borderColor: '#d03050', borderWidth: 1, borderStyle: 'solid' })
662
- : { height: 24, minWidth: 24, padding: 0, border: '1px solid rgba(208,48,80,0.45)', borderRadius: 6, background: 'transparent', cursor: 'pointer', display: 'inline-flex', alignItems: 'center', justifyContent: 'center', color: '#d03050' },
662
+ : { height: 24, minWidth: 24, padding: 0, border: 'none', borderRadius: 6, background: 'transparent', cursor: 'pointer', display: 'inline-flex', alignItems: 'center', justifyContent: 'center', color: '#d03050' },
663
663
  onClick: async function () {
664
664
  if (!logoutArm[0]) { logoutArm[1](true); return }
665
665
  await api('logout').catch(function () {})
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-tokenbank",
3
- "version": "0.1.28",
3
+ "version": "0.1.30",
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",