Skip to content

Commit 46ead28

Browse files
committed
# fix issues
1 parent 51da1cc commit 46ead28

File tree

8 files changed

+66
-49
lines changed

8 files changed

+66
-49
lines changed

spug_api/apps/alarm/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def get(self, request):
6464
if error is None:
6565
response = []
6666
if form.with_push or form.only_push:
67-
push_key = AppSetting.get('spug_push_key')
67+
push_key = AppSetting.get_default('spug_push_key')
6868
if push_key:
6969
response = get_contacts(push_key)
7070
if form.only_push:

spug_web/src/components/Link.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ import React from 'react'
88

99
function Link(props) {
1010
return (
11-
<a target="_blank" rel="noopener noreferrer" href={props.href}>{props.title}</a>
11+
<a
12+
target="_blank"
13+
rel="noopener noreferrer"
14+
href={props.href}
15+
className={props.className}>
16+
{props.title}</a>
1217
)
1318
}
1419

spug_web/src/pages/system/account/Form.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,14 @@ export default observer(function () {
6969
</Form.Item>
7070
<Form.Item
7171
name="wx_token"
72-
label="推送标识"
72+
label="MFA标识"
7373
extra={(
7474
<span>
7575
如果启用了MFA(两步验证)则该项为必填。
76-
<a target="_blank" rel="noopener noreferrer" href="https://spug.cc/docs/wx-token/">什么是微信Token</a>
76+
<a target="_blank" rel="noopener noreferrer" href="https://push.spug.cc/guide/spug">如何获取MFA标识</a>
7777
</span>)}>
78-
<Select showSearch filterOption={(i, o) => includes(o.children, i)} placeholder="请选择绑定推送标识">
78+
<Select showSearch allowClear filterOption={(i, o) => includes(o.children, i)}
79+
placeholder="请选择绑定推送标识">
7980
{contacts.map(item => (
8081
<Select.Option value={item.id} key={item.id}>{item.name}</Select.Option>
8182
))}

spug_web/src/pages/system/setting/PushSetting.js

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ export default observer(function () {
6060
const isVip = balance.is_vip
6161
const spugPushKey = store.settings.spug_push_key
6262
return (
63-
<React.Fragment>
63+
<Spin spinning={fetching}>
6464
<div className={css.title}>推送服务设置</div>
6565
<div style={{maxWidth: 340}}>
6666
<Form.Item label="推送助手账户绑定" labelCol={{span: 24}} style={{marginTop: 12}}
67-
extra={<div>请登录 <Link href="https://push.spug.cc/login" title="推送助手"/>,至个人中心 /
67+
extra={<div>请登录 <Link href="https://push.spug.cc/user/info" title="推送助手"/>,至个人中心 /
6868
个人设置查看用户ID,注意保密该ID请勿泄漏给第三方。</div>}>
6969

7070
{spugPushKey ? (
@@ -93,44 +93,45 @@ export default observer(function () {
9393
</Form.Item>
9494
</div>
9595

96-
{spugPushKey ? (
96+
{balance.vip_desc ? (
9797
<Form.Item style={{marginTop: 24}}
9898
extra={<div> 如需充值请至 <Link href="https://push.spug.cc/buy/sms" title="推送助手"/>,具体计费规则及说明请查看推送助手官网。
9999
</div>}>
100100
<div className={css.statistic}>
101-
<Spin spinning={fetching}>
102-
<div className={css.body}>
103-
<div className={css.item}>
104-
<div className={css.title}>短信余额</div>
105-
<div className={css.value}>{balance.sms_balance}</div>
106-
</div>
107-
<div className={css.item}>
108-
<div className={css.title}>语音余额</div>
109-
<div className={css.value}>{balance.voice_balance}</div>
110-
</div>
111-
<div className={css.item}>
112-
<div className={css.title}>邮件余额</div>
113-
<div className={css.value}>{balance.mail_balance}</div>
114-
{isVip ? (
115-
<div className={clsNames(css.tips, css.active)}>+ 会员免费20封 / 天</div>
116-
) : (
117-
<div className={css.tips}>会员免费20封 / 天</div>
118-
)}
119-
</div>
120-
<div className={css.item}>
121-
<div className={css.title}>微信公众号余额</div>
122-
<div className={css.value}>{balance.wx_mp_balance}</div>
123-
{isVip ? (
124-
<div className={clsNames(css.tips, css.active)}>+ 会员免费100条 / 天</div>
125-
) : (
126-
<div className={css.tips}>会员免费20封 / 天</div>
127-
)}
128-
</div>
101+
<div className={css.body}>
102+
<div className={css.item}>
103+
<div className={css.title}>短信余额</div>
104+
<div className={css.value}>{balance.sms_balance}</div>
129105
</div>
130-
</Spin>
106+
<div className={css.item}>
107+
<div className={css.title}>语音余额</div>
108+
<div className={css.value}>{balance.voice_balance}</div>
109+
</div>
110+
<div className={css.item}>
111+
<div className={css.title}>邮件余额</div>
112+
<div className={css.value}>{balance.mail_balance}</div>
113+
{isVip ? (
114+
<div className={clsNames(css.tips, css.active)}>+ 会员赠送{balance.mail_free}封 / 天</div>
115+
) : (
116+
<Link href="https://push.spug.cc/buy/vip" title={`订阅会员每天赠送${balance.mail_free}封`}
117+
className={css.tips}/>
118+
)}
119+
</div>
120+
<div className={css.item}>
121+
<div className={css.title}>微信公众号余额</div>
122+
<div className={css.value}>{balance.wx_mp_balance}</div>
123+
{isVip ? (
124+
<div className={clsNames(css.tips, css.active)}>+ 会员赠送{balance.wx_mp_free}条 / 天</div>
125+
) : (
126+
<Link href="https://push.spug.cc/buy/vip" title={`订阅会员每天赠送${balance.wx_mp_free}条`}
127+
className={css.tips}/>
128+
)}
129+
</div>
130+
<Link href="https://push.spug.cc/buy/vip" className={css.badge} title={balance.vip_desc}/>
131+
</div>
131132
</div>
132133
</Form.Item>
133134
) : null}
134-
</React.Fragment>
135+
</Spin>
135136
)
136137
})

spug_web/src/pages/system/setting/SecuritySetting.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ export default observer(function () {
9595
label="登录MFA(两步)认证"
9696
style={{marginTop: 24}}
9797
extra={visible ? '输入验证码,通过验证后开启。' :
98-
<span>建议开启,登录时额外使用验证码进行身份验证。开启前至少要确保管理员账户配置了推送标识(账户管理/编辑),开启后未配置的账户将无法登录<a
98+
<span>建议开启,登录时额外使用验证码进行身份验证。开启前至少要确保管理员账户配置了MFA标识(账户管理/编辑),开启后未配置的账户将无法登录<a
9999
target="_blank" rel="noopener noreferrer"
100-
href="https://spug.cc/docs/wx-token/">什么是微信Token?</a></span>}>
100+
href="https://push.spug.cc/guide/spug">配置手册</a></span>}>
101101
{visible ? (
102102
<div style={{display: 'flex', width: 490}}>
103103
<Form.Item noStyle extra="验证通过后开启MFA(两步验证)。">

spug_web/src/pages/system/setting/index.module.css

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,21 @@
3737
.body {
3838
display: flex;
3939
flex-direction: row;
40+
position: relative;
41+
42+
.badge {
43+
border-radius: 4px;
44+
line-height: 20px;
45+
height: 20px;
46+
font-size: 12px;
47+
padding: 0 8px;
48+
background: #2563fc;
49+
font-weight: bold;
50+
color: #ffffff;
51+
cursor: pointer;
52+
position: absolute;
53+
right: 0;
54+
}
4055

4156
.item {
4257
position: relative;
@@ -83,13 +98,11 @@
8398
line-height: 20px;
8499
text-align: center;
85100
padding: 0 8px;
86-
cursor: pointer;
87101
}
88102

89103
.active {
90-
cursor: initial;
91-
background: #f7af40;
92-
color: #ffffff;
104+
color: #2563fc;
105+
background: #ffffff;
93106
}
94107
}
95108

spug_web/src/pages/welcome/info/Basic.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ export default observer(function Basic(props) {
4545
<Form.Item required name="nickname" label="昵称">
4646
<Input placeholder="请输入"/>
4747
</Form.Item>
48-
<Form.Item name="wx_token" label="微信Token" extra={<a target="_blank" rel="noopener noreferrer" href="https://spug.cc/docs/wx-token/">什么是微信Token?</a>}>
49-
<Input placeholder="请输入"/>
50-
</Form.Item>
5148
<Form.Item>
5249
<Button type="primary" loading={loading} onClick={handleSubmit}>保存设置</Button>
5350
</Form.Item>

spug_web/src/pages/welcome/info/Reset.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ export default function Reset(props) {
4242
<Input.Password value={old_password} placeholder="请输入" onChange={e => setOldPassword(e.target.value)}/>
4343
</Form.Item>
4444
<Form.Item required label="新密码" extra="至少8位包含数字、小写和大写字母。">
45-
<Input.Password value={new_password} placeholder="请输入" onChange={e => setNewPassword(e.target.value)}/>
45+
<Input.Password value={new_password} placeholder="请输入新密码" onChange={e => setNewPassword(e.target.value)}/>
4646
</Form.Item>
4747
<Form.Item required label="再次确认">
48-
<Input.Password value={new2_password} placeholder="请输入" onChange={e => setNew2Password(e.target.value)}/>
48+
<Input.Password value={new2_password} placeholder="请再次输入新密码" onChange={e => setNew2Password(e.target.value)}/>
4949
</Form.Item>
5050
<Form.Item>
5151
<Button type="primary" loading={loading} onClick={handleSubmit}>保存设置</Button>

0 commit comments

Comments
 (0)