Browse Source

feat:对接第三方登录。修复工作台聊天列表不显示

master
秋田弘 5 months ago
parent
commit
e4e617b835
  1. 3
      frontend/components.d.ts
  2. 55
      frontend/pnpm-lock.yaml
  3. BIN
      frontend/src/assets/login/QQ.png
  4. BIN
      frontend/src/assets/login/dingding.png
  5. BIN
      frontend/src/assets/login/gitee.png
  6. BIN
      frontend/src/assets/login/phone.png
  7. BIN
      frontend/src/assets/login/qywechat.png
  8. BIN
      frontend/src/assets/login/sina.png
  9. BIN
      frontend/src/assets/login/wechat.png
  10. 428
      frontend/src/components/chat/Chat.vue
  11. 2
      frontend/src/components/chat/ChatMenu.vue
  12. 398
      frontend/src/components/desktop/LockDesktop.vue
  13. 817
      frontend/src/components/setting/SetSystem.vue
  14. 15
      frontend/src/stores/login.ts
  15. 9
      frontend/src/system/config.ts
  16. 76
      frontend/src/system/index.ts
  17. 14
      frontend/src/system/type/type.ts
  18. 32
      go.mod
  19. 45
      go.sum

3
frontend/components.d.ts

@ -66,6 +66,7 @@ declare module 'vue' {
EditType: typeof import('./src/components/builtin/EditType.vue')['default']
ElAside: typeof import('element-plus/es')['ElAside']
ElAvatar: typeof import('element-plus/es')['ElAvatar']
ElB: typeof import('element-plus/es')['ElB']
ElBadge: typeof import('element-plus/es')['ElBadge']
ElButton: typeof import('element-plus/es')['ElButton']
ElCard: typeof import('element-plus/es')['ElCard']
@ -90,6 +91,7 @@ declare module 'vue' {
ElIcon: typeof import('element-plus/es')['ElIcon']
ElImage: typeof import('element-plus/es')['ElImage']
ElInput: typeof import('element-plus/es')['ElInput']
ElItem: typeof import('element-plus/es')['ElItem']
ElMain: typeof import('element-plus/es')['ElMain']
ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
@ -140,6 +142,7 @@ declare module 'vue' {
MessageIcon: typeof import('./src/components/taskbar/MessageIcon.vue')['default']
Mobile: typeof import('./src/components/desktop/mobile/Mobile.vue')['default']
MobileApp: typeof import('./src/components/desktop/mobile/MobileApp.vue')['default']
MobileTemplate: typeof import('./src/components/window/MobileTemplate.vue')['default']
MusicStore: typeof import('./src/components/builtin/MusicStore.vue')['default']
MusicViewer: typeof import('./src/components/builtin/MusicViewer.vue')['default']
NasClient: typeof import('./src/components/setting/NasClient.vue')['default']

55
frontend/pnpm-lock.yaml

@ -14,6 +14,9 @@ importers:
'@liripeng/vue-audio-player':
specifier: ^1.6.2
version: 1.6.2(typescript@5.6.3)
'@onlyoffice/document-editor-vue':
specifier: ^1.4.0
version: 1.4.0(vue@3.5.12(typescript@5.6.3))
cherry-markdown:
specifier: ^0.8.52
version: 0.8.52
@ -44,6 +47,12 @@ importers:
pinia-plugin-persist:
specifier: ^1.0.0
version: 1.0.0(pinia@2.2.4(typescript@5.6.3)(vue@3.5.12(typescript@5.6.3)))(vue@3.5.12(typescript@5.6.3))
swiper:
specifier: ^11.1.15
version: 11.2.0
vant:
specifier: ^4.9.15
version: 4.9.15(vue@3.5.12(typescript@5.6.3))
vue:
specifier: ^3.4.31
version: 3.5.12(typescript@5.6.3)
@ -317,6 +326,11 @@ packages:
resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==}
engines: {node: '>= 8'}
'@onlyoffice/document-editor-vue@1.4.0':
resolution: {integrity: sha512-Fg5gSc1zF6bmpRapUd7rMpm7kEDF7mQIHQKfcsfJcILdFX9bwIhnkXEucETEA9zdt92nWMS6qiAgVeT61TdCyw==}
peerDependencies:
vue: ^3.0.0
'@parcel/watcher-android-arm64@2.4.1':
resolution: {integrity: sha512-LOi/WTbbh3aTn2RYddrO8pnapixAziFl6SMxHM69r3tvdSm94JtCenaKgk1GRg5FJ5wpMCpHeW+7yqPlvZv7kg==}
engines: {node: '>= 10.0.0'}
@ -533,6 +547,14 @@ packages:
'@types/web-bluetooth@0.0.16':
resolution: {integrity: sha512-oh8q2Zc32S6gd/j50GowEjKLoOVOwHP/bWVjKJInBwQqdOYMdPrf1oVlelTlyfFK3CKxL1uahMDAr+vy8T7yMQ==}
'@vant/popperjs@1.3.0':
resolution: {integrity: sha512-hB+czUG+aHtjhaEmCJDuXOep0YTZjdlRR+4MSmIFnkCQIxJaXLQdSsR90XWvAI2yvKUI7TCGqR8pQg2RtvkMHw==}
'@vant/use@1.6.0':
resolution: {integrity: sha512-PHHxeAASgiOpSmMjceweIrv2AxDZIkWXyaczksMoWvKV2YAYEhoizRuk/xFnKF+emUIi46TsQ+rvlm/t2BBCfA==}
peerDependencies:
vue: ^3.0.0
'@vitejs/plugin-vue@5.1.4':
resolution: {integrity: sha512-N2XSI2n3sQqp5w7Y/AN/L2XDjBIRGqXko+eDp42sydYSBeJuSm5a1sLf8zakmo8u7tA8NmBgoDLA1HeOESjp9A==}
engines: {node: ^18.0.0 || >=20.0.0}
@ -572,6 +594,9 @@ packages:
'@vue/shared@3.5.12':
resolution: {integrity: sha512-L2RPSAwUFbgZH20etwrXyVyCBu9OxRSi8T/38QsvnkJyvq2LufW2lDCOzm7t/U9C1mkhJGWYfCuFBCmIuNivrg==}
'@vue/shared@3.5.13':
resolution: {integrity: sha512-/hnE/qP5ZoGpol0a5mDi45bOd7t3tjYJBjsgCsivow7D48cJeV5l05RD82lPqi7gRiphZM37rnhW1l6ZoCNNnQ==}
'@vueuse/core@9.13.0':
resolution: {integrity: sha512-pujnclbeHWxxPRqXWmdkKV5OX4Wk4YeK7wusHqRwU0Q7EFusHoqNA/aPhB6KCh9hEqJkLAJo7bb0Lh9b+OIVzw==}
@ -1270,6 +1295,10 @@ packages:
stylis@4.3.4:
resolution: {integrity: sha512-osIBl6BGUmSfDkyH2mB7EFvCJntXDrLhKjHTRj/rK6xLH0yuPrHULDRQzKokSOD4VoorhtKpfcfW1GAntu8now==}
swiper@11.2.0:
resolution: {integrity: sha512-rjjAKgDEs+grR2eQshVDCcE4KNPC7CI294nfcbV9gE8WCsLdvOYXDeZKUYevqAZZp8j5hE7kpT3dAGVKFBWlxQ==}
engines: {node: '>= 4.7.0'}
symbol-tree@3.2.4:
resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==}
@ -1366,6 +1395,11 @@ packages:
resolution: {integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==}
hasBin: true
vant@4.9.15:
resolution: {integrity: sha512-XyIAnoGu2P/dc5R2NnjIJgKwfOTTVM2FJW/8WpsZA0FUBL6Lu+KHBaAY/x3IduwbowkaCIUUPViUopI2JSjbug==}
peerDependencies:
vue: ^3.0.0
vite@5.4.9:
resolution: {integrity: sha512-20OVpJHh0PAM0oSOELa5GaZNWeDjcAvQjGXy2Uyr+Tp+/D2/Hdz6NLgpJLsarPTA2QJ6v8mX2P1ZfbsSKvdMkg==}
engines: {node: ^18.0.0 || >=20.0.0}
@ -1667,6 +1701,10 @@ snapshots:
'@nodelib/fs.scandir': 2.1.5
fastq: 1.17.1
'@onlyoffice/document-editor-vue@1.4.0(vue@3.5.12(typescript@5.6.3))':
dependencies:
vue: 3.5.12(typescript@5.6.3)
'@parcel/watcher-android-arm64@2.4.1':
optional: true
@ -1813,6 +1851,12 @@ snapshots:
'@types/web-bluetooth@0.0.16': {}
'@vant/popperjs@1.3.0': {}
'@vant/use@1.6.0(vue@3.5.12(typescript@5.6.3))':
dependencies:
vue: 3.5.12(typescript@5.6.3)
'@vitejs/plugin-vue@5.1.4(vite@5.4.9(@types/node@20.16.13)(sass@1.80.3)(terser@5.36.0))(vue@3.5.12(typescript@5.6.3))':
dependencies:
vite: 5.4.9(@types/node@20.16.13)(sass@1.80.3)(terser@5.36.0)
@ -1874,6 +1918,8 @@ snapshots:
'@vue/shared@3.5.12': {}
'@vue/shared@3.5.13': {}
'@vueuse/core@9.13.0(vue@3.5.12(typescript@5.6.3))':
dependencies:
'@types/web-bluetooth': 0.0.16
@ -2696,6 +2742,8 @@ snapshots:
stylis@4.3.4:
optional: true
swiper@11.2.0: {}
symbol-tree@3.2.4: {}
terser@5.36.0:
@ -2811,6 +2859,13 @@ snapshots:
uuid@9.0.1:
optional: true
vant@4.9.15(vue@3.5.12(typescript@5.6.3)):
dependencies:
'@vant/popperjs': 1.3.0
'@vant/use': 1.6.0(vue@3.5.12(typescript@5.6.3))
'@vue/shared': 3.5.13
vue: 3.5.12(typescript@5.6.3)
vite@5.4.9(@types/node@20.16.13)(sass@1.80.3)(terser@5.36.0):
dependencies:
esbuild: 0.21.5

BIN
frontend/src/assets/login/QQ.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

BIN
frontend/src/assets/login/dingding.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
frontend/src/assets/login/gitee.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
frontend/src/assets/login/phone.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
frontend/src/assets/login/qywechat.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

BIN
frontend/src/assets/login/sina.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

BIN
frontend/src/assets/login/wechat.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

428
frontend/src/components/chat/Chat.vue

@ -1,46 +1,46 @@
<script setup lang="ts">
import { useChatStore } from "@/stores/chat";
import { getWorkflowUrl } from "@/system/config";
import { Search } from "@element-plus/icons-vue";
const store = useChatStore();
const workUrl = getWorkflowUrl();
onMounted(() => {
store.initChat();
});
import { useChatStore } from "@/stores/chat";
import { getWorkflowUrl } from "@/system/config";
import { Search } from "@element-plus/icons-vue";
const store = useChatStore();
const workUrl = getWorkflowUrl();
onMounted(() => {
store.initChat();
});
const generateData = () => {
return store.allUserList.map((user: any) => ({
key: user.id,
label: user.nickname,
avatar: user.avatar, //
}));
};
const generateData = () => {
return store.allUserList.map((user: any) => ({
key: user.id,
label: user.nickname,
avatar: user.avatar, //
}));
};
const data = ref(generateData());
// users any[]
let users = ref<any[]>([]);
const myTransfer = ref()
const data = ref(generateData());
// users any[]
let users = ref<any[]>([]);
const myTransfer = ref();
watchEffect(() => {
if (store.allUserList.length > 0) {
data.value = generateData();
}
});
watchEffect(() => {
if (store.allUserList.length > 0) {
data.value = generateData();
}
});
// searchList
watch(
() => store.searchInput,
(newSearchInput) => {
if (newSearchInput === "") {
store.searchList = []; //
} else {
store.searchList = store.chatList.filter(
(user: { displayName: string | string[] }) =>
user.displayName.includes(newSearchInput)
);
// searchList
watch(
() => store.searchInput,
(newSearchInput) => {
if (newSearchInput === "") {
store.searchList = []; //
} else {
store.searchList = store.chatList.filter(
(user: { displayName: string | string[] }) =>
user.displayName.includes(newSearchInput)
);
}
}
}
);
);
</script>
<template>
<el-container class="container">
@ -48,13 +48,24 @@ watch(
<el-aside class="menu">
<chat-menu />
</el-aside>
<el-container class="side" v-if="store.currentNavId < 4">
<el-container
class="side"
v-if="store.currentNavId < 4"
>
<!--搜索栏-->
<template v-if="store.currentNavId < 2">
<div v-if="store.currentNavId < 2">
<el-header class="search">
<el-input placeholder="搜索" :prefix-icon="Search" class="search-input" v-model="store.searchInput" />
<el-input
placeholder="搜索"
:prefix-icon="Search"
class="search-input"
v-model="store.searchInput"
/>
<!-- 邀请群聊 -->
<button class="inviteGroupChats" @click="store.setGroupChatInvitedDialogVisible(true)">
<button
class="inviteGroupChats"
@click="store.setGroupChatInvitedDialogVisible(true)"
>
<el-icon>
<Plus />
</el-icon>
@ -67,7 +78,7 @@ watch(
<chat-user-list v-if="store.currentNavId == 1" />
</el-scrollbar>
</el-main>
</template>
</div>
<ai-chat-left v-if="store.currentNavId == 3" />
</el-container>
<el-container class="chat-box">
@ -75,35 +86,68 @@ watch(
<chat-user-info v-if="store.currentNavId == 1"></chat-user-info>
<ai-chat-main v-if="store.currentNavId == 3" />
</el-container>
<el-container class="chat-setting" v-if="store.currentNavId == 2">
<iframe class="workflow" :src="workUrl"></iframe>
<el-container
class="chat-setting"
v-if="store.currentNavId == 2"
>
<iframe
class="workflow"
:src="workUrl"
></iframe>
</el-container>
<el-container class="chat-setting" v-if="store.currentNavId == 5">
<el-container
class="chat-setting"
v-if="store.currentNavId == 5"
>
<ChatUserSetting />
</el-container>
</el-container>
<!-- 邀请群聊弹窗 -->
<el-dialog v-model="store.groupChatInvitedDialogVisible" width="80%" title="创建群聊" style="height: 550px"
align-center>
<el-dialog
v-model="store.groupChatInvitedDialogVisible"
width="80%"
title="创建群聊"
style="height: 550px"
align-center
>
<div class="dialog-body">
<!-- 添加输入部门名的输入框 -->
<div>
<el-form label-position="top">
<el-form-item label="群聊名称:">
<el-input maxlength="8" show-word-limit style="width: 240px; height: 30px"
class="department-name" v-model="store.departmentName" placeholder="请输入群聊名称"></el-input>
<el-input
maxlength="8"
show-word-limit
style="width: 240px; height: 30px"
class="department-name"
v-model="store.departmentName"
placeholder="请输入群聊名称"
></el-input>
</el-form-item>
</el-form>
</div>
<!-- 使用 Element el-transfer 组件替换自定义穿梭框 -->
<el-transfer v-model="users" :data="data" :titles="['可选项', '已选项']" filterable style="height: 250px"
filter-placeholder="搜索用户名" :props="{ key: 'key', label: 'label', avatar: 'avatar' }"
:left-default-checked="[]" class="transfer-container" ref="myTransfer">
<el-transfer
v-model="users"
:data="data"
:titles="['可选项', '已选项']"
filterable
style="height: 250px"
filter-placeholder="搜索用户名"
:props="{ key: 'key', label: 'label', avatar: 'avatar' }"
:left-default-checked="[]"
class="transfer-container"
ref="myTransfer"
>
<!-- 自定义穿梭框列表项模板 -->
<template #default="{ option }">
<el-avatar :src="option.avatar" size="small" style="margin-right: 5px" />
<el-avatar
:src="option.avatar"
size="small"
style="margin-right: 5px"
/>
<span>{{ option.label }}</span>
</template>
</el-transfer>
@ -111,169 +155,175 @@ watch(
<template #footer>
<span class="dialog-footer">
<el-button style="background-color: #0078d4; color: #fff"
@click="store.groupChatInvitedDialogVisible = false">取消</el-button>
<el-button style="background-color: #0078d4; color: #fff"
@click="store.createGroupChat(users)">确定</el-button>
<el-button
style="background-color: #0078d4; color: #fff"
@click="store.groupChatInvitedDialogVisible = false"
>取消</el-button
>
<el-button
style="background-color: #0078d4; color: #fff"
@click="store.createGroupChat(users)"
>确定</el-button
>
</span>
</template>
</el-dialog>
</template>
<style scoped>
:deep(.el-transfer) {
display: flex;
flex-direction: row;
/* 将布局方向设置为横向 */
width: 550px;
/* 让穿梭框占满宽度 */
justify-content: center;
align-items: center;
.el-transfer__buttons {
:deep(.el-transfer) {
display: flex;
justify-content: space-evenly;
flex-direction: row;
/* 将布局方向设置为横向 */
width: 550px;
/* 让穿梭框占满宽度 */
justify-content: center;
align-items: center;
width: 120px;
padding: 0 0 !important;
.el-button {
width: 40px !important;
height: 30px !important;
background-color: #0078d4;
color: #fff;
.el-transfer__buttons {
display: flex;
justify-content: space-evenly;
align-items: center;
width: 120px;
padding: 0 0 !important;
.el-button {
width: 40px !important;
height: 30px !important;
background-color: #0078d4;
color: #fff;
}
}
}
}
::v-deep .el-dialog .el-dialog__header {
border: none !important;
}
::v-deep .el-dialog .el-dialog__header {
border: none !important;
}
::v-deep .el-transfer-panel {
width: 270px !important;
/* 设置每个穿梭框面板的宽度 */
height: 250px !important;
}
::v-deep .el-transfer-panel {
width: 270px !important;
/* 设置每个穿梭框面板的宽度 */
height: 250px !important;
}
::v-deep .el-transfer-panel__body {
height: 200px !important;
}
::v-deep .el-transfer-panel__body {
height: 200px !important;
}
::v-deep .el-checkbox__label {
margin-left: 10px !important;
}
::v-deep .el-checkbox__label {
margin-left: 10px !important;
}
.container {
display: flex;
height: 100%;
width: 100%;
overflow-y: hidden;
overflow-x: hidden;
border-top: 1px solid #e8e8e8;
}
.container {
display: flex;
height: 100%;
width: 100%;
overflow-y: hidden;
overflow-x: hidden;
border-top: 1px solid #e8e8e8;
}
.menu {
width: 55px;
background-color: #ffffff;
overflow-y: hidden;
overflow-x: hidden;
-webkit-app-region: drag;
}
.menu {
width: 55px;
background-color: #ffffff;
overflow-y: hidden;
overflow-x: hidden;
-webkit-app-region: drag;
}
.side {
flex: 1;
/* 占据剩余宽度 */
/* max-width: 200px; */
/* min-width: 200px; */
min-height: 650px;
max-height: max-content;
border-right: 1px solid #e8e8e8;
overflow-y: hidden;
overflow-x: hidden;
}
.side {
flex: 1;
/* 占据剩余宽度 */
/* max-width: 200px; */
/* min-width: 200px; */
min-height: 650px;
max-height: max-content;
border-right: 1px solid #e8e8e8;
overflow-y: hidden;
overflow-x: hidden;
}
.search {
display: flex;
align-items: center;
justify-content: space-evenly;
width: 100%;
height: 50px;
padding: 0;
padding-right: 10px;
-webkit-app-region: drag;
border-bottom: 1px solid #e8e8e8;
border-left: 1px solid #e8e8e8;
}
.search {
display: flex;
align-items: center;
justify-content: space-evenly;
width: 100%;
height: 50px;
padding: 0;
padding-right: 10px;
-webkit-app-region: drag;
border-bottom: 1px solid #e8e8e8;
border-left: 1px solid #e8e8e8;
}
.inviteGroupChats {
width: 40px;
height: 30px;
border: none;
border-radius: 4px;
background-color: #f0f0f0;
}
.inviteGroupChats {
width: 40px;
height: 30px;
border: none;
border-radius: 4px;
background-color: #f0f0f0;
}
.user-item {
width: 100%;
height: 30px;
display: flex;
align-items: center;
}
.user-item {
width: 100%;
height: 30px;
display: flex;
align-items: center;
}
.search-input {
width: calc(100% - 20px);
margin: 10px;
height: 32px;
-webkit-app-region: no-drag;
--el-input-placeholder-color: #bfbfbf !important;
--el-input-icon-color: #bfbfbf !important;
}
.search-input {
width: calc(100% - 20px);
margin: 10px;
height: 32px;
-webkit-app-region: no-drag;
--el-input-placeholder-color: #bfbfbf !important;
--el-input-icon-color: #bfbfbf !important;
}
.list {
width: 100%;
height: 100%;
padding: 0;
overflow-y: hidden;
overflow-x: hidden;
border-left: 1px solid #e8e8e8;
}
.list {
width: 100%;
height: 100%;
padding: 0;
overflow-y: hidden;
overflow-x: hidden;
border-left: 1px solid #e8e8e8;
}
.dialog-body {
width: 100%;
height: 350px;
}
.dialog-body {
width: 100%;
height: 350px;
}
.chat-box {
flex: 3;
width: 100%;
height: 100%;
max-height: max-content;
background-color: #ffffff;
}
.chat-box {
flex: 3;
width: 100%;
height: 100%;
max-height: max-content;
background-color: #ffffff;
}
.chat-setting {
width: calc(100% - 65px);
height: 100%;
overflow: hidden;
}
.chat-setting {
width: calc(100% - 65px);
height: 100%;
overflow: hidden;
}
.workflow {
width: 100%;
height: 100%;
object-fit: contain;
border: none;
}
.workflow {
width: 100%;
height: 100%;
object-fit: contain;
border: none;
}
.no-message-container {
height: 100%;
margin: 120px auto;
text-align: center;
font-size: 14px;
justify-content: center;
}
.no-message-container {
height: 100%;
margin: 120px auto;
text-align: center;
font-size: 14px;
justify-content: center;
}
.department-name {
margin: 10px 0;
}
.department-name {
margin: 10px 0;
}
</style>

2
frontend/src/components/chat/ChatMenu.vue

@ -8,7 +8,7 @@ const store = useChatStore();
<template>
<!-- 头像 -->
<el-row>
<el-avatar shape="square" :size="40" class="userAvatar" :src="store.userInfo.avatar" />
<el-avatar shape="square" :size="30" class="userAvatar" :src="store.userInfo.avatar" />
</el-row>
<!-- 菜单按钮 -->

398
frontend/src/components/desktop/LockDesktop.vue

@ -15,134 +15,153 @@
/>
</el-avatar>
</div>
<el-form
v-if="!isRegisterMode"
label-position="left"
label-width="0px"
>
<el-form-item>
<el-input
v-model="userName"
placeholder="请输入用户名"
autofocus
prefix-icon="UserFilled"
></el-input>
</el-form-item>
<el-form-item v-if="!sys._options.noPassword">
<el-input
v-model="userPassword"
type="password"
placeholder="请输入登录密码"
show-password
prefix-icon="Key"
@keyup.enter="onLogin"
></el-input>
</el-form-item>
<el-button
type="primary"
@click="onLogin"
>登录</el-button
<div v-if="store.page == 'login'">
<el-form
v-if="!isRegisterMode"
label-position="left"
label-width="0px"
>
<div class="divider">
<span>第三方登录</span>
</div>
<div class="third-party-login">
<img
v-for="platform in thirdPartyPlatforms"
:key="platform.name"
:src="platform.icon"
:alt="platform.name"
style="
width: 25px;
height: 25px;
cursor: pointer;
color: #409eff;
"
@click="onThirdPartyLogin(platform.name)"
/>
</div>
<div
class="actions"
>
<a
href="#"
@click.prevent="toggleRegister"
>注册新用户</a
<el-form-item>
<el-input
v-model="userName"
placeholder="请输入用户名"
autofocus
prefix-icon="UserFilled"
></el-input>
</el-form-item>
<el-form-item v-if="!sys._options.noPassword">
<el-input
v-model="userPassword"
type="password"
placeholder="请输入登录密码"
show-password
prefix-icon="Key"
@keyup.enter="onLogin"
></el-input>
</el-form-item>
<el-button
type="primary"
@click="onLogin"
>登录</el-button
>
<a
href="#"
@click.prevent="toggleUserSwitch"
>切换角色</a
>
</div>
</el-form>
<el-form
v-else
label-position="left"
label-width="0px"
:model="regForm"
ref="regFormRef"
:rules="rules"
>
<el-form-item prop="username">
<el-input
v-model="regForm.username"
placeholder="请输入用户名"
prefix-icon="UserFilled"
></el-input>
</el-form-item>
<el-form-item prop="nickname">
<el-input
v-model="regForm.nickname"
placeholder="请输入真实姓名"
prefix-icon="Avatar"
></el-input>
</el-form-item>
<el-form-item prop="email">
<el-input
v-model="regForm.email"
placeholder="请输入邮箱"
prefix-icon="Message"
></el-input>
</el-form-item>
<el-form-item prop="phone">
<el-input
v-model="regForm.phone"
placeholder="请输入手机号"
prefix-icon="Iphone"
></el-input>
</el-form-item>
<el-form-item prop="password">
<el-input
v-model="regForm.password"
type="password"
placeholder="请输入密码"
show-password
prefix-icon="Key"
></el-input>
</el-form-item>
<el-form-item prop="confirmPassword">
<el-input
v-model="regForm.confirmPassword"
type="password"
placeholder="请再次输入密码"
show-password
prefix-icon="Lock"
></el-input>
</el-form-item>
<el-button
type="primary"
@click="onRegister"
>注册</el-button
<div class="divider">
<span>第三方登录</span>
</div>
<div class="third-party-login">
<img
v-for="platform in thirdPartyPlatforms"
:key="platform.name"
:src="platform.icon"
:alt="platform.name"
style="
width: 25px;
height: 25px;
cursor: pointer;
color: #409eff;
"
@click="onThirdPartyLogin(platform.name)"
/>
</div>
<div class="actions">
<a
href="#"
@click.prevent="toggleRegister"
>注册新用户</a
>
<a
href="#"
@click.prevent="toggleUserSwitch"
>切换角色</a
>
</div>
</el-form>
<el-form
v-else
label-position="left"
label-width="0px"
:model="regForm"
ref="regFormRef"
:rules="rules"
>
<div class="actions">
<a
href="#"
@click.prevent="toggleRegister"
>返回登录</a
<el-form-item prop="username">
<el-input
v-model="regForm.username"
placeholder="请输入用户名"
prefix-icon="UserFilled"
></el-input>
</el-form-item>
<el-form-item prop="nickname">
<el-input
v-model="regForm.nickname"
placeholder="请输入真实姓名"
prefix-icon="Avatar"
></el-input>
</el-form-item>
<el-form-item prop="email">
<el-input
v-model="regForm.email"
placeholder="请输入邮箱"
prefix-icon="Message"
></el-input>
</el-form-item>
<el-form-item prop="phone">
<el-input
v-model="regForm.phone"
placeholder="请输入手机号"
prefix-icon="Iphone"
></el-input>
</el-form-item>
<el-form-item prop="password">
<el-input
v-model="regForm.password"
type="password"
placeholder="请输入密码"
show-password
prefix-icon="Key"
></el-input>
</el-form-item>
<el-form-item prop="confirmPassword">
<el-input
v-model="regForm.confirmPassword"
type="password"
placeholder="请再次输入密码"
show-password
prefix-icon="Lock"
></el-input>
</el-form-item>
<el-button
type="primary"
@click="onRegister"
>注册</el-button
>
</div>
</el-form>
<div class="actions">
<a
href="#"
@click.prevent="toggleRegister"
>返回登录</a
>
</div>
</el-form>
</div>
<div v-else-if="store.page == 'setphone'">
<el-form>
<el-form-item>
<el-input
v-model="userName"
placeholder="请输入手机号"
autofocus
prefix-icon="Iphone"
></el-input>
</el-form-item>
<el-form-item>
<el-button
type="primary"
@click="setPhone"
>确定</el-button
>
</el-form-item>
</el-form>
</div>
</el-card>
</div>
</template>
@ -153,7 +172,7 @@
import { getSystemConfig, setSystemConfig } from "@/system/config";
import router from "@/system/router";
import { RestartApp } from "@/util/goutil";
import { notifyError } from "@/util/msg";
import { notifyError, notifySuccess } from "@/util/msg";
import { onMounted, ref, watchEffect } from "vue";
import { useRoute } from "vue-router";
const route = useRoute();
@ -164,19 +183,52 @@
const lockClassName = ref("screen-show");
const isRegisterMode = ref(false);
onMounted(() => {
getThirdpartyList();
});
const getThirdpartyList = async () => {
const result = await fetch(
config.userInfo.url + "/user/thirdparty/list"
);
if (result.ok) {
const data = await result.json();
console.log(data, "data");
}
};
const setPhone = async () => {
console.log("123");
const res = await fetch(config.userInfo.url + "/user/editdata", {
method: "POST",
body: JSON.stringify({
phone: userName.value,
}),
headers: {
ClientID: store.tempClientId,
Authorization: store.tempToken,
},
});
if (res.ok) {
notifySuccess("手机号设置成功");
} else {
notifyError("手机号设置失败");
}
};
const thirdPartyPlatforms = [
// {
// name: "wechat",
// icon: new URL("@/assets/login/wechat.png", import.meta.url).href,
// },
// {
// name: "qq",
// icon: new URL("@/assets/login/qq.png", import.meta.url).href,
// },
// {
// name: "sina",
// icon: new URL("@/assets/login/sina.png", import.meta.url).href,
// },
{
name: "qywechat",
icon: new URL("@/assets/login/qywechat.png", import.meta.url).href,
},
{
name: "dingding",
icon: new URL("@/assets/login/dingding.png", import.meta.url).href,
},
{
name: "phone",
icon: new URL("@/assets/login/phone.png", import.meta.url).href,
},
{
name: "github",
icon: new URL("@/assets/login/github.png", import.meta.url).href,
@ -211,55 +263,46 @@
watchEffect(() => {
const code = route.query.code;
if (code) {
console.log(code, "---");
console.log("code:", code);
onLogin();
}
});
const onLogin = async () => {
//localStorage.removeItem("godoosClientId");
async function onLogin() {
if (loginCallback) {
const platform = store.ThirdPartyPlatform;
const platform = localStorage.getItem("ThirdPartyPlatform");
const code = router.currentRoute.value.query.code as string;
console.log(platform, "platform");
// 使
const platformCodeMap: Record<string, string> = {
github: "github_code",
gitee: "gitee_code",
wechat: "wechat_code",
qq: "qq_code",
github: "github",
gitee: "gitee",
wechat: "wechat",
qq: "qq",
};
//
const codeParam = platform ? platformCodeMap[platform] : null;
let res;
if (codeParam) {
//
const returnedState = router.currentRoute.value.query
.state as string;
//
const login_type = codeParam ? codeParam : "password";
console.log(login_type, "login_type");
if (returnedState !== store.State) {
notifyError("登录失败,请重试");
return;
}
const param = codeParam
? { code: code }
: { username: userName.value, password: userPassword.value };
res = await loginCallback(userName.value, userPassword.value, {
[codeParam]: code,
});
} else {
//
res = await loginCallback(userName.value, userPassword.value);
}
const res = await loginCallback(login_type, param);
if (res) {
store.ThirdPartyPlatform = null;
localStorage.removeItem("ThirdPartyPlatform");
loginSuccess();
} else {
notifyError("登录失败,请重试");
}
}
};
}
const toggleRegister = () => {
isRegisterMode.value = !isRegisterMode.value;
@ -365,36 +408,21 @@
};
const onThirdPartyLogin = async (platform: string) => {
localStorage.setItem("ThirdPartyPlatform", platform);
let loginFunction: (() => Promise<boolean>) | undefined;
//
store.ThirdPartyPlatform = platform;
switch (platform) {
case "github":
// GitHub
loginFunction = async function () {
return await authWithGithub();
};
break;
case "wechat":
loginFunction = async function () {
return await authWithWechat();
};
break;
case "qq":
loginFunction = async function () {
return await authWithQQ();
};
break;
case "sina":
loginFunction = async function () {
return await authWithSina();
};
break;
case "gitee":
loginFunction = async function () {
return await authWithGitee();
};
break;
//
default:
notifyError("不支持的第三方登录平台");
return;
@ -414,7 +442,8 @@
store.State = state;
// url
const currentUrl = window.location.href;
const url = config.userInfo.url + "/github/authorize?state=" + state;
const url =
config.userInfo.url + "/user/github/authorize?state=" + state;
const res: any = await fetch(url, {
method: "POST",
body: JSON.stringify({
@ -461,7 +490,8 @@
store.State = state;
// url
const currentUrl = window.location.href;
const url = config.userInfo.url + "/gitee/authorize?state=" + state;
const url =
config.userInfo.url + "/user/gitee/authorize?state=" + state;
const res: any = await fetch(url, {
method: "POST",
body: JSON.stringify({
@ -487,6 +517,8 @@
notifyError("获取授权URL失败");
return false;
}
// store.page = "phone";
// return true;
};
</script>

817
frontend/src/components/setting/SetSystem.vue

@ -2,53 +2,87 @@
<div class="container">
<div class="nav">
<ul>
<li v-for="(item, index) in items" :key="index" @click="selectItem(index)"
:class="{ active: index === activeIndex }">
<li
v-for="(item, index) in items"
:key="index"
@click="selectItem(index)"
:class="{ active: index === activeIndex }"
>
{{ item }}
</li>
</ul>
</div>
<div class="setting">
<div v-if="1 === activeIndex">
<div class="setting-item" style="margin-top: 60px">
<div
class="setting-item"
style="margin-top: 60px"
>
<label>存储方式</label>
<el-select v-model="config.storeType">
<el-option v-for="(item, key) in storeList" :key="key" :label="item.title"
:value="item.value" />
<el-option
v-for="(item, key) in storeList"
:key="key"
:label="item.title"
:value="item.value"
/>
</el-select>
</div>
<template v-if="config.storeType === 'local'">
<div class="setting-item">
<label>存储地址</label>
<el-input v-model="config.storePath" @click="selectFile()"
placeholder="可为空,为空则取系统默认存储地址:/用户目录/.godoos/os" />
<el-input
v-model="config.storePath"
@click="selectFile()"
placeholder="可为空,为空则取系统默认存储地址:/用户目录/.godoos/os"
/>
</div>
<div class="setting-item">
<label>自定义端口</label>
<el-input v-model="config.netPort" placeholder="可为空,为空则取系统默认56780" />
<el-input
v-model="config.netPort"
placeholder="可为空,为空则取系统默认56780"
/>
</div>
<div class="setting-item">
<label>自定义路径</label>
<el-input v-model="config.netPath" placeholder="自定义web访问路径,英文,不要加斜杠,可为空" />
<el-input
v-model="config.netPath"
placeholder="自定义web访问路径,英文,不要加斜杠,可为空"
/>
</div>
</template>
<template v-if="config.storeType === 'net'">
<div class="setting-item">
<label>服务器地址</label>
<el-input v-model="config.storenet.url" placeholder="可访问的地址,例如http://192.168.1.6:56780 不要加斜杠" />
<el-input
v-model="config.storenet.url"
placeholder="可访问的地址,例如http://192.168.1.6:56780 不要加斜杠"
/>
</div>
<div class="setting-item">
<label>允许跨域</label>
<el-switch v-model="config.storenet.isCors" active-text="允许" inactive-text="不允许"
style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949" active-value="1"
inactive-value="" />
<el-switch
v-model="config.storenet.isCors"
active-text="允许"
inactive-text="不允许"
style="
--el-switch-on-color: #13ce66;
--el-switch-off-color: #ff4949;
"
active-value="1"
inactive-value=""
/>
</div>
</template>
<template v-if="config.storeType === 'webdav'">
<div class="setting-item">
<label>服务器地址</label>
<el-input v-model="config.webdavClient.url" placeholder="https://godoos.com/webdav 不要加斜杠" />
<el-input
v-model="config.webdavClient.url"
placeholder="https://godoos.com/webdav 不要加斜杠"
/>
</div>
<div class="setting-item">
<label>登陆用户名</label>
@ -56,30 +90,46 @@
</div>
<div class="setting-item">
<label>登陆密码</label>
<el-input v-model="config.webdavClient.password" type="password" />
<el-input
v-model="config.webdavClient.password"
type="password"
/>
</div>
</template>
<div class="setting-item">
<label></label>
<el-button @click="submitOsInfo" type="primary">
<el-button
@click="submitOsInfo"
type="primary"
>
{{ t("confirm") }}
</el-button>
</div>
</div>
<div v-if="2 === activeIndex">
<div class="setting-item" style="margin-top: 60px">
<div
class="setting-item"
style="margin-top: 60px"
>
<label>编辑器类型</label>
<el-select v-model="config.editorType">
<el-option v-for="(item, key) in editorType" :key="key" :label="item.title"
:value="item.value" />
<el-option
v-for="(item, key) in editorType"
:key="key"
:label="item.title"
:value="item.value"
/>
</el-select>
</div>
<template v-if="config.editorType === 'onlyoffice'">
<div class="setting-item">
<label>地址</label>
<el-input v-model="config.onlyoffice.url" placeholder="https://godoos.com/onlyoffice 不要加斜杠" />
<el-input
v-model="config.onlyoffice.url"
placeholder="https://godoos.com/onlyoffice 不要加斜杠"
/>
</div>
<!-- <div class="setting-item">
<label>私钥</label>
@ -88,7 +138,10 @@
</template>
<div class="setting-item">
<label></label>
<el-button @click="submitEditInfo" type="primary">
<el-button
@click="submitEditInfo"
type="primary"
>
{{ t("confirm") }}
</el-button>
</div>
@ -99,7 +152,10 @@
</div>
<div class="setting-item">
<label></label>
<el-button @click="exportBackup" type="primary">
<el-button
@click="exportBackup"
type="primary"
>
导出
</el-button>
</div>
@ -108,42 +164,73 @@
</div>
<div class="setting-item">
<label></label>
<el-button @click="selectZipfile" type="primary">
<el-button
@click="selectZipfile"
type="primary"
>
导入
</el-button>
<input type="file" accept=".zip" style="display: none" ref="zipFileInput" />
<input
type="file"
accept=".zip"
style="display: none"
ref="zipFileInput"
/>
</div>
</div>
<div v-if="0 === activeIndex">
<div class="setting-item" style="margin-top: 60px">
<div
class="setting-item"
style="margin-top: 60px"
>
<label>用户角色</label>
<el-select v-model="config.userType">
<el-option v-for="(item, key) in userTypes" :key="key" :label="item.title"
:value="item.value" />
<el-option
v-for="(item, key) in userTypes"
:key="key"
:label="item.title"
:value="item.value"
/>
</el-select>
</div>
<template v-if="config.userType === 'member'">
<div class="setting-item">
<label>服务器地址</label>
<el-input v-model="config.userInfo.url" placeholder="网址或域名,例子:https://godoos.com 不要加斜杠" />
<el-input
v-model="config.userInfo.url"
placeholder="网址或域名,例子:https://godoos.com 不要加斜杠"
/>
</div>
<div class="setting-item">
<label>用户名</label>
<el-input v-model="config.userInfo.username" placeholder="登录用户名" />
<el-input
v-model="config.userInfo.username"
placeholder="登录用户名"
/>
</div>
<div class="setting-item">
<label>密码</label>
<el-input v-model="config.userInfo.password" type="password" placeholder="登录密码" />
<el-input
v-model="config.userInfo.password"
type="password"
placeholder="登录密码"
/>
</div>
</template>
<div class="setting-item">
<label></label>
<el-button @click="saveUserInfo" type="primary">
<el-button
@click="saveUserInfo"
type="primary"
>
{{ t("confirm") }}
</el-button>
</div>
</div>
<div v-if="4 === activeIndex" class="setting-area">
<div
v-if="4 === activeIndex"
class="setting-area"
>
<SetFilePwd v-if="config.userType === 'person'"></SetFilePwd>
</div>
</div>
@ -151,123 +238,85 @@
</template>
<script lang="ts" setup>
import { Dialog, join, System, t } from "@/system";
import { GetClientId } from "@/util/clientid.ts";
import {
getSystemConfig,
setSystemConfig,
} from "@/system/config";
import { OpenDirDialog, RestartApp } from "@/util/goutil";
import { notifyError, notifySuccess } from "@/util/msg";
import FileSaver from "file-saver";
import JSZip from "jszip";
import { inject, ref } from "vue";
const config = ref(getSystemConfig());
const sys = inject<System>("system")!;
let zipFile: File | undefined = undefined;
const zipFileInput = ref();
const fileName: any = ref("");
const storeList = [
// {
// title: "",
// value: "browser",
// },
{
title: "本地存储",
value: "local",
},
{
title: "远程存储",
value: "net",
},
// {
// title: "webdav",
// value: "webdav",
// },
];
import { Dialog, join, System, t } from "@/system";
import { getSystemConfig, setSystemConfig } from "@/system/config";
import { GetClientId } from "@/util/clientid.ts";
import { OpenDirDialog, RestartApp } from "@/util/goutil";
import { notifyError, notifySuccess } from "@/util/msg";
import FileSaver from "file-saver";
import JSZip from "jszip";
import { inject, ref } from "vue";
const config = ref(getSystemConfig());
const sys = inject<System>("system")!;
let zipFile: File | undefined = undefined;
const zipFileInput = ref();
const fileName: any = ref("");
const storeList = [
// {
// title: "",
// value: "browser",
// },
{
title: "本地存储",
value: "local",
},
{
title: "远程存储",
value: "net",
},
// {
// title: "webdav",
// value: "webdav",
// },
];
const items = ["用户角色", "存储配置", "编辑器类型", "备份还原", "文件密码箱"];
const editorType = [
{
title: "系统默认",
value: "local",
},
{
title: "OnlyOffice",
value: "onlyoffice",
},
];
const urlRegex = /^(https?:\/\/)/;
const userTypes = [
{
title: "独立用户",
value: "person",
},
{
title: "企业用户",
value: "member",
},
];
const activeIndex = ref(0);
const items = [
"用户角色",
"存储配置",
"编辑器类型",
"备份还原",
"文件密码箱",
];
const editorType = [
{
title: "系统默认",
value: "local",
},
{
title: "OnlyOffice",
value: "onlyoffice",
},
];
const urlRegex = /^(https?:\/\/)/;
const userTypes = [
{
title: "独立用户",
value: "person",
},
{
title: "企业用户",
value: "member",
},
];
const activeIndex = ref(0);
const selectItem = (index: number) => {
activeIndex.value = index;
};
function selectFile() {
OpenDirDialog().then((res: string) => {
config.value.storePath = res;
});
}
function submitOsInfo() {
const saveData = toRaw(config.value);
if (saveData.storeType === "local") {
const postData = parseData(saveData);
const postUrl = config.value.apiUrl + "/system/setting";
fetch(postUrl, {
method: "POST",
body: JSON.stringify(postData),
})
.then((res) => res.json())
.then((res) => {
if (res.code === 0) {
setSystemConfig(saveData);
RestartApp();
} else {
Dialog.showMessageBox({
message: res.message,
type: "error",
});
}
});
const selectItem = (index: number) => {
activeIndex.value = index;
};
function selectFile() {
OpenDirDialog().then((res: string) => {
config.value.storePath = res;
});
}
if (saveData.storeType === "net") {
if (saveData.storenet.url === "") {
Dialog.showMessageBox({
message: "服务器地址不能为空",
type: "error",
});
return;
}
const urlRegex = /^(https?:\/\/)[^\/]+$/;
if (!urlRegex.test(saveData.storenet.url)) {
Dialog.showMessageBox({
message: "服务器地址格式错误",
type: "error",
});
return;
}
if (saveData.storenet.isCors === "") {
setSystemConfig(saveData);
RestartApp();
} else {
function submitOsInfo() {
const saveData = toRaw(config.value);
if (saveData.storeType === "local") {
const postData = parseData(saveData);
const postUrl = config.value.apiUrl + "/system/setting";
fetch(postUrl, {
method: "POST",
body: JSON.stringify([{
name: "isCors",
value: saveData.storenet.isCors,
}]),
body: JSON.stringify(postData),
})
.then((res) => res.json())
.then((res) => {
@ -282,247 +331,309 @@ function submitOsInfo() {
}
});
}
}
// if (saveData.storeType === "webdav") {
// const urlRegex = /^(https?:\/\/)/;
// if (!urlRegex.test(saveData.webdavClient.url.trim())) {
// Dialog.showMessageBox({
// message: "",
// type: "error",
// });
// return;
// }
// if (
// saveData.webdavClient.username === "" ||
// saveData.webdavClient.password === ""
// ) {
// Dialog.showMessageBox({
// message: "",
// type: "error",
// });
// return;
// }
// const postUrl = config.value.apiUrl + "/system/setting";
// fetch(postUrl, {
// method: "POST",
// body: JSON.stringify([{
// name: "webdavClient",
// value: saveData.webdavClient,
// }]),
// })
// .then((res) => res.json())
// .then((res) => {
// if (res.code === 0) {
// setSystemConfig(saveData);
// RestartApp();
// } else {
// Dialog.showMessageBox({
// message: res.message,
// type: "error",
// });
// }
// });
// }
}
function submitEditInfo() {
const saveData = toRaw(config.value);
setSystemConfig(saveData);
Dialog.showMessageBox({
message: "保存成功",
type: "success",
});
return;
}
function parseData(saveData: any) {
let postData = []
if (saveData.storePath !== "") {
postData.push({ name: "osPath", value: saveData.storePath })
}
if (saveData.netPort != "" && saveData.netPort != "56780" && !isNaN(saveData.netPort) && saveData.netPort * 1 > 0 && saveData.netPort * 1 < 65535) {
postData.push({
name: "netPort",
value: saveData.netPort,
});
}
if (saveData.netPath != "" && /^[A-Za-z]+$/.test(saveData.netPath)) {
postData.push({
name: "netPath",
value: saveData.netPath,
});
if (saveData.storeType === "net") {
if (saveData.storenet.url === "") {
Dialog.showMessageBox({
message: "服务器地址不能为空",
type: "error",
});
return;
}
const urlRegex = /^(https?:\/\/)[^\/]+$/;
if (!urlRegex.test(saveData.storenet.url)) {
Dialog.showMessageBox({
message: "服务器地址格式错误",
type: "error",
});
return;
}
if (saveData.storenet.isCors === "") {
setSystemConfig(saveData);
RestartApp();
} else {
const postUrl = config.value.apiUrl + "/system/setting";
fetch(postUrl, {
method: "POST",
body: JSON.stringify([
{
name: "isCors",
value: saveData.storenet.isCors,
},
]),
})
.then((res) => res.json())
.then((res) => {
if (res.code === 0) {
setSystemConfig(saveData);
RestartApp();
} else {
Dialog.showMessageBox({
message: res.message,
type: "error",
});
}
});
}
}
// if (saveData.storeType === "webdav") {
// const urlRegex = /^(https?:\/\/)/;
// if (!urlRegex.test(saveData.webdavClient.url.trim())) {
// Dialog.showMessageBox({
// message: "",
// type: "error",
// });
// return;
// }
// if (
// saveData.webdavClient.username === "" ||
// saveData.webdavClient.password === ""
// ) {
// Dialog.showMessageBox({
// message: "",
// type: "error",
// });
// return;
// }
// const postUrl = config.value.apiUrl + "/system/setting";
// fetch(postUrl, {
// method: "POST",
// body: JSON.stringify([{
// name: "webdavClient",
// value: saveData.webdavClient,
// }]),
// })
// .then((res) => res.json())
// .then((res) => {
// if (res.code === 0) {
// setSystemConfig(saveData);
// RestartApp();
// } else {
// Dialog.showMessageBox({
// message: res.message,
// type: "error",
// });
// }
// });
// }
}
return postData;
}
async function saveUserInfo() {
const saveData = toRaw(config.value);
if (saveData.userType == "person") {
function submitEditInfo() {
const saveData = toRaw(config.value);
setSystemConfig(saveData);
notifySuccess("保存成功");
RestartApp();
return;
}
if (!urlRegex.test(saveData.userInfo.url.trim())) {
Dialog.showMessageBox({
message: "服务器地址格式错误",
type: "error",
message: "保存成功",
type: "success",
});
return;
}
if (
saveData.userInfo.username === "" ||
saveData.userInfo.password === ""
) {
Dialog.showMessageBox({
message: "用户名或密码不能为空",
type: "error",
});
return;
function parseData(saveData: any) {
let postData = [];
if (saveData.storePath !== "") {
postData.push({ name: "osPath", value: saveData.storePath });
}
if (
saveData.netPort != "" &&
saveData.netPort != "56780" &&
!isNaN(saveData.netPort) &&
saveData.netPort * 1 > 0 &&
saveData.netPort * 1 < 65535
) {
postData.push({
name: "netPort",
value: saveData.netPort,
});
}
if (saveData.netPath != "" && /^[A-Za-z]+$/.test(saveData.netPath)) {
postData.push({
name: "netPath",
value: saveData.netPath,
});
}
return postData;
}
const password = saveData.userInfo.password;
const serverUrl = saveData.userInfo.url + "/member/login";
const res = await fetch(serverUrl, {
method: "POST",
body: JSON.stringify({
username: saveData.userInfo.username,
password: password,
clientId: GetClientId(),
}),
});
if (res.status === 200) {
const data = await res.json();
if (data.success) {
data.data.url = saveData.userInfo.url;
data.data.password = password;
saveData.userInfo = data.data;
async function saveUserInfo() {
const saveData = toRaw(config.value);
console.log(saveData);
if (saveData.userType == "person") {
setSystemConfig(saveData);
notifySuccess("登录成功");
notifySuccess("保存成功");
RestartApp();
return;
} else {
notifyError(data.message);
}
} else {
notifyError("登录失败");
}
return;
}
async function exportBackup() {
const { setProgress } = Dialog.showProcessDialog({
message: `正在打包`,
});
try {
const zip = new JSZip();
await dfsPackage("/", zip, setProgress);
zip.generateAsync({ type: "blob" }).then(function (content) {
FileSaver.saveAs(content, "backup.zip");
setProgress(100);
});
} catch (error) {
//console.log(error);
Dialog.showMessageBox({
message: "打包失败",
type: "error",
}).finally(() => {
zipFile = undefined;
fileName.value = "";
setProgress(100);
if (!urlRegex.test(saveData.userInfo.url.trim())) {
Dialog.showMessageBox({
message: "服务器地址格式错误",
type: "error",
});
return;
}
if (
saveData.userInfo.username === "" ||
saveData.userInfo.password === ""
) {
Dialog.showMessageBox({
message: "用户名或密码不能为空",
type: "error",
});
return;
}
const password = saveData.userInfo.password;
const serverUrl = saveData.userInfo.url + "/user/login";
const res = await fetch(serverUrl, {
method: "POST",
body: JSON.stringify({
// username: saveData.userInfo.username,
// password: password,
// clientId: GetClientId(),
client_id: GetClientId(),
login_type: "password",
param: {
username: saveData.userInfo.username,
password: password,
},
}),
});
}
}
async function dfsPackage(path: string, zip: JSZip, setProgress: any) {
const dir = await sys.fs.readdir(path);
// console.log(res);
// console.log(saveData);
// return;
if (res.status === 200) {
const data = await res.json();
if (data.success) {
data.data.user.url = saveData.userInfo.url;
data.data.user.password = password;
data.data.user.token = data.data.token;
saveData.userInfo = data.data.user;
for (let i = 0; i < dir.length; i++) {
const item = dir[i];
const stat = await sys.fs.stat(item.path);
setProgress(Math.max((i / dir.length) * 100 - 0.1, 0.1));
if (stat) {
if (stat.isDirectory) {
await dfsPackage(item.path, zip, setProgress);
setSystemConfig(saveData);
// console.log(data);
// return;
notifySuccess("登录成功");
RestartApp();
return;
} else {
const content = await sys.fs.readFile(item.path);
try {
atob(content || "");
zip.file(item.path, content || "");
} catch (error) {
zip.file(item.path, content || "");
}
notifyError(data.message);
}
}
}
}
function selectZipfile() {
zipFileInput.value.click();
zipFileInput.value.onchange = (e: any) => {
const tar: any = e.target as HTMLInputElement;
if (tar.files?.[0]) {
zipFile = tar.files[0];
fileName.value = zipFile?.name;
importBackup();
} else {
zipFile = undefined;
fileName.value = "";
notifyError("登录失败");
}
};
}
async function importBackup(path = "") {
if (!zipFile) {
return;
}
const { setProgress } = Dialog.showProcessDialog({
message: "正在恢复备份",
});
try {
const unziped = await JSZip.loadAsync(zipFile);
const unzipArray: Array<JSZip.JSZipObject> = [];
unziped.forEach((_, zipEntry) => {
unzipArray.push(zipEntry);
async function exportBackup() {
const { setProgress } = Dialog.showProcessDialog({
message: `正在打包`,
});
for (let i = 0; i < unzipArray.length; i++) {
const zipEntry = unzipArray[i];
setProgress((i / unzipArray.length) * 100);
if (zipEntry.dir) {
await sys.fs.mkdir(join(path, zipEntry.name));
} else {
let fileC: any = await zipEntry.async("string");
//console.log(fileC);
if (!fileC.startsWith("link::")) {
fileC = await zipEntry.async("arraybuffer");
}
sys.fs.writeFile(join(path, zipEntry.name), fileC);
}
}
setProgress(100);
selectItem(1);
} catch (e) {
//console.log(e);
setTimeout(() => {
try {
const zip = new JSZip();
await dfsPackage("/", zip, setProgress);
zip.generateAsync({ type: "blob" }).then(function (content) {
FileSaver.saveAs(content, "backup.zip");
setProgress(100);
});
} catch (error) {
//console.log(error);
Dialog.showMessageBox({
message: "恢复失败",
message: "打包失败",
type: "error",
}).finally(() => {
zipFile = undefined;
fileName.value = "";
setProgress(100);
});
}, 100);
}
}
async function dfsPackage(path: string, zip: JSZip, setProgress: any) {
const dir = await sys.fs.readdir(path);
for (let i = 0; i < dir.length; i++) {
const item = dir[i];
const stat = await sys.fs.stat(item.path);
setProgress(Math.max((i / dir.length) * 100 - 0.1, 0.1));
if (stat) {
if (stat.isDirectory) {
await dfsPackage(item.path, zip, setProgress);
} else {
const content = await sys.fs.readFile(item.path);
try {
atob(content || "");
zip.file(item.path, content || "");
} catch (error) {
zip.file(item.path, content || "");
}
}
}
}
}
function selectZipfile() {
zipFileInput.value.click();
zipFileInput.value.onchange = (e: any) => {
const tar: any = e.target as HTMLInputElement;
if (tar.files?.[0]) {
zipFile = tar.files[0];
fileName.value = zipFile?.name;
importBackup();
} else {
zipFile = undefined;
fileName.value = "";
}
};
}
async function importBackup(path = "") {
if (!zipFile) {
return;
}
const { setProgress } = Dialog.showProcessDialog({
message: "正在恢复备份",
});
try {
const unziped = await JSZip.loadAsync(zipFile);
const unzipArray: Array<JSZip.JSZipObject> = [];
unziped.forEach((_, zipEntry) => {
unzipArray.push(zipEntry);
});
for (let i = 0; i < unzipArray.length; i++) {
const zipEntry = unzipArray[i];
setProgress((i / unzipArray.length) * 100);
if (zipEntry.dir) {
await sys.fs.mkdir(join(path, zipEntry.name));
} else {
let fileC: any = await zipEntry.async("string");
//console.log(fileC);
if (!fileC.startsWith("link::")) {
fileC = await zipEntry.async("arraybuffer");
}
sys.fs.writeFile(join(path, zipEntry.name), fileC);
}
}
setProgress(100);
selectItem(1);
} catch (e) {
//console.log(e);
setTimeout(() => {
Dialog.showMessageBox({
message: "恢复失败",
type: "error",
}).finally(() => {
zipFile = undefined;
fileName.value = "";
setProgress(100);
});
}, 100);
}
}
}
</script>
<style scoped>
@import "./setStyle.css";
@import "./setStyle.css";
.ctrl {
width: 100px;
}
.ctrl {
width: 100px;
}
.setting-item {
display: flex;
align-items: center;
}
.setting-item {
display: flex;
align-items: center;
}
.setting-area {
width: 100%;
height: 90%;
}
.setting-area {
width: 100%;
height: 90%;
}
</style>

15
frontend/src/stores/login.ts

@ -4,9 +4,18 @@ export const useLoginStore = defineStore("login", () => {
// 第三方登录方式
const ThirdPartyPlatform = ref<string | null>(null);
const State = ref<string | null>(null);
const State = ref<string>("");
// 临时token
const tempToken = ref<string>("");
// 临时clientId
const tempClientId = ref<string>("");
const page = ref("login");
return {
ThirdPartyPlatform,
State
State,
page,
tempToken,
tempClientId,
};
});
},);

9
frontend/src/system/config.ts

@ -1,7 +1,7 @@
import { GetClientId } from "../util/clientid.ts";
import { generateRandomString } from "../util/common.ts";
export const configStoreType = localStorage.getItem('GodoOS-storeType') || 'local';
import { parseAiConfig } from "./aiconfig.ts";
import { GetClientId } from "../util/clientid.ts";
export const configStoreType = localStorage.getItem('GodoOS-storeType') || 'local';
/**
*
*
@ -32,10 +32,10 @@ export const getSystemConfig = (ifset = false) => {
config.userType = 'person'//如果是企业版请改为member
}
if(!config.editorType){
if (!config.editorType) {
config.editorType = 'local'
}
if(!config.onlyoffice){
if (!config.onlyoffice) {
config.onlyoffice = {
url: '',
sceret: '',
@ -234,6 +234,7 @@ export function getUrl(url: string, islast = true) {
export function getWorkflowUrl() {
const config = getSystemConfig();
if (config.userType == 'member') {
console.log(config.userInfo)
return config.userInfo.url + '/views/desktop/index.html' + '?uuid=' + GetClientId() + '&token=' + config.userInfo.token
}
}

76
frontend/src/system/index.ts

@ -20,8 +20,9 @@ import { useUpgradeStore } from '@/stores/upgrade';
import { RestartApp } from '@/util/goutil';
import { notifyError } from '@/util/msg';
//import { isShareFile } from '@/util/sharePath';
import { pick } from '../util/modash';
import { useLoginStore } from '@/stores/login';
import { GetClientId } from "../util/clientid.ts";
import { pick } from '../util/modash';
import { clearSystemConfig, fetchGet, getFileUrl, getSystemConfig, getSystemKey, setSystemConfig, setSystemKey } from './config';
import { OsFileInterface } from './core/FIleInterface';
import { extname } from './core/Path';
@ -148,13 +149,34 @@ export class System {
if (!tempCallBack) {
throw new Error('没有设置登录回调函数');
}
this._options.loginCallback = async (username: string, password: string) => {
const res = await tempCallBack(username, password);
if (res) {
this._options.loginCallback = async (login_type: string, param: {}) => {
const serverUrl = config.userInfo.url + '/user/login';
const res: any = await fetch(serverUrl, {
method: "POST",
body: JSON.stringify({
client_id: GetClientId(),
login_type: login_type,
param: param,
}),
});
if (!res.ok) {
return false;
}
const jsondata = await res.json();
if (jsondata.success) {
jsondata.data.url = config.userInfo.url;
config.userInfo = jsondata.data;
setSystemConfig(config);
this._rootState.state = SystemStateEnum.open;
this.refershAppList();
window.location.href = "/";
return true;
} else {
notifyError(jsondata.message);
return false;
}
return false;
};
}
} else {
@ -163,7 +185,7 @@ export class System {
if (userInfo.url == '') {
return true;
}
const res = await fetchGet(`${userInfo.url}/member/islogin`);
const res = await fetchGet(`${userInfo.url}/user/islogin`);
if (!res.ok) {
notifyError('登录失败,请检查网络连接或重新登录');
return true;
@ -179,40 +201,42 @@ export class System {
//return true;
this._rootState.state = SystemStateEnum.lock;
// 登录回调
this._options.loginCallback = async (
username: string, password: string, loginCode?: {
github_code?: string,
gitee_code?: string
}
) => {
const serverUrl = config.userInfo.url + '/member/login'
this._options.loginCallback = async (login_type: string, param: {}) => {
const serverUrl = config.userInfo.url + '/user/login';
const res: any = await fetch(serverUrl, {
method: "POST",
body: JSON.stringify({
username: username,
password: password,
github_code: loginCode?.github_code,
gitee_code: loginCode?.gitee_code,
clientId: GetClientId(),
client_id: GetClientId(),
login_type: login_type,
param: param,
}),
});
if (!res.ok) {
return false
return false;
}
const jsondata = await res.json();
if (jsondata.success) {
jsondata.data.url = config.userInfo.url
jsondata.data.password = password
config.userInfo = jsondata.data
jsondata.data.url = config.userInfo.url;
config.userInfo = jsondata.data;
setSystemConfig(config);
if (jsondata.code == 10000) {
const loginStore = useLoginStore();
loginStore.tempToken = jsondata.data.token;
loginStore.tempClientId = jsondata.data.client_id;
loginStore.page = "setphone";
return true;
}
this._rootState.state = SystemStateEnum.open;
this.refershAppList()
this.refershAppList();
window.location.href = "/";
return true
return true;
} else {
notifyError(jsondata.message)
return false
notifyError(jsondata.message);
return false;
}
};

14
frontend/src/system/type/type.ts

@ -57,12 +57,14 @@ export interface SystemOptionsCertainly {
contextMenus?: Array<MenuItemConstructorOptions | MenuItem>;
noPassword?: boolean;
loginCallback?: (
username: string,
password: string,
loginCode?: {
github_code?: string,
gitee_code?: string
}
login_type: string,
param: {},
// username: string,
// password: string,
// loginCode?: {
// github_code?: string,
// gitee_code?: string
// }
) => Promise<boolean>;
}
export type SystemOptions = SystemOptionsCertainly & {

32
go.mod

@ -4,7 +4,7 @@ go 1.23
toolchain go1.23.2
require github.com/wailsapp/wails/v2 v2.9.1
require github.com/wailsapp/wails/v2 v2.9.2
require (
aead.dev/minisign v0.2.0 // indirect
@ -14,37 +14,37 @@ require (
github.com/minio/selfupdate v0.6.0 // indirect
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/tklauser/go-sysconf v0.3.14 // indirect
github.com/tklauser/numcpus v0.8.0 // indirect
github.com/tklauser/numcpus v0.9.0 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
)
require (
github.com/bep/debounce v1.2.1 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e // indirect
github.com/labstack/echo/v4 v4.10.2 // indirect
github.com/labstack/gommon v0.4.0 // indirect
github.com/leaanthony/go-ansi-parser v1.6.0 // indirect
github.com/leaanthony/gosod v1.0.3 // indirect
github.com/labstack/echo/v4 v4.13.3 // indirect
github.com/labstack/gommon v0.4.2 // indirect
github.com/leaanthony/go-ansi-parser v1.6.1 // indirect
github.com/leaanthony/gosod v1.0.4 // indirect
github.com/leaanthony/slicer v1.6.0 // indirect
github.com/leaanthony/u v1.1.0 // indirect
github.com/leaanthony/u v1.1.1 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/samber/lo v1.38.1 // indirect
github.com/tkrajina/go-reflector v0.5.6 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/samber/lo v1.47.0 // indirect
github.com/tkrajina/go-reflector v0.5.8 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
github.com/wailsapp/go-webview2 v1.0.10 // indirect
github.com/wailsapp/go-webview2 v1.0.18 // indirect
github.com/wailsapp/mimetype v1.4.1 // indirect
godo v0.0.1
golang.org/x/crypto v0.31.0 // indirect
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
)

45
go.sum

@ -9,33 +9,47 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE=
github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78=
github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk=
github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e h1:Q3+PugElBCf4PFpxhErSzU3/PY5sFL5Z6rfv4AbGAck=
github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e/go.mod h1:alcuEEnZsY1WQsagKhZDsoPCRoOijYqhZvPwLG0kzVs=
github.com/labstack/echo/v4 v4.10.2 h1:n1jAhnq/elIFTHr1EYpiYtyKgx4RW9ccVgkqByZaN2M=
github.com/labstack/echo/v4 v4.10.2/go.mod h1:OEyqf2//K1DFdE57vw2DRgWY0M7s65IVQO2FzvI4J5k=
github.com/labstack/echo/v4 v4.13.3 h1:pwhpCPrTl5qry5HRdM5FwdXnhXSLSY+WE+YQSeCaafY=
github.com/labstack/echo/v4 v4.13.3/go.mod h1:o90YNEeQWjDozo584l7AwhJMHN0bOC4tAfg+Xox9q5g=
github.com/labstack/gommon v0.4.0 h1:y7cvthEAEbU0yHOf4axH8ZG2NH8knB9iNSoTO8dyIk8=
github.com/labstack/gommon v0.4.0/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM=
github.com/labstack/gommon v0.4.2 h1:F8qTUNXgG1+6WQmqoUWnz8WiEU60mXVVw0P4ht1WRA0=
github.com/labstack/gommon v0.4.2/go.mod h1:QlUFxVM+SNXhDL/Z7YhocGIBYOiwB0mXm1+1bAPHPyU=
github.com/leaanthony/debme v1.2.1 h1:9Tgwf+kjcrbMQ4WnPcEIUcQuIZYqdWftzZkBr+i/oOc=
github.com/leaanthony/debme v1.2.1/go.mod h1:3V+sCm5tYAgQymvSOfYQ5Xx2JCr+OXiD9Jkw3otUjiA=
github.com/leaanthony/go-ansi-parser v1.6.0 h1:T8TuMhFB6TUMIUm0oRrSbgJudTFw9csT3ZK09w0t4Pg=
github.com/leaanthony/go-ansi-parser v1.6.0/go.mod h1:+vva/2y4alzVmmIEpk9QDhA7vLC5zKDTRwfZGOp3IWU=
github.com/leaanthony/go-ansi-parser v1.6.1 h1:xd8bzARK3dErqkPFtoF9F3/HgN8UQk0ed1YDKpEz01A=
github.com/leaanthony/go-ansi-parser v1.6.1/go.mod h1:+vva/2y4alzVmmIEpk9QDhA7vLC5zKDTRwfZGOp3IWU=
github.com/leaanthony/gosod v1.0.3 h1:Fnt+/B6NjQOVuCWOKYRREZnjGyvg+mEhd1nkkA04aTQ=
github.com/leaanthony/gosod v1.0.3/go.mod h1:BJ2J+oHsQIyIQpnLPjnqFGTMnOZXDbvWtRCSG7jGxs4=
github.com/leaanthony/gosod v1.0.4 h1:YLAbVyd591MRffDgxUOU1NwLhT9T1/YiwjKZpkNFeaI=
github.com/leaanthony/gosod v1.0.4/go.mod h1:GKuIL0zzPj3O1SdWQOdgURSuhkF+Urizzxh26t9f1cw=
github.com/leaanthony/slicer v1.5.0/go.mod h1:FwrApmf8gOrpzEWM2J/9Lh79tyq8KTX5AzRtwV7m4AY=
github.com/leaanthony/slicer v1.6.0 h1:1RFP5uiPJvT93TAHi+ipd3NACobkW53yUiBqZheE/Js=
github.com/leaanthony/slicer v1.6.0/go.mod h1:o/Iz29g7LN0GqH3aMjWAe90381nyZlDNquK+mtH2Fj8=
github.com/leaanthony/u v1.1.0 h1:2n0d2BwPVXSUq5yhe8lJPHdxevE2qK5G99PMStMZMaI=
github.com/leaanthony/u v1.1.0/go.mod h1:9+o6hejoRljvZ3BzdYlVL0JYCwtnAsVuN9pVTQcaRfI=
github.com/leaanthony/u v1.1.1 h1:TUFjwDGlNX+WuwVEzDqQwC2lOv0P4uhTQw7CMFdiK7M=
github.com/leaanthony/u v1.1.1/go.mod h1:9+o6hejoRljvZ3BzdYlVL0JYCwtnAsVuN9pVTQcaRfI=
github.com/matryer/is v1.4.0 h1:sosSmIWwkYITGrxZ25ULNDeKiMNzFSr4V/eqBQP0PeE=
github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU=
github.com/matryer/is v1.4.1 h1:55ehd8zaGABKLXQUe2awZ99BD/PTc2ls+KV/dXphgEQ=
github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
@ -47,6 +61,8 @@ github.com/minio/selfupdate v0.6.0 h1:i76PgT0K5xO9+hjzKcacQtO7+MjJ4JKA8Ak8XQ9DDw
github.com/minio/selfupdate v0.6.0/go.mod h1:bO02GTIPCMQFTEvE5h4DjYB58bCoZ35XLeBf0buTDdM=
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU=
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI=
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
@ -54,20 +70,26 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/samber/lo v1.38.1 h1:j2XEAqXKb09Am4ebOg31SpvzUTTs6EN3VfgeLUhPdXM=
github.com/samber/lo v1.38.1/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA=
github.com/samber/lo v1.47.0 h1:z7RynLwP5nbyRscyvcD043DWYoOcYRv3mV8lBeqOCLc=
github.com/samber/lo v1.47.0/go.mod h1:RmDH9Ct32Qy3gduHQuKJ3gW1fMHAnE/fAzQuf6He5cU=
github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI=
github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/tklauser/go-sysconf v0.3.14 h1:g5vzr9iPFFz24v2KZXs/pvpvh8/V9Fw6vQK5ZZb78yU=
github.com/tklauser/go-sysconf v0.3.14/go.mod h1:1ym4lWMLUOhuBOPGtRcJm7tEGX4SCYNEEEtghGG/8uY=
github.com/tklauser/numcpus v0.8.0 h1:Mx4Wwe/FjZLeQsK/6kt2EOepwwSl7SmJrK5bV/dXYgY=
github.com/tklauser/numcpus v0.8.0/go.mod h1:ZJZlAY+dmR4eut8epnzf0u/VwodKmryxR8txiloSqBE=
github.com/tklauser/numcpus v0.9.0 h1:lmyCHtANi8aRUgkckBgoDk1nHCux3n2cgkJLXdQGPDo=
github.com/tklauser/numcpus v0.9.0/go.mod h1:SN6Nq1O3VychhC1npsWostA+oW+VOQTxZrS604NSRyI=
github.com/tkrajina/go-reflector v0.5.6 h1:hKQ0gyocG7vgMD2M3dRlYN6WBBOmdoOzJ6njQSepKdE=
github.com/tkrajina/go-reflector v0.5.6/go.mod h1:ECbqLgccecY5kPmPmXg1MrHW585yMcDkVl6IvJe64T4=
github.com/tkrajina/go-reflector v0.5.8 h1:yPADHrwmUbMq4RGEyaOUpz2H90sRsETNVpjzo3DLVQQ=
github.com/tkrajina/go-reflector v0.5.8/go.mod h1:ECbqLgccecY5kPmPmXg1MrHW585yMcDkVl6IvJe64T4=
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
@ -75,10 +97,14 @@ github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQ
github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
github.com/wailsapp/go-webview2 v1.0.10 h1:PP5Hug6pnQEAhfRzLCoOh2jJaPdrqeRgJKZhyYyDV/w=
github.com/wailsapp/go-webview2 v1.0.10/go.mod h1:Uk2BePfCRzttBBjFrBmqKGJd41P6QIHeV9kTgIeOZNo=
github.com/wailsapp/go-webview2 v1.0.18 h1:SSSCoLA+MYikSp1U0WmvELF/4c3x5kH8Vi31TKyZ4yk=
github.com/wailsapp/go-webview2 v1.0.18/go.mod h1:qJmWAmAmaniuKGZPWwne+uor3AHMB5PFhqiK0Bbj8kc=
github.com/wailsapp/mimetype v1.4.1 h1:pQN9ycO7uo4vsUUuPeHEYoUkLVkaRntMnHJxVwYhwHs=
github.com/wailsapp/mimetype v1.4.1/go.mod h1:9aV5k31bBOv5z6u+QP8TltzvNGJPmNJD4XlAL3U+j3o=
github.com/wailsapp/wails/v2 v2.9.1 h1:irsXnoQrCpeKzKTYZ2SUVlRRyeMR6I0vCO9Q1cvlEdc=
github.com/wailsapp/wails/v2 v2.9.1/go.mod h1:7maJV2h+Egl11Ak8QZN/jlGLj2wg05bsQS+ywJPT0gI=
github.com/wailsapp/wails/v2 v2.9.2 h1:Xb5YRTos1w5N7DTMyYegWaGukCP2fIaX9WF21kPPF2k=
github.com/wailsapp/wails/v2 v2.9.2/go.mod h1:uehvlCwJSFcBq7rMCGfk4rxca67QQGsbg5Nm4m9UnBs=
github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=
github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
@ -88,11 +114,15 @@ golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc=
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w=
golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 h1:1UoZQm6f0P/ZO0w1Ri+f+ifG/gXhegadRdwBIXEFWDo=
golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20210505024714-0287a6fb4125/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI=
golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs=
golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I=
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@ -106,6 +136,7 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=

Loading…
Cancel
Save