Skip to content

Commit 8a24b7c

Browse files
committed
设置proxy代理
1 parent 6012d2e commit 8a24b7c

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

backend/pkg/csqlite/mock.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import (
88

99
func MockSetting(db *gorm.DB) {
1010
db.Create(&model.Setting{
11-
ApiKey: "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",
11+
ApiKey: "",
1212
AskModel: "gpt-3.5-turbo",
1313
ChatModel: "gpt-3.5-turbo",
1414
Language: "zh-CN",
1515
Theme: 1,
16-
ProxyUrl: "",
16+
ProxyUrl: "http://127.0.0.1:7890",
1717
Account: "",
1818
AccessToken: "",
1919
IsSync: 2,

frontend/src/locale/en-US/settings.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ export default {
2727
'settings.theme.toDark': 'Dark mode',
2828
'settings.screen.toFull': 'Click to switch to full screen mode',
2929
'settings.screen.toExit': 'Click to exit the full screen mode',
30-
// 高级设置
30+
"settings.proxy": "Proxy",
31+
"settings.proxy.placeholder": "Please input a proxy address eg. http://127.0.0.1:7890",
32+
// advanced settings
3133
'settings.advanced': 'Advanced',
3234
'settings.advanced.temperature': 'Randomness (temperature)',
3335
'settings.advanced.temperature.desc': 'The larger the value, the more random the reply will be, ranging between 0 and 2. Values greater than 1 may result in garbled text.',

frontend/src/locale/zh-CN/settings.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ export default {
2727
'settings.theme.toDark': '暗黑模式',
2828
'settings.screen.toFull': '点击切换全屏模式',
2929
'settings.screen.toExit': '点击退出全屏模式',
30+
"settings.proxy": "代理",
31+
"settings.proxy.placeholder": "请输入proxy代理地址 如:http://127.0.0.1:7890",
3032
// 高级设置
3133
'settings.advanced': '高级设置',
3234
'settings.advanced.temperature': '随机性 (temperature)',

frontend/src/views/settings/components/general.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@
3535
</a-option>
3636
</a-select>
3737
</a-card>
38+
<!-- proxy -->
39+
<a-card class="card-container" :title="$t('settings.proxy')" :bordered="false"
40+
:header-style="{borderColor: 'var(--color-fill-2)', paddingLeft: '0px'}">
41+
<a-input v-model="form.proxy_url" @blur="handleGeneralSave" :placeholder="$t('settings.proxy.placeholder')"
42+
:style="{width:'460px'}"></a-input>
43+
</a-card>
3844
<!-- theme -->
3945
<a-card class="card-container" :title="$t('settings.theme')" :bordered="false"
4046
:header-style="{borderColor: 'var(--color-fill-2)', paddingLeft: '0px'}">

0 commit comments

Comments
 (0)