优化了一些问题
This commit is contained in:
@@ -6,9 +6,6 @@ export const usersApiMethods = {
|
||||
getAuthSettings() { return this.request('/settings/auth') },
|
||||
saveAuthSettings(data) { return this.request('/settings/auth', { method: 'POST', body: JSON.stringify(data) }) },
|
||||
|
||||
getOAuthSettings() { return this.request('/settings/oauth') },
|
||||
saveOAuthSettings(data) { return this.request('/settings/oauth', { method: 'POST', body: JSON.stringify(data) }) },
|
||||
|
||||
getNotificationSettings() { return this.request('/settings/notifications') },
|
||||
saveNotificationSettings(data) { return this.request('/settings/notifications', { method: 'POST', body: JSON.stringify(data) }) },
|
||||
getNotificationOverview(params = {}) {
|
||||
|
||||
@@ -1,164 +0,0 @@
|
||||
<template>
|
||||
<n-card class="oauth-provider-card" title="">
|
||||
<!-- 平台信息头部 -->
|
||||
<div class="oauth-provider-header">
|
||||
<div class="oauth-header-left">
|
||||
<span class="oauth-platform-icon">
|
||||
<img v-if="icon" :src="icon" :alt="name" class="oauth-platform-img" />
|
||||
<span v-else class="oauth-platform-text">{{ name.charAt(0) }}</span>
|
||||
</span>
|
||||
<div class="oauth-platform-info">
|
||||
<h4>{{ name }}</h4>
|
||||
<a :href="docUrl" target="_blank" class="oauth-doc-link">
|
||||
前往 {{ name }} 创建应用 ↗
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<n-switch v-model:value="modelValue.enabled" class="oauth-enable-switch">
|
||||
<template #checked>启用</template>
|
||||
<template #unchecked>停用</template>
|
||||
</n-switch>
|
||||
</div>
|
||||
|
||||
<!-- 表单区域(启用后才展开) -->
|
||||
<div v-if="modelValue.enabled" class="oauth-form-body">
|
||||
<n-form label-placement="top" class="aksrt-form oauth-form-grid">
|
||||
<n-form-item
|
||||
v-for="field in fields"
|
||||
:key="field.key"
|
||||
:label="field.label"
|
||||
>
|
||||
<n-input
|
||||
v-if="!field.readonly"
|
||||
v-model:value="modelValue[field.key]"
|
||||
:type="field.secret ? 'password' : 'text'"
|
||||
:show-password-on-click="field.secret"
|
||||
:placeholder="'输入 ' + field.label"
|
||||
size="large"
|
||||
/>
|
||||
<n-input
|
||||
v-else
|
||||
:value="callbackUrl"
|
||||
readonly
|
||||
size="large"
|
||||
style='font-family: "SF Mono", Consolas, monospace; font-size:13px;'
|
||||
/>
|
||||
<template v-if="field.hint" #feedback>
|
||||
<span class="aksrt-hint-text">{{ field.hint }}</span>
|
||||
</template>
|
||||
<template v-if="field.readonly && !field.hint" #feedback>
|
||||
<span class="aksrt-hint-text">将此地址填写到对应平台的「授权回调域 / 回调 URL」中</span>
|
||||
</template>
|
||||
</n-form-item>
|
||||
</n-form>
|
||||
</div>
|
||||
|
||||
<!-- 未启用时的提示 -->
|
||||
<div v-else class="oauth-disabled-hint">
|
||||
<p>开启开关以配置此平台的 OAuth 凭证</p>
|
||||
</div>
|
||||
</n-card>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed } from 'vue'
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: { type: Object, required: true },
|
||||
name: { type: String, required: true },
|
||||
docUrl: { type: String, required: true },
|
||||
fields: { type: Array, required: true },
|
||||
icon: { type: String, default: '' },
|
||||
})
|
||||
|
||||
defineEmits(['update:modelValue'])
|
||||
|
||||
const callbackUrl = computed(() => {
|
||||
const siteUrl = window.aksrtAdminData?.siteUrl || window.location.origin
|
||||
return `${siteUrl}/oauth/callback/`
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.oauth-provider-card {
|
||||
border-radius: 12px !important;
|
||||
}
|
||||
|
||||
/* 平台头部 */
|
||||
.oauth-provider-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding-bottom: 20px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.oauth-header-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
.oauth-platform-icon {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: var(--aksrt-color-canvas);
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
.oauth-platform-img {
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.oauth-platform-text {
|
||||
font-size: 20px;
|
||||
font-weight: 700;
|
||||
color: var(--aksrt-color-muted);
|
||||
}
|
||||
|
||||
.oauth-platform-info h4 {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: var(--aksrt-color-text);
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.oauth-doc-link {
|
||||
font-size: 12px;
|
||||
color: var(--aksrt-color-primary);
|
||||
text-decoration: none;
|
||||
}
|
||||
.oauth-doc-link:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* 启用开关 */
|
||||
.oauth-enable-switch {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* 表单体 */
|
||||
.oauth-form-body {
|
||||
padding-top: 8px;
|
||||
border-top: 1px solid var(--aksrt-color-border);
|
||||
}
|
||||
|
||||
.oauth-form-grid :deep(.n-form-item) {
|
||||
max-width: 520px;
|
||||
}
|
||||
|
||||
/* 禁用提示 */
|
||||
.oauth-disabled-hint {
|
||||
text-align: center;
|
||||
padding: 28px 0 10px;
|
||||
}
|
||||
.oauth-disabled-hint p {
|
||||
font-size: 13px;
|
||||
color: var(--aksrt-color-border-strong);
|
||||
}
|
||||
</style>
|
||||
@@ -25,17 +25,28 @@
|
||||
/>
|
||||
|
||||
<!-- Input (text, email, url, password) -->
|
||||
<n-input
|
||||
v-else-if="schema.type === 'input' || schema.type === 'text' || schema.type === 'url'"
|
||||
:value="modelValue"
|
||||
:placeholder="schema.placeholder || ''"
|
||||
:type="schema.inputType || 'text'"
|
||||
:disabled="schema.disabled"
|
||||
@update:value="emit('update:modelValue', $event)"
|
||||
>
|
||||
<template v-if="schema.prefix" #prefix>{{ schema.prefix }}</template>
|
||||
<template v-if="schema.suffix" #suffix>{{ schema.suffix }}</template>
|
||||
</n-input>
|
||||
<div v-else-if="schema.type === 'input' || schema.type === 'text' || schema.type === 'url'" class="aksrt-field__input-wrap">
|
||||
<n-input
|
||||
:value="secretDisplayValue"
|
||||
:placeholder="schema.placeholder || ''"
|
||||
:type="schema.inputType || 'text'"
|
||||
:disabled="schema.disabled"
|
||||
@update:value="emit('update:modelValue', $event)"
|
||||
>
|
||||
<template v-if="schema.prefix" #prefix>{{ schema.prefix }}</template>
|
||||
<template v-if="schema.suffix" #suffix>{{ schema.suffix }}</template>
|
||||
</n-input>
|
||||
<n-button
|
||||
v-if="schema.secret && (modelValue === '***' || secretMarkedForClear)"
|
||||
size="small"
|
||||
secondary
|
||||
:type="secretMarkedForClear ? 'warning' : 'error'"
|
||||
@click="toggleSecretClear"
|
||||
>
|
||||
{{ secretMarkedForClear ? '取消清除' : '清除已配置密钥' }}
|
||||
</n-button>
|
||||
<span v-if="secretMarkedForClear" class="aksrt-field__secret-clear-hint">保存后将删除此密钥</span>
|
||||
</div>
|
||||
|
||||
<!-- Textarea -->
|
||||
<n-input
|
||||
@@ -636,6 +647,13 @@ const props = defineProps({
|
||||
|
||||
const emit = defineEmits(['update:modelValue'])
|
||||
|
||||
const secretMarkedForClear = computed(() => props.schema.secret && props.modelValue === '__AKSRT_CLEAR_SECRET__')
|
||||
const secretDisplayValue = computed(() => secretMarkedForClear.value ? '' : props.modelValue)
|
||||
|
||||
function toggleSecretClear() {
|
||||
emit('update:modelValue', secretMarkedForClear.value ? '***' : '__AKSRT_CLEAR_SECRET__')
|
||||
}
|
||||
|
||||
const repeaterLength = computed(() => Array.isArray(props.modelValue) ? props.modelValue.length : 0)
|
||||
const reachedRepeaterMinimum = computed(() => repeaterLength.value <= Number(props.schema.min || 0))
|
||||
const reachedRepeaterMaximum = computed(() => Number(props.schema.max || 0) > 0 && repeaterLength.value >= Number(props.schema.max))
|
||||
@@ -1014,6 +1032,20 @@ function confirmRepeaterModal() {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.aksrt-field__input-wrap {
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.aksrt-field__input-wrap .n-button {
|
||||
justify-self: start;
|
||||
}
|
||||
|
||||
.aksrt-field__secret-clear-hint {
|
||||
color: var(--aksrt-color-warning, #d97706);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.aksrt-field__label-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
@@ -200,7 +200,20 @@ const {
|
||||
}
|
||||
return response
|
||||
},
|
||||
submit: (data) => api.saveSchemaPage(resolvedDomain.value, resolvedSection.value, data),
|
||||
submit: async (data) => {
|
||||
const payload = { ...data }
|
||||
const clearSecrets = []
|
||||
Object.keys(payload).forEach((key) => {
|
||||
if (payload[key] === '__AKSRT_CLEAR_SECRET__') {
|
||||
clearSecrets.push(key)
|
||||
delete payload[key]
|
||||
}
|
||||
})
|
||||
if (clearSecrets.length) payload.__clear_secrets = clearSecrets
|
||||
const response = await api.saveSchemaPage(resolvedDomain.value, resolvedSection.value, payload)
|
||||
clearSecrets.forEach((key) => { data[key] = '' })
|
||||
return response
|
||||
},
|
||||
defaults: defaults.value,
|
||||
onSaved: () => {
|
||||
message.success('设置已保存')
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
<template>
|
||||
<div class="aksrt-page-container">
|
||||
<PageHeader :title="title" :desc="desc">
|
||||
<template #actions>
|
||||
<n-space v-if="links.length">
|
||||
<n-button v-for="link in links" :key="link.path" quaternary @click="go(link.path)">
|
||||
{{ link.label }}
|
||||
</n-button>
|
||||
</n-space>
|
||||
</template>
|
||||
</PageHeader>
|
||||
|
||||
<n-card v-if="note" class="aksrt-section-card">
|
||||
<n-alert type="info" :show-icon="false">
|
||||
{{ note }}
|
||||
</n-alert>
|
||||
</n-card>
|
||||
|
||||
<slot name="before-form" />
|
||||
<slot />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { useRouter } from 'vue-router'
|
||||
import PageHeader from '@/components/PageHeader.vue'
|
||||
|
||||
defineProps({
|
||||
title: { type: String, required: true },
|
||||
desc: { type: String, default: '' },
|
||||
note: { type: String, default: '' },
|
||||
links: { type: Array, default: () => [] },
|
||||
})
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
function go(path) {
|
||||
router.push(path)
|
||||
}
|
||||
</script>
|
||||
@@ -2,7 +2,7 @@ export const oauthSchema = {
|
||||
key: 'users.oauth',
|
||||
title: '第三方登录',
|
||||
icon: 'fa fas fa-share-alt',
|
||||
description: 'GitHub、Gitee、QQ、Google 等第三方登录配置。',
|
||||
description: 'GitHub、Gitee、QQ、Google、微博和微信第三方登录配置。',
|
||||
defaults: {
|
||||
oauth_s: false,
|
||||
oauth_proxy_mode: 'close',
|
||||
@@ -10,59 +10,42 @@ export const oauthSchema = {
|
||||
oauth_proxy_server_url: '',
|
||||
oauth_proxy_server_providers: ['github', 'gitee', 'qq', 'google'],
|
||||
oauth_proxy_client_providers: ['github', 'gitee', 'qq', 'google'],
|
||||
oauth_proxy_gzh_type: 'service',
|
||||
oauth_bind_type: 'auto',
|
||||
oauth_button_lg: false,
|
||||
weixingzh_priority: false,
|
||||
weixingzh_auto: false,
|
||||
weixingzh_auto_expires: 3600,
|
||||
oauth_github_s: false,
|
||||
oauth_gitee_s: false,
|
||||
oauth_qq_s: false,
|
||||
oauth_weixingzh_s: false,
|
||||
oauth_weixin_s: false,
|
||||
oauth_google_s: false,
|
||||
oauth_weibo_s: false,
|
||||
oauth_baidu_s: false,
|
||||
oauth_alipay_s: false,
|
||||
oauth_weixin_s: false,
|
||||
oauth_weixingzh_s: false,
|
||||
clogin_s: false,
|
||||
clogin_url: '',
|
||||
clogin_id: '',
|
||||
clogin_key: '',
|
||||
clogin_oauth_s: ['qq', 'weixin', 'weibo', 'alipay'],
|
||||
github_appid: '',
|
||||
github_appkey: '',
|
||||
gitee_appid: '',
|
||||
gitee_appkey: '',
|
||||
qq_appid: '',
|
||||
qq_appkey: '',
|
||||
google_client_id: '',
|
||||
google_client_secret: '',
|
||||
weibo_appid: '',
|
||||
weibo_appkey: '',
|
||||
weixin_appid: '',
|
||||
weixin_appsecret: '',
|
||||
weixingzh_gzh_type: 'service',
|
||||
weixingzh_token: '',
|
||||
weixingzh_token_nocheck: false,
|
||||
weixingzh_encoding_aes_key: '',
|
||||
weixingzh_appid: '',
|
||||
weixingzh_appsecret: '',
|
||||
weixingzh_code_qrcode: '',
|
||||
weixingzh_code_keyword: '登录',
|
||||
weixingzh_code_reply: '您的验证码是:%s,有效期 %d 分钟。',
|
||||
weixingzh_code_subscribe_reply: '欢迎关注!回复「%s」获取登录验证码。',
|
||||
weixingzh_subscribe_msg: '',
|
||||
weixingzh_new_subscribe_msg: '',
|
||||
weixingzh_scan_msg: '',
|
||||
weixingzh_auto_reply_text: '',
|
||||
weixingzh_auto_reply_search: '',
|
||||
weixingzh_auto_reply_image: '',
|
||||
weixingzh_auto_reply_voice: '',
|
||||
weixingzh_auto_reply_default: '暂不支持此类型的消息',
|
||||
weixingzh_gzh_menu: '',
|
||||
weibo_appid: '',
|
||||
weibo_appkey: '',
|
||||
baidu_appid: '',
|
||||
baidu_appkey: '',
|
||||
alipay_appid: '',
|
||||
alipay_privatekey: '',
|
||||
alipay_publickey: '',
|
||||
clogin_url: '',
|
||||
clogin_id: '',
|
||||
clogin_key: '',
|
||||
clogin_oauth_s: ['qq', 'weixin', 'weibo'],
|
||||
},
|
||||
groups: [
|
||||
{
|
||||
@@ -72,16 +55,13 @@ export const oauthSchema = {
|
||||
fields: [
|
||||
{ key: 'oauth_s', label: '启用第三方登录', type: 'switch', default: false },
|
||||
{ key: 'oauth_proxy_mode', label: '代理登录模式', type: 'radio', default: 'close', options: [{ label: '关闭', value: 'close' }, { label: '服务端', value: 'server' }, { label: '客户端', value: 'client' }] },
|
||||
{ key: 'oauth_proxy_secret', label: '代理 HMAC 密钥', type: 'input', default: '', dependsOn: { key: 'oauth_proxy_mode', not: 'close' } },
|
||||
{ key: 'oauth_proxy_secret', label: '代理 HMAC 密钥', type: 'input', inputType: 'password', secret: true, default: '', dependsOn: { key: 'oauth_proxy_mode', not: 'close' } },
|
||||
{ key: 'oauth_proxy_server_url', label: '服务端地址', type: 'input', default: '', dependsOn: { key: 'oauth_proxy_mode', value: 'client' } },
|
||||
{ key: 'oauth_proxy_server_providers', label: '服务端允许平台', type: 'checkbox', default: ['github', 'gitee', 'qq', 'google'], options: [{ label: 'GitHub', value: 'github' }, { label: 'Gitee', value: 'gitee' }, { label: 'QQ', value: 'qq' }, { label: 'Google', value: 'google' }, { label: '微博', value: 'weibo' }, { label: '微信', value: 'weixin' }, { label: '百度', value: 'baidu' }, { label: '支付宝', value: 'alipay' }], dependsOn: { key: 'oauth_proxy_mode', value: 'server' } },
|
||||
{ key: 'oauth_proxy_client_providers', label: '客户端启用平台', type: 'checkbox', default: ['github', 'gitee', 'qq', 'google'], options: [{ label: 'GitHub', value: 'github' }, { label: 'Gitee', value: 'gitee' }, { label: 'QQ', value: 'qq' }, { label: 'Google', value: 'google' }, { label: '微博', value: 'weibo' }, { label: '微信', value: 'weixin' }, { label: '百度', value: 'baidu' }, { label: '支付宝', value: 'alipay' }], dependsOn: { key: 'oauth_proxy_mode', value: 'client' } },
|
||||
{ key: 'oauth_proxy_gzh_type', label: '代理公众号类型', type: 'radio', default: 'service', options: [{ label: '服务号', value: 'service' }, { label: '订阅号', value: 'subscribe' }], dependsOn: { key: 'oauth_proxy_mode', not: 'close' } },
|
||||
{ key: 'oauth_proxy_server_providers', label: '服务端允许平台', type: 'checkbox', default: ['github', 'gitee', 'qq', 'google'], options: [{ label: 'GitHub', value: 'github' }, { label: 'Gitee', value: 'gitee' }, { label: 'QQ', value: 'qq' }, { label: 'Google', value: 'google' }, { label: '微博', value: 'weibo' }, { label: '微信', value: 'weixin' }], dependsOn: { key: 'oauth_proxy_mode', value: 'server' } },
|
||||
{ key: 'oauth_proxy_client_providers', label: '客户端启用平台', type: 'checkbox', default: ['github', 'gitee', 'qq', 'google'], options: [{ label: 'GitHub', value: 'github' }, { label: 'Gitee', value: 'gitee' }, { label: 'QQ', value: 'qq' }, { label: 'Google', value: 'google' }, { label: '微博', value: 'weibo' }, { label: '微信', value: 'weixin' }], dependsOn: { key: 'oauth_proxy_mode', value: 'client' } },
|
||||
{ key: 'oauth_bind_type', label: '绑定方式', type: 'radio', default: 'auto', options: [{ label: '自动绑定', value: 'auto' }, { label: '手动绑定', value: 'manual' }] },
|
||||
{ key: 'oauth_button_lg', label: '大按钮样式', type: 'switch', default: false },
|
||||
{ key: 'weixingzh_priority', label: 'PC端优先微信扫码', type: 'switch', default: false, help: '开启后 PC 端登录框优先显示微信公众号扫码' },
|
||||
{ key: 'weixingzh_auto', label: '微信APP内自动登录', type: 'switch', default: false, help: '在微信内置浏览器中自动使用公众号授权登录' },
|
||||
{ key: 'weixingzh_auto_expires', label: '自动登录频率限制 (秒)', type: 'number', default: 3600, min: 0, max: 86400, dependsOn: { key: 'weixingzh_auto', value: true } },
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -92,12 +72,11 @@ export const oauthSchema = {
|
||||
{ key: 'oauth_github_s', label: 'GitHub登录', type: 'switch', default: false },
|
||||
{ key: 'oauth_gitee_s', label: 'Gitee登录', type: 'switch', default: false },
|
||||
{ key: 'oauth_qq_s', label: 'QQ登录', type: 'switch', default: false },
|
||||
{ key: 'oauth_weixingzh_s', label: '微信公众号登录', type: 'switch', default: false },
|
||||
{ key: 'oauth_weixin_s', label: '微信开放平台登录', type: 'switch', default: false },
|
||||
{ key: 'oauth_google_s', label: 'Google登录', type: 'switch', default: false },
|
||||
{ key: 'oauth_weibo_s', label: '微博登录', type: 'switch', default: false },
|
||||
{ key: 'oauth_baidu_s', label: '百度登录', type: 'switch', default: false },
|
||||
{ key: 'oauth_alipay_s', label: '支付宝登录', type: 'switch', default: false },
|
||||
{ key: 'clogin_s', label: '彩虹聚合登录', type: 'switch', default: false, help: '通过第三方聚合登录平台统一接入 QQ/微信/微博/支付宝等' },
|
||||
{ key: 'oauth_weixin_s', label: '微信开放平台登录', type: 'switch', default: false },
|
||||
{ key: 'oauth_weixingzh_s', label: '微信公众号登录', type: 'switch', default: false },
|
||||
{ key: 'clogin_s', label: '彩虹聚合登录', type: 'switch', default: false, help: '通过第三方聚合登录平台统一接入 QQ、微信和微博' },
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -106,7 +85,7 @@ export const oauthSchema = {
|
||||
icon: 'fa fab fa-github',
|
||||
fields: [
|
||||
{ key: 'github_appid', label: 'Client ID', type: 'input', default: '' },
|
||||
{ key: 'github_appkey', label: 'Client Secret', type: 'input', default: '' },
|
||||
{ key: 'github_appkey', label: 'Client Secret', type: 'input', inputType: 'password', secret: true, default: '' },
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -115,7 +94,7 @@ export const oauthSchema = {
|
||||
icon: 'fa fas fa-code-branch',
|
||||
fields: [
|
||||
{ key: 'gitee_appid', label: 'Client ID', type: 'input', default: '' },
|
||||
{ key: 'gitee_appkey', label: 'Client Secret', type: 'input', default: '' },
|
||||
{ key: 'gitee_appkey', label: 'Client Secret', type: 'input', inputType: 'password', secret: true, default: '' },
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -124,42 +103,16 @@ export const oauthSchema = {
|
||||
icon: 'fa fab fa-qq',
|
||||
fields: [
|
||||
{ key: 'qq_appid', label: 'App ID', type: 'input', default: '' },
|
||||
{ key: 'qq_appkey', label: 'App Key', type: 'input', default: '' },
|
||||
{ key: 'qq_appkey', label: 'App Key', type: 'input', inputType: 'password', secret: true, default: '' },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'weixin',
|
||||
title: '微信开放平台配置',
|
||||
icon: 'fa fab fa-weixin',
|
||||
key: 'google',
|
||||
title: 'Google配置',
|
||||
icon: 'fa fab fa-google',
|
||||
fields: [
|
||||
{ key: 'weixin_appid', label: 'AppID', type: 'input', default: '' },
|
||||
{ key: 'weixin_appsecret', label: 'AppSecret', type: 'input', default: '' },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'weixingzh',
|
||||
title: '微信公众号配置',
|
||||
icon: 'fa fab fa-weixin',
|
||||
fields: [
|
||||
{ key: 'weixingzh_gzh_type', label: '公众号类型', type: 'radio', default: 'service', options: [{ label: '服务号', value: 'service' }, { label: '订阅号', value: 'subscribe' }] },
|
||||
{ key: 'weixingzh_token', label: 'Token', type: 'input', default: '' },
|
||||
{ key: 'weixingzh_token_nocheck', label: '不验证Token', type: 'switch', default: false, help: '开发调试时可跳过 Token 验证' },
|
||||
{ key: 'weixingzh_encoding_aes_key', label: 'EncodingAESKey', type: 'input', default: '' },
|
||||
{ key: 'weixingzh_appid', label: 'AppID', type: 'input', default: '' },
|
||||
{ key: 'weixingzh_appsecret', label: 'AppSecret', type: 'input', default: '' },
|
||||
{ key: 'weixingzh_code_qrcode', label: '公众号二维码', type: 'media', default: '', help: '引导用户扫码关注登录的二维码图片' },
|
||||
{ key: 'weixingzh_code_keyword', label: '登录回复关键词', type: 'input', default: '登录', help: '用户在公众号内回复此关键词触发登录验证码' },
|
||||
{ key: 'weixingzh_code_reply', label: '验证码回复模板', type: 'textarea', default: '您的验证码是:%s,有效期 %d 分钟。', help: '%s=验证码,%d=有效分钟数' },
|
||||
{ key: 'weixingzh_code_subscribe_reply', label: '新关注回复模板', type: 'textarea', default: '欢迎关注!回复「%s」获取登录验证码。', help: '%s=登录关键词' },
|
||||
{ key: 'weixingzh_subscribe_msg', label: '关注后回复', type: 'textarea', default: '', help: '用户关注公众号后的自动回复文案' },
|
||||
{ key: 'weixingzh_new_subscribe_msg', label: '新用户关注回复', type: 'textarea', default: '', help: '首次关注用户的专属回复文案,留空使用通用回复' },
|
||||
{ key: 'weixingzh_scan_msg', label: '扫码回复', type: 'textarea', default: '', help: '用户扫码关注公众号后的回复文案' },
|
||||
{ key: 'weixingzh_auto_reply_text', label: '文本自动回复', type: 'textarea', default: '', help: '收到文本消息的自动回复' },
|
||||
{ key: 'weixingzh_auto_reply_search', label: '搜索回复', type: 'textarea', default: '', help: '未匹配关键词时的搜索提示回复' },
|
||||
{ key: 'weixingzh_auto_reply_image', label: '图片回复', type: 'textarea', default: '', help: '收到图片消息的自动回复' },
|
||||
{ key: 'weixingzh_auto_reply_voice', label: '语音回复', type: 'textarea', default: '', help: '收到语音消息的自动回复' },
|
||||
{ key: 'weixingzh_auto_reply_default', label: '默认回复', type: 'textarea', default: '暂不支持此类型的消息', help: '其他未匹配消息类型的兜底回复' },
|
||||
{ key: 'weixingzh_gzh_menu', label: '自定义菜单 JSON', type: 'textarea', default: '', help: '微信公众号自定义菜单 JSON 配置,留空不创建菜单' },
|
||||
{ key: 'google_client_id', label: 'Client ID', type: 'input', default: '' },
|
||||
{ key: 'google_client_secret', label: 'Client Secret', type: 'input', inputType: 'password', secret: true, default: '' },
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -168,16 +121,32 @@ export const oauthSchema = {
|
||||
icon: 'fa fab fa-weibo',
|
||||
fields: [
|
||||
{ key: 'weibo_appid', label: 'App Key', type: 'input', default: '' },
|
||||
{ key: 'weibo_appkey', label: 'App Secret', type: 'input', default: '' },
|
||||
{ key: 'weibo_appkey', label: 'App Secret', type: 'input', inputType: 'password', secret: true, default: '' },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'baidu',
|
||||
title: '百度配置',
|
||||
icon: 'fa fas fa-paw',
|
||||
key: 'weixin',
|
||||
title: '微信开放平台配置',
|
||||
icon: 'fa fab fa-weixin',
|
||||
fields: [
|
||||
{ key: 'baidu_appid', label: 'API Key', type: 'input', default: '' },
|
||||
{ key: 'baidu_appkey', label: 'Secret Key', type: 'input', default: '' },
|
||||
{ key: 'weixin_appid', label: 'AppID', type: 'input', default: '' },
|
||||
{ key: 'weixin_appsecret', label: 'AppSecret', type: 'input', inputType: 'password', secret: true, default: '' },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'weixingzh',
|
||||
title: '微信公众号配置',
|
||||
icon: 'fa fab fa-weixin',
|
||||
fields: [
|
||||
{ key: 'weixingzh_gzh_type', label: '公众号类型', type: 'radio', default: 'service', options: [{ label: '服务号', value: 'service' }, { label: '订阅号', value: 'subscribe' }] },
|
||||
{ key: 'weixingzh_token', label: 'Token', type: 'input', inputType: 'password', secret: true, default: '' },
|
||||
{ key: 'weixingzh_appid', label: 'AppID', type: 'input', default: '' },
|
||||
{ key: 'weixingzh_appsecret', label: 'AppSecret', type: 'input', inputType: 'password', secret: true, default: '' },
|
||||
{ key: 'weixingzh_code_qrcode', label: '公众号二维码', type: 'media', default: '', help: '引导用户扫码关注登录的二维码图片' },
|
||||
{ key: 'weixingzh_code_keyword', label: '登录回复关键词', type: 'input', default: '登录', help: '用户在公众号内回复此关键词触发登录验证码' },
|
||||
{ key: 'weixingzh_code_reply', label: '验证码回复模板', type: 'textarea', default: '您的验证码是:%s,有效期 %d 分钟。', help: '%s=验证码,%d=有效分钟数' },
|
||||
{ key: 'weixingzh_subscribe_msg', label: '关注后回复', type: 'textarea', default: '', help: '用户关注公众号后的自动回复文案' },
|
||||
{ key: 'weixingzh_scan_msg', label: '扫码回复', type: 'textarea', default: '', help: '用户扫码关注公众号后的回复文案' },
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -185,27 +154,15 @@ export const oauthSchema = {
|
||||
title: '彩虹聚合登录',
|
||||
icon: 'fa fas fa-cloud',
|
||||
fields: [
|
||||
{ key: 'clogin_url', label: '接口地址', type: 'input', default: '', help: '如 https://xxx.com 不要带 connect.php', dependsOn: { key: 'clogin_s', value: true } },
|
||||
{ key: 'clogin_url', label: '接口地址', type: 'input', default: '', help: '如 https://xxx.com,不要带 connect.php', dependsOn: { key: 'clogin_s', value: true } },
|
||||
{ key: 'clogin_id', label: 'AppID', type: 'input', default: '', dependsOn: { key: 'clogin_s', value: true } },
|
||||
{ key: 'clogin_key', label: 'AppKey', type: 'input', default: '', dependsOn: { key: 'clogin_s', value: true } },
|
||||
{ key: 'clogin_oauth_s', label: '启用平台', type: 'checkbox', default: ['qq', 'weixin', 'weibo', 'alipay'], options: [
|
||||
{ key: 'clogin_key', label: 'AppKey', type: 'input', inputType: 'password', secret: true, default: '', dependsOn: { key: 'clogin_s', value: true } },
|
||||
{ key: 'clogin_oauth_s', label: '启用平台', type: 'checkbox', default: ['qq', 'weixin', 'weibo'], options: [
|
||||
{ label: 'QQ', value: 'qq' },
|
||||
{ label: '微信', value: 'weixin' },
|
||||
{ label: '微博', value: 'weibo' },
|
||||
{ label: '支付宝', value: 'alipay' },
|
||||
{ label: '百度', value: 'baidu' },
|
||||
], dependsOn: { key: 'clogin_s', value: true } },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'alipay',
|
||||
title: '支付宝配置',
|
||||
icon: 'fa fas fa-credit-card',
|
||||
fields: [
|
||||
{ key: 'alipay_appid', label: 'AppID', type: 'input', default: '' },
|
||||
{ key: 'alipay_privatekey', label: '应用私钥', type: 'textarea', rows: 3, default: '' },
|
||||
{ key: 'alipay_publickey', label: '支付宝公钥', type: 'input', default: '' },
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user