mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-05 16:53:46 +08:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
53fa4a20e9 | ||
|
|
43c1de51f5 | ||
|
|
7eb8c5ec35 | ||
|
|
296bf63196 | ||
|
|
6c65a21692 |
@@ -108,6 +108,7 @@ func sessionMiddleware(config *types.AppConfig) gin.HandlerFunc {
|
|||||||
store = cookie.NewStore([]byte(config.Session.SecretKey))
|
store = cookie.NewStore([]byte(config.Session.SecretKey))
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
|
config.Session.Driver = types.SessionDriverCookie
|
||||||
store = cookie.NewStore([]byte(config.Session.SecretKey))
|
store = cookie.NewStore([]byte(config.Session.SecretKey))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -113,9 +113,12 @@ func (h *ManagerHandler) Migrate(c *gin.Context) {
|
|||||||
var message []model.HistoryMessage
|
var message []model.HistoryMessage
|
||||||
h.db.Find(&message)
|
h.db.Find(&message)
|
||||||
for _, r := range message {
|
for _, r := range message {
|
||||||
|
if !strings.HasPrefix(r.Icon, "/") {
|
||||||
r.Icon = "/" + r.Icon
|
r.Icon = "/" + r.Icon
|
||||||
h.db.Updates(&r)
|
h.db.Updates(&r)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
break
|
break
|
||||||
|
|
||||||
case "avatar":
|
case "avatar":
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ func (h *UserHandler) Register(c *gin.Context) {
|
|||||||
Username: data.Username,
|
Username: data.Username,
|
||||||
Password: utils.GenPassword(data.Password, salt),
|
Password: utils.GenPassword(data.Password, salt),
|
||||||
Nickname: fmt.Sprintf("极客学长@%d", utils.RandomNumber(5)),
|
Nickname: fmt.Sprintf("极客学长@%d", utils.RandomNumber(5)),
|
||||||
Avatar: "images/avatar/user.png",
|
Avatar: "/images/avatar/user.png",
|
||||||
Salt: salt,
|
Salt: salt,
|
||||||
Status: true,
|
Status: true,
|
||||||
ChatRoles: utils.JsonEncode(roleKeys),
|
ChatRoles: utils.JsonEncode(roleKeys),
|
||||||
|
|||||||
@@ -45,7 +45,16 @@ func (l *AppLifecycle) OnStop(context.Context) error {
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
configFile := os.Getenv("CONFIG_FILE")
|
configFile := os.Getenv("CONFIG_FILE")
|
||||||
debug, _ := strconv.ParseBool(os.Getenv("DEBUG"))
|
if configFile == "" {
|
||||||
|
configFile = "config.toml"
|
||||||
|
}
|
||||||
|
var debug bool
|
||||||
|
debugEnv := os.Getenv("DEBUG")
|
||||||
|
if debugEnv == "" {
|
||||||
|
debug = true
|
||||||
|
} else {
|
||||||
|
debug, _ = strconv.ParseBool(os.Getenv("DEBUG"))
|
||||||
|
}
|
||||||
logger.Info("Loading config file: ", configFile)
|
logger.Info("Loading config file: ", configFile)
|
||||||
defer func() {
|
defer func() {
|
||||||
if err := recover(); err != nil {
|
if err := recover(); err != nil {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# GO api docker 镜像创建
|
# GO api docker 镜像创建
|
||||||
FROM ubuntu:22.04
|
FROM registry.cn-hangzhou.aliyuncs.com/geekmaster/ubuntu-ca:22.04
|
||||||
|
|
||||||
MAINTAINER yangjian<yangjian102621@163.com>
|
MAINTAINER yangjian<yangjian102621@163.com>
|
||||||
|
|
||||||
|
|||||||
@@ -81,8 +81,8 @@ import {httpGet, httpPost} from "@/utils/http";
|
|||||||
import {ElMessage} from "element-plus";
|
import {ElMessage} from "element-plus";
|
||||||
import {Plus} from "@element-plus/icons-vue";
|
import {Plus} from "@element-plus/icons-vue";
|
||||||
import Compressor from "compressorjs";
|
import Compressor from "compressorjs";
|
||||||
import {showNotify} from "vant";
|
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
show: Boolean,
|
show: Boolean,
|
||||||
user: Object,
|
user: Object,
|
||||||
@@ -140,6 +140,7 @@ const afterRead = (file) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
const emits = defineEmits(['hide', 'update-user']);
|
const emits = defineEmits(['hide', 'update-user']);
|
||||||
const save = function () {
|
const save = function () {
|
||||||
httpPost('/api/user/profile/update', form.value).then(() => {
|
httpPost('/api/user/profile/update', form.value).then(() => {
|
||||||
|
|||||||
@@ -310,7 +310,7 @@ const getRoleById = function (rid) {
|
|||||||
const resizeElement = function () {
|
const resizeElement = function () {
|
||||||
chatBoxHeight.value = window.innerHeight - 51 - 82 - 38;
|
chatBoxHeight.value = window.innerHeight - 51 - 82 - 38;
|
||||||
mainWinHeight.value = window.innerHeight - 51;
|
mainWinHeight.value = window.innerHeight - 51;
|
||||||
leftBoxHeight.value = window.innerHeight - 43 - 47 - 44;
|
leftBoxHeight.value = window.innerHeight - 43 - 47 - 45;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 新建会话
|
// 新建会话
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<el-input v-model="system['admin_title']"/>
|
<el-input v-model="system['admin_title']"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="注册赠送次数" prop="init_calls">
|
<el-form-item label="注册赠送次数" prop="init_calls">
|
||||||
<el-input v-model.number="system['init_calls']" placeholder="新用户注册赠送对话次数"/>
|
<el-input v-model.number="system['user_init_calls']" placeholder="新用户注册赠送对话次数"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-alert type="info" show-icon :closable="false">
|
<el-alert type="info" show-icon :closable="false">
|
||||||
<p>在这里维护前端聊天页面可用的 GPT 模型列表</p>
|
<p>在这里维护前端聊天页面可用的 GPT 模型列表</p>
|
||||||
@@ -84,7 +84,6 @@ const system = ref({models: []})
|
|||||||
const chat = ref({})
|
const chat = ref({})
|
||||||
const loading = ref(true)
|
const loading = ref(true)
|
||||||
const systemFormRef = ref(null)
|
const systemFormRef = ref(null)
|
||||||
const tempModel = ref('')
|
|
||||||
const models = ref([])
|
const models = ref([])
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user