- 新增「简记memo」一体化小程序产品原型设计文档 - 新增简记memo完整版UI视觉设计规范和界面细节 - 添加IDEA项目配置文件.gitignore - 创建404页面HTML文件,包含响应式布局和错误提示 - 添加关于页面HTML文件,展示品牌介绍和团队信息 - 实现AES加解密工具函数,支持请求体加密 - 添加用户协议页面基础框架
25 lines
521 B
Go
25 lines
521 B
Go
// Redis初始化
|
|
package core
|
|
|
|
import (
|
|
"context"
|
|
"github.com/redis/go-redis/v9"
|
|
"simple-memo/global"
|
|
)
|
|
|
|
func InitRedis() {
|
|
client := redis.NewClient(&redis.Options{
|
|
Addr: global.VP.GetString("redis.host") + ":" + global.VP.GetString("redis.port"),
|
|
Password: global.VP.GetString("redis.password"),
|
|
DB: global.VP.GetInt("redis.db"),
|
|
})
|
|
|
|
// 测试连接
|
|
_, err := client.Ping(context.Background()).Result()
|
|
if err != nil {
|
|
panic("Redis连接失败:" + err.Error())
|
|
}
|
|
|
|
global.Redis = client
|
|
}
|