mirror of https://github.com/openspug/spug
parent
51da1ccc09
commit
46ead285f8
|
@ -64,7 +64,7 @@ class ContactView(View):
|
||||||
if error is None:
|
if error is None:
|
||||||
response = []
|
response = []
|
||||||
if form.with_push or form.only_push:
|
if form.with_push or form.only_push:
|
||||||
push_key = AppSetting.get('spug_push_key')
|
push_key = AppSetting.get_default('spug_push_key')
|
||||||
if push_key:
|
if push_key:
|
||||||
response = get_contacts(push_key)
|
response = get_contacts(push_key)
|
||||||
if form.only_push:
|
if form.only_push:
|
||||||
|
|
|
@ -8,7 +8,12 @@ import React from 'react'
|
||||||
|
|
||||||
function Link(props) {
|
function Link(props) {
|
||||||
return (
|
return (
|
||||||
<a target="_blank" rel="noopener noreferrer" href={props.href}>{props.title}</a>
|
<a
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
href={props.href}
|
||||||
|
className={props.className}>
|
||||||
|
{props.title}</a>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -69,13 +69,14 @@ export default observer(function () {
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="wx_token"
|
name="wx_token"
|
||||||
label="推送标识"
|
label="MFA标识"
|
||||||
extra={(
|
extra={(
|
||||||
<span>
|
<span>
|
||||||
如果启用了MFA(两步验证)则该项为必填。
|
如果启用了MFA(两步验证)则该项为必填。
|
||||||
<a target="_blank" rel="noopener noreferrer" href="https://spug.cc/docs/wx-token/">什么是微信Token?</a>
|
<a target="_blank" rel="noopener noreferrer" href="https://push.spug.cc/guide/spug">如何获取MFA标识?</a>
|
||||||
</span>)}>
|
</span>)}>
|
||||||
<Select showSearch filterOption={(i, o) => includes(o.children, i)} placeholder="请选择绑定推送标识">
|
<Select showSearch allowClear filterOption={(i, o) => includes(o.children, i)}
|
||||||
|
placeholder="请选择绑定推送标识">
|
||||||
{contacts.map(item => (
|
{contacts.map(item => (
|
||||||
<Select.Option value={item.id} key={item.id}>{item.name}</Select.Option>
|
<Select.Option value={item.id} key={item.id}>{item.name}</Select.Option>
|
||||||
))}
|
))}
|
||||||
|
|
|
@ -60,11 +60,11 @@ export default observer(function () {
|
||||||
const isVip = balance.is_vip
|
const isVip = balance.is_vip
|
||||||
const spugPushKey = store.settings.spug_push_key
|
const spugPushKey = store.settings.spug_push_key
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<Spin spinning={fetching}>
|
||||||
<div className={css.title}>推送服务设置</div>
|
<div className={css.title}>推送服务设置</div>
|
||||||
<div style={{maxWidth: 340}}>
|
<div style={{maxWidth: 340}}>
|
||||||
<Form.Item label="推送助手账户绑定" labelCol={{span: 24}} style={{marginTop: 12}}
|
<Form.Item label="推送助手账户绑定" labelCol={{span: 24}} style={{marginTop: 12}}
|
||||||
extra={<div>请登录 <Link href="https://push.spug.cc/login" title="推送助手"/>,至个人中心 /
|
extra={<div>请登录 <Link href="https://push.spug.cc/user/info" title="推送助手"/>,至个人中心 /
|
||||||
个人设置查看用户ID,注意保密该ID请勿泄漏给第三方。</div>}>
|
个人设置查看用户ID,注意保密该ID请勿泄漏给第三方。</div>}>
|
||||||
|
|
||||||
{spugPushKey ? (
|
{spugPushKey ? (
|
||||||
|
@ -93,12 +93,11 @@ export default observer(function () {
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{spugPushKey ? (
|
{balance.vip_desc ? (
|
||||||
<Form.Item style={{marginTop: 24}}
|
<Form.Item style={{marginTop: 24}}
|
||||||
extra={<div> 如需充值请至 <Link href="https://push.spug.cc/buy/sms" title="推送助手"/>,具体计费规则及说明请查看推送助手官网。
|
extra={<div> 如需充值请至 <Link href="https://push.spug.cc/buy/sms" title="推送助手"/>,具体计费规则及说明请查看推送助手官网。
|
||||||
</div>}>
|
</div>}>
|
||||||
<div className={css.statistic}>
|
<div className={css.statistic}>
|
||||||
<Spin spinning={fetching}>
|
|
||||||
<div className={css.body}>
|
<div className={css.body}>
|
||||||
<div className={css.item}>
|
<div className={css.item}>
|
||||||
<div className={css.title}>短信余额</div>
|
<div className={css.title}>短信余额</div>
|
||||||
|
@ -112,25 +111,27 @@ export default observer(function () {
|
||||||
<div className={css.title}>邮件余额</div>
|
<div className={css.title}>邮件余额</div>
|
||||||
<div className={css.value}>{balance.mail_balance}</div>
|
<div className={css.value}>{balance.mail_balance}</div>
|
||||||
{isVip ? (
|
{isVip ? (
|
||||||
<div className={clsNames(css.tips, css.active)}>+ 会员免费20封 / 天</div>
|
<div className={clsNames(css.tips, css.active)}>+ 会员赠送{balance.mail_free}封 / 天</div>
|
||||||
) : (
|
) : (
|
||||||
<div className={css.tips}>会员免费20封 / 天</div>
|
<Link href="https://push.spug.cc/buy/vip" title={`订阅会员每天赠送${balance.mail_free}封`}
|
||||||
|
className={css.tips}/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className={css.item}>
|
<div className={css.item}>
|
||||||
<div className={css.title}>微信公众号余额</div>
|
<div className={css.title}>微信公众号余额</div>
|
||||||
<div className={css.value}>{balance.wx_mp_balance}</div>
|
<div className={css.value}>{balance.wx_mp_balance}</div>
|
||||||
{isVip ? (
|
{isVip ? (
|
||||||
<div className={clsNames(css.tips, css.active)}>+ 会员免费100条 / 天</div>
|
<div className={clsNames(css.tips, css.active)}>+ 会员赠送{balance.wx_mp_free}条 / 天</div>
|
||||||
) : (
|
) : (
|
||||||
<div className={css.tips}>会员免费20封 / 天</div>
|
<Link href="https://push.spug.cc/buy/vip" title={`订阅会员每天赠送${balance.wx_mp_free}条`}
|
||||||
|
className={css.tips}/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
<Link href="https://push.spug.cc/buy/vip" className={css.badge} title={balance.vip_desc}/>
|
||||||
</div>
|
</div>
|
||||||
</Spin>
|
|
||||||
</div>
|
</div>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
) : null}
|
) : null}
|
||||||
</React.Fragment>
|
</Spin>
|
||||||
)
|
)
|
||||||
})
|
})
|
|
@ -95,9 +95,9 @@ export default observer(function () {
|
||||||
label="登录MFA(两步)认证"
|
label="登录MFA(两步)认证"
|
||||||
style={{marginTop: 24}}
|
style={{marginTop: 24}}
|
||||||
extra={visible ? '输入验证码,通过验证后开启。' :
|
extra={visible ? '输入验证码,通过验证后开启。' :
|
||||||
<span>建议开启,登录时额外使用验证码进行身份验证。开启前至少要确保管理员账户配置了推送标识(账户管理/编辑),开启后未配置的账户将无法登录,<a
|
<span>建议开启,登录时额外使用验证码进行身份验证。开启前至少要确保管理员账户配置了MFA标识(账户管理/编辑),开启后未配置的账户将无法登录。<a
|
||||||
target="_blank" rel="noopener noreferrer"
|
target="_blank" rel="noopener noreferrer"
|
||||||
href="https://spug.cc/docs/wx-token/">什么是微信Token?</a></span>}>
|
href="https://push.spug.cc/guide/spug">配置手册</a></span>}>
|
||||||
{visible ? (
|
{visible ? (
|
||||||
<div style={{display: 'flex', width: 490}}>
|
<div style={{display: 'flex', width: 490}}>
|
||||||
<Form.Item noStyle extra="验证通过后开启MFA(两步验证)。">
|
<Form.Item noStyle extra="验证通过后开启MFA(两步验证)。">
|
||||||
|
|
|
@ -37,6 +37,21 @@
|
||||||
.body {
|
.body {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.badge {
|
||||||
|
border-radius: 4px;
|
||||||
|
line-height: 20px;
|
||||||
|
height: 20px;
|
||||||
|
font-size: 12px;
|
||||||
|
padding: 0 8px;
|
||||||
|
background: #2563fc;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #ffffff;
|
||||||
|
cursor: pointer;
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
@ -83,13 +98,11 @@
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 0 8px;
|
padding: 0 8px;
|
||||||
cursor: pointer;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.active {
|
.active {
|
||||||
cursor: initial;
|
color: #2563fc;
|
||||||
background: #f7af40;
|
background: #ffffff;
|
||||||
color: #ffffff;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,9 +45,6 @@ export default observer(function Basic(props) {
|
||||||
<Form.Item required name="nickname" label="昵称">
|
<Form.Item required name="nickname" label="昵称">
|
||||||
<Input placeholder="请输入"/>
|
<Input placeholder="请输入"/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item name="wx_token" label="微信Token" extra={<a target="_blank" rel="noopener noreferrer" href="https://spug.cc/docs/wx-token/">什么是微信Token?</a>}>
|
|
||||||
<Input placeholder="请输入"/>
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item>
|
<Form.Item>
|
||||||
<Button type="primary" loading={loading} onClick={handleSubmit}>保存设置</Button>
|
<Button type="primary" loading={loading} onClick={handleSubmit}>保存设置</Button>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
|
@ -42,10 +42,10 @@ export default function Reset(props) {
|
||||||
<Input.Password value={old_password} placeholder="请输入" onChange={e => setOldPassword(e.target.value)}/>
|
<Input.Password value={old_password} placeholder="请输入" onChange={e => setOldPassword(e.target.value)}/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item required label="新密码" extra="至少8位包含数字、小写和大写字母。">
|
<Form.Item required label="新密码" extra="至少8位包含数字、小写和大写字母。">
|
||||||
<Input.Password value={new_password} placeholder="请输入" onChange={e => setNewPassword(e.target.value)}/>
|
<Input.Password value={new_password} placeholder="请输入新密码" onChange={e => setNewPassword(e.target.value)}/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item required label="再次确认">
|
<Form.Item required label="再次确认">
|
||||||
<Input.Password value={new2_password} placeholder="请输入" onChange={e => setNew2Password(e.target.value)}/>
|
<Input.Password value={new2_password} placeholder="请再次输入新密码" onChange={e => setNew2Password(e.target.value)}/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item>
|
<Form.Item>
|
||||||
<Button type="primary" loading={loading} onClick={handleSubmit}>保存设置</Button>
|
<Button type="primary" loading={loading} onClick={handleSubmit}>保存设置</Button>
|
||||||
|
|
Loading…
Reference in New Issue