更新密码找回uniapp
This commit is contained in:
1 parent
7f9a66da0f
commit
3fdda89833
1304 files changed
+3503
-26132
No files matched your search
+15
-44
@@ -2,20 +2,12 @@ package models
|
||||
|
||||
import "time"
|
||||
|
||||
// =============================================================
|
||||
// 微信小程序配置(表结构见 docs/sql/create_wechat_mini_config.sql)
|
||||
//
|
||||
// 小程序与公众号是两套独立应用,AppID / AppSecret 不可混用,
|
||||
// 因此单独建表;AppSecret 以 AES-256-GCM 加密存储(复用 wechatmp 的密钥)。
|
||||
// =============================================================
|
||||
|
||||
// WechatMiniConfig 微信小程序配置 yz_platform_wechat_mini_config(单行)
|
||||
type WechatMiniConfig struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
AppID string `orm:"column(app_id);size(64)" json:"app_id"`
|
||||
AppSecret string `orm:"column(app_secret);size(512)" json:"-"` // 加密存储,不回显
|
||||
AppSecret string `orm:"column(app_secret);size(512)" json:"-"`
|
||||
Enabled int8 `orm:"column(enabled);default(0)" json:"enabled"`
|
||||
AutoBind int8 `orm:"column(auto_bind);default(1)" json:"auto_bind"` // 1:手机号命中身份后自动绑定小程序
|
||||
AutoBind int8 `orm:"column(auto_bind);default(1)" json:"auto_bind"`
|
||||
Remark string `orm:"column(remark);size(255)" json:"remark"`
|
||||
CreateTime time.Time `orm:"column(create_time);type(datetime);auto_now_add" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);null" json:"update_time"`
|
||||
@@ -23,28 +15,19 @@ type WechatMiniConfig struct {
|
||||
|
||||
func (m *WechatMiniConfig) TableName() string { return "yz_platform_wechat_mini_config" }
|
||||
|
||||
// WechatMiniApp 微信小程序(多应用) yz_platform_wechat_mini_app
|
||||
// 支持配置多个小程序:认证端登录时按客户端传入的 appid 精确匹配
|
||||
// (未传 appid 时回退第一条启用记录),AppSecret 加密存储不回显。
|
||||
//
|
||||
// 消息推送(小程序后台「开发管理 → 开发设置 → 消息推送」)相关字段:
|
||||
// Token 与后台填写的令牌一致,用于 sha1 签名校验
|
||||
// AESKey 消息加解密密钥(EncodingAESKey,43 位),加密存储不回显
|
||||
// EncryptMode 加解密方式 plain / compatible / safe
|
||||
// DataFormat 推送数据格式 xml / json
|
||||
type WechatMiniApp struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Name string `orm:"column(name);size(128);default('')" json:"name"`
|
||||
AppID string `orm:"column(app_id);size(64)" json:"app_id"`
|
||||
AppSecret string `orm:"column(app_secret);size(512)" json:"-"` // 加密存储,不回显
|
||||
QrcodeURL string `orm:"column(qrcode_url);size(512);default('')" json:"qrcode_url"` // 小程序码图片地址,供官网 / H5 等其他端调取
|
||||
Token string `orm:"column(token);size(128);default('')" json:"token"` // 消息推送 Token
|
||||
AESKey string `orm:"column(aes_key);size(512);default('')" json:"-"` // 消息推送 EncodingAESKey(加密存储,不回显)
|
||||
EncryptMode string `orm:"column(encrypt_mode);size(16);default('plain')" json:"encrypt_mode"` // plain/compatible/safe
|
||||
DataFormat string `orm:"column(data_format);size(16);default('xml')" json:"data_format"` // xml/json
|
||||
PushReply string `orm:"column(push_reply);size(512);default('')" json:"push_reply"` // 客服消息自动回复文案(空 = 不自动回复)
|
||||
AppSecret string `orm:"column(app_secret);size(512)" json:"-"`
|
||||
QrcodeURL string `orm:"column(qrcode_url);size(512);default('')" json:"qrcode_url"`
|
||||
Token string `orm:"column(token);size(128);default('')" json:"token"`
|
||||
AESKey string `orm:"column(aes_key);size(512);default('')" json:"-"`
|
||||
EncryptMode string `orm:"column(encrypt_mode);size(16);default('plain')" json:"encrypt_mode"`
|
||||
DataFormat string `orm:"column(data_format);size(16);default('xml')" json:"data_format"`
|
||||
PushReply string `orm:"column(push_reply);size(512);default('')" json:"push_reply"`
|
||||
Enabled int8 `orm:"column(enabled);default(0)" json:"enabled"`
|
||||
AutoBind int8 `orm:"column(auto_bind);default(1)" json:"auto_bind"` // 1:手机号命中身份后自动绑定
|
||||
AutoBind int8 `orm:"column(auto_bind);default(1)" json:"auto_bind"`
|
||||
Remark string `orm:"column(remark);size(255)" json:"remark"`
|
||||
CreateTime time.Time `orm:"column(create_time);type(datetime);auto_now_add" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);null" json:"update_time"`
|
||||
@@ -53,22 +36,14 @@ type WechatMiniApp struct {
|
||||
|
||||
func (m *WechatMiniApp) TableName() string { return "yz_platform_wechat_mini_app" }
|
||||
|
||||
// WechatMiniTemplate 小程序订阅消息模板 yz_platform_wechat_mini_template
|
||||
//
|
||||
// 一个小程序可配置多个「场景」模板(如站内通知 notice、审批待办 approval)。
|
||||
// Fields 存微信模板字段键 → 语义变量名的映射(JSON),例如:
|
||||
//
|
||||
// {"thing1":"title","phrase2":"content","time3":"time"}
|
||||
//
|
||||
// 推送时按该映射把 title/content/time 填进微信模板的对应字段。
|
||||
type WechatMiniTemplate struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
AppID string `orm:"column(app_id);size(64)" json:"app_id"`
|
||||
Code string `orm:"column(code);size(64)" json:"code"` // 场景码:notice / approval / schedule ...
|
||||
TemplateID string `orm:"column(template_id);size(128)" json:"template_id"` // 微信订阅消息模板 ID
|
||||
Code string `orm:"column(code);size(64)" json:"code"`
|
||||
TemplateID string `orm:"column(template_id);size(128)" json:"template_id"`
|
||||
Title string `orm:"column(title);size(255);default('')" json:"title"`
|
||||
Page string `orm:"column(page);size(255);default('')" json:"page"` // 点击消息跳转的小程序页面
|
||||
Fields string `orm:"column(fields);type(text);null" json:"fields"` // JSON:微信字段键 → 语义变量名
|
||||
Page string `orm:"column(page);size(255);default('')" json:"page"`
|
||||
Fields string `orm:"column(fields);type(text);null" json:"fields"`
|
||||
Enabled int8 `orm:"column(enabled);default(1)" json:"enabled"`
|
||||
Remark string `orm:"column(remark);size(255)" json:"remark"`
|
||||
CreateTime time.Time `orm:"column(create_time);type(datetime);auto_now_add" json:"create_time"`
|
||||
@@ -78,16 +53,12 @@ type WechatMiniTemplate struct {
|
||||
|
||||
func (m *WechatMiniTemplate) TableName() string { return "yz_platform_wechat_mini_template" }
|
||||
|
||||
// WechatMiniSubscribe 小程序订阅授权记录 yz_platform_wechat_mini_subscribe
|
||||
//
|
||||
// 微信一次性订阅消息:用户每次授权 = 1 次发送机会,发送成功即消耗 1 次。
|
||||
// 这里记录每个身份(用户)对某个模板的剩余可发送次数,避免对未授权用户反复调接口。
|
||||
type WechatMiniSubscribe struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
IdentityID uint64 `orm:"column(identity_id)" json:"identity_id"`
|
||||
AppID string `orm:"column(app_id);size(64)" json:"app_id"`
|
||||
TemplateID string `orm:"column(template_id);size(128)" json:"template_id"`
|
||||
Remain int `orm:"column(remain);default(0)" json:"remain"` // 剩余可发送次数
|
||||
Remain int `orm:"column(remain);default(0)" json:"remain"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);null" json:"update_time"`
|
||||
CreateTime time.Time `orm:"column(create_time);type(datetime);auto_now_add" json:"create_time"`
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user