mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-10-28 12:53:48 +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))
|
||||
break
|
||||
default:
|
||||
config.Session.Driver = types.SessionDriverCookie
|
||||
store = cookie.NewStore([]byte(config.Session.SecretKey))
|
||||
}
|
||||
|
||||
|
||||
@@ -113,8 +113,11 @@ func (h *ManagerHandler) Migrate(c *gin.Context) {
|
||||
var message []model.HistoryMessage
|
||||
h.db.Find(&message)
|
||||
for _, r := range message {
|
||||
r.Icon = "/" + r.Icon
|
||||
h.db.Updates(&r)
|
||||
if !strings.HasPrefix(r.Icon, "/") {
|
||||
r.Icon = "/" + r.Icon
|
||||
h.db.Updates(&r)
|
||||
}
|
||||
|
||||
}
|
||||
break
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ func (h *UserHandler) Register(c *gin.Context) {
|
||||
Username: data.Username,
|
||||
Password: utils.GenPassword(data.Password, salt),
|
||||
Nickname: fmt.Sprintf("极客学长@%d", utils.RandomNumber(5)),
|
||||
Avatar: "images/avatar/user.png",
|
||||
Avatar: "/images/avatar/user.png",
|
||||
Salt: salt,
|
||||
Status: true,
|
||||
ChatRoles: utils.JsonEncode(roleKeys),
|
||||
|
||||
@@ -45,7 +45,16 @@ func (l *AppLifecycle) OnStop(context.Context) error {
|
||||
|
||||
func main() {
|
||||
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)
|
||||
defer func() {
|
||||
if err := recover(); err != nil {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# GO api docker 镜像创建
|
||||
FROM ubuntu:22.04
|
||||
FROM registry.cn-hangzhou.aliyuncs.com/geekmaster/ubuntu-ca:22.04
|
||||
|
||||
MAINTAINER yangjian<yangjian102621@163.com>
|
||||
|
||||
|
||||
@@ -81,8 +81,8 @@ import {httpGet, httpPost} from "@/utils/http";
|
||||
import {ElMessage} from "element-plus";
|
||||
import {Plus} from "@element-plus/icons-vue";
|
||||
import Compressor from "compressorjs";
|
||||
import {showNotify} from "vant";
|
||||
|
||||
// eslint-disable-next-line no-undef
|
||||
const props = defineProps({
|
||||
show: Boolean,
|
||||
user: Object,
|
||||
@@ -140,6 +140,7 @@ const afterRead = (file) => {
|
||||
});
|
||||
};
|
||||
|
||||
// eslint-disable-next-line no-undef
|
||||
const emits = defineEmits(['hide', 'update-user']);
|
||||
const save = function () {
|
||||
httpPost('/api/user/profile/update', form.value).then(() => {
|
||||
|
||||
@@ -310,7 +310,7 @@ const getRoleById = function (rid) {
|
||||
const resizeElement = function () {
|
||||
chatBoxHeight.value = window.innerHeight - 51 - 82 - 38;
|
||||
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-form-item>
|
||||
<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-alert type="info" show-icon :closable="false">
|
||||
<p>在这里维护前端聊天页面可用的 GPT 模型列表</p>
|
||||
@@ -84,7 +84,6 @@ const system = ref({models: []})
|
||||
const chat = ref({})
|
||||
const loading = ref(true)
|
||||
const systemFormRef = ref(null)
|
||||
const tempModel = ref('')
|
||||
const models = ref([])
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
Reference in New Issue
Block a user