插件中心

SaaS 套件

saas · v1.3.0 · nuxtcms >=1.24.0 · 0 次安装

把网站变成可收费的 SaaS 产品:用户注册登录(邮箱密码、邮件免密登录、Google / GitHub / 微信扫码)、用户中心;套餐与收费(Stripe 订阅、微信支付 / 支付宝按月按年购买)、按套餐限制功能;积分消耗与明细、个人 API 密钥、团队(成员共享套餐);后台用户、套餐与订单管理。

插件能力

定时任务
SaaS:自动邮件 · 23 * * * *

设置项

允许新用户注册signupEnabled · boolean
邮箱 + 密码登录passwordLogin · boolean
邮件免密登录(发送一次性登录链接)magicLink · boolean

需要配置邮件(后台 → 邮件配置)

密码注册后需验证邮箱才能登录requireEmailVerification · boolean
登录后跳转页面afterLoginPath · text
自动邮件:欢迎邮件、套餐到期提醒与到期通知lifecycleEmails · boolean

需要配置邮件与定时任务(每小时运行一次)

到期前几天提醒(逗号分隔)reminderDays · text
允许用户创建 API 密钥apiKeys · boolean
API 密钥最低套餐(标识,留空为所有用户)apiKeysPlan · text
每个 API 密钥每分钟请求数apiRateLimit · number
团队(成员共享所有者的套餐,按套餐席位限制人数)teams · boolean
Google OAuth Client ID(填写即显示 Google 登录)googleClientId · text

回调地址:/api/saas/oauth/google/callback

Google OAuth Client SecretgoogleClientSecret · secret
GitHub OAuth Client ID(填写即显示 GitHub 登录)githubClientId · text

回调地址:/api/saas/oauth/github/callback

GitHub OAuth Client SecretgithubClientSecret · secret
微信开放平台网站应用 AppID(填写即显示微信扫码登录)wechatAppId · text

授权回调域填写本站域名;回调路径:/api/saas/oauth/wechat/callback

微信网站应用 AppSecretwechatAppSecret · secret
Stripe Secret Key(填写即可用 Stripe 订阅)stripeSecretKey · secret

留空时使用商城插件中的同名配置。套餐中填写 Stripe 的按月 / 按年价格 ID(price_...)。

Stripe Webhook 签名密钥stripeWebhookSecret · secret

Webhook 地址:/api/saas/webhooks/stripe,事件:customer.subscription.*、checkout.session.completed、invoice.paid

微信支付商户号wechatPayMchId · text

留空时使用商城插件中的同名配置。回调地址:/api/saas/webhooks/wechat

微信支付 AppID(与商户号绑定)wechatPayAppId · text
微信支付 APIv3 密钥wechatPayApiV3Key · secret
商户 API 证书序列号wechatPaySerialNo · text
商户 API 私钥(apiclient_key.pem)wechatPayPrivateKey · secret
微信支付公钥 ID(可选)wechatPayPublicKeyId · text
微信支付公钥(可选,用于校验回调签名)wechatPayPublicKey · textarea
手机浏览器使用微信 H5 支付(需在商户平台开通)wechatPayH5 · boolean
支付宝 AppIDalipayAppId · text

留空时使用商城插件中的同名配置。异步通知地址:/api/saas/webhooks/alipay

支付宝应用私钥alipayPrivateKey · secret
支付宝公钥(不是应用公钥)alipayPublicKey · textarea
支付宝沙箱环境alipaySandbox · boolean

如何安装

代码包插件(需要重新构建) · 在站点项目目录执行

node node_modules/nuxtcms/scripts/plugin.mjs add saas