Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gitcode_dev
quicker
提交
d024ae72
quicker
项目概览
gitcode_dev
/
quicker
上一次同步 接近 2 年
通知
6
Star
2
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
quicker
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
d024ae72
编写于
12月 24, 2021
作者:
璃白.
🌻
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat:修改插件市场接口逻辑
上级
e0965734
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
89 addition
and
24 deletion
+89
-24
src/main/browsers/main.js
src/main/browsers/main.js
+1
-1
src/main/common/autoUpdate.js
src/main/common/autoUpdate.js
+2
-2
src/renderer/App.vue
src/renderer/App.vue
+5
-8
src/renderer/assets/api/index.js
src/renderer/assets/api/index.js
+13
-1
src/renderer/assets/common/constans.js
src/renderer/assets/common/constans.js
+1
-1
src/renderer/assets/common/utils.js
src/renderer/assets/common/utils.js
+18
-0
src/renderer/pages/quick-apps/app-list.vue
src/renderer/pages/quick-apps/app-list.vue
+22
-6
src/renderer/pages/quick-apps/components/app.vue
src/renderer/pages/quick-apps/components/app.vue
+2
-2
src/renderer/pages/search/subpages/market.vue
src/renderer/pages/search/subpages/market.vue
+22
-2
src/renderer/store/modules/main.js
src/renderer/store/modules/main.js
+3
-1
未找到文件。
src/main/browsers/main.js
浏览文件 @
d024ae72
...
...
@@ -15,7 +15,7 @@ module.exports = () => {
:
`file://
${
__dirname
}
/index.html`
;
win
=
new
BrowserWindow
({
height
:
148
,
// client_height
height
:
82
,
// client_height
useContentSize
:
true
,
resizable
:
true
,
width
:
920
,
...
...
src/main/common/autoUpdate.js
浏览文件 @
d024ae72
...
...
@@ -27,8 +27,8 @@ export async function autoUpdate() {
title
:
"
发现新版本
"
,
buttons
:
[
"
Yes
"
,
"
No
"
],
message
:
`发现新版本
${
latest
.
tag_name
}
,是否去下载最新的版本?`
,
checkboxLabel
:
"
以后不再提醒
"
,
checkboxChecked
:
false
//
checkboxLabel: "以后不再提醒",
//
checkboxChecked: false
});
if
(
res
.
response
===
0
)
{
if
(
os
.
type
()
===
"
Windows_NT
"
)
{
...
...
src/renderer/App.vue
浏览文件 @
d024ae72
...
...
@@ -91,7 +91,7 @@
:src=
"userInfo.UserAvatar"
alt=
""
/>
<
img
v-else
src=
"./assets/imgs/quicker.png
"
/>
<
a-icon
v-else
class=
"icon-more"
type=
"more
"
/>
</div>
</div>
</a-input>
...
...
@@ -152,7 +152,7 @@
</div> -->
<router-view></router-view>
</a-layout>
<quick-apps
v-if=
"isHome"
/>
<quick-apps
/>
</div>
</template>
<
script
>
...
...
@@ -488,9 +488,6 @@ export default {
"
userInfo
"
,
"
pluginLoading
"
]),
isHome
()
{
return
this
.
$route
.
path
===
"
/home
"
;
},
isWebview
()
{
return
this
.
pluginInfo
.
subType
===
"
webview
"
;
},
...
...
@@ -543,13 +540,13 @@ body {
}
#app {
padding:
4px 14
px;
padding:
10
px;
box-sizing: border-box;
}
#components-layout {
overflow: auto;
margin-top: 14px;
//
margin-top: 14px;
background: #fff;
::-webkit-scrollbar {
width: 0;
...
...
@@ -611,7 +608,7 @@ body {
.options {
position: absolute;
top:
96
px;
top:
82
px;
left: 0;
width: 100%;
z-index: 99;
...
...
src/renderer/assets/api/index.js
浏览文件 @
d024ae72
...
...
@@ -5,5 +5,17 @@ export default {
axios
.
get
(
"
https://gitcode.net/api/v4/projects/weixin_43881430%2Fquicker/releases
"
),
getPlugins
:
()
=>
axios
.
get
(
"
/
"
)
// getPlugins: () => axios.get("/")
getPlugins
:
()
=>
axios
.
get
(
"
https://gitcode.net/api/v4/projects/weixin_43881430%2Fquicker-market/repository/tree?path=plugins
"
),
getPluginDetail
:
pluginName
=>
axios
.
get
(
`https://gitcode.net/api/v4/projects/weixin_43881430%2Fquicker-market/repository/files/plugins%2F
${
pluginName
}
%2Fplugin.json/raw?ref=master`
),
getZipPathOfPlugin
:
()
=>
axios
.
get
(
`https://gitcode.net/api/v4/projects/weixin_43881430%2Fquicker-market/repository/archive.zip`
)
};
src/renderer/assets/common/constans.js
浏览文件 @
d024ae72
const
WINDOW_MAX_HEIGHT
=
800
;
const
WINDOW_MIN_HEIGHT
=
148
;
// client_height
const
WINDOW_MIN_HEIGHT
=
82
;
// client_height
const
PRE_ITEM_HEIGHT
=
60
;
const
SYSTEM_PLUGINS
=
[
...
...
src/renderer/assets/common/utils.js
浏览文件 @
d024ae72
...
...
@@ -70,6 +70,23 @@ async function downloadZip(downloadRepoUrl, name) {
console
.
log
(
e
);
}
}
async
function
downloadZipFromGitCode
(
downloadRepoUrl
,
name
)
{
try
{
const
plugin_path
=
appPath
;
// 基础模版所在目录,如果是初始化,则是模板名称,否则是项目名称
const
temp_dest
=
`
${
plugin_path
}
/
${
name
}
`
;
// 下载模板
if
(
await
existOrNot
(
temp_dest
))
{
shell
.
rm
(
"
-rf
"
,
temp_dest
);
}
await
downloadFile
(
downloadRepoUrl
,
temp_dest
,
{
extract
:
true
});
return
temp_dest
;
}
catch
(
e
)
{
console
.
log
(
e
);
}
}
const
sysFile
=
{
savePlugins
(
plugins
)
{
...
...
@@ -189,6 +206,7 @@ export {
mergePlugins
,
find
,
downloadZip
,
downloadZipFromGitCode
,
fileLists
,
debounce
};
src/renderer/pages/quick-apps/app-list.vue
浏览文件 @
d024ae72
<
template
>
<div
class=
"appList"
>
<div
class=
"appList"
v-if=
"isHome && dingApp.length"
>
<div
class=
"apps"
>
<div
@
click=
"helpDoc"
class=
"app_item view"
>
<
!--
<
div
@
click=
"helpDoc"
class=
"app_item view"
>
<a-badge
:count=
"1"
>
<app
:info=
"help"
/>
</a-badge>
</div>
</div>
-->
<template
v-for=
"(item, index) in dingApp"
>
<div
:key=
"index"
...
...
@@ -34,7 +34,7 @@
</template>
<
script
>
import
app
from
"
./components/app.vue
"
;
import
{
shell
}
from
"
electron
"
;
import
{
shell
,
ipcRenderer
}
from
"
electron
"
;
import
{
mapState
,
mapMutations
,
mapActions
}
from
"
vuex
"
;
export
default
{
components
:
{
...
...
@@ -45,6 +45,9 @@ export default {
isEditMode
()
{
return
this
.
mode
===
"
edit
"
;
},
isHome
()
{
return
this
.
$route
.
path
===
"
/home
"
;
},
help
()
{
return
{
pluginName
:
"
帮助
"
,
...
...
@@ -61,9 +64,15 @@ export default {
];
}
},
created
()
{
this
.
resetClientHeight
();
},
data
()
{
return
{};
},
updated
()
{
this
.
resetClientHeight
();
},
methods
:
{
...
mapActions
(
"
main
"
,
[
"
showMainUI
"
,
"
openPlugin
"
]),
...
mapMutations
(
"
main
"
,
[
...
...
@@ -72,6 +81,13 @@ export default {
"
commonUpdate
"
,
"
dingProdPlugin
"
]),
resetClientHeight
()
{
// alert(123)
if
(
!
this
.
isHome
)
return
;
ipcRenderer
.
send
(
"
changeWindowSize-rubick
"
,
{
height
:
this
.
dingApp
.
length
?
126
:
82
});
},
helpDoc
()
{
shell
.
openExternal
(
"
https://yre5673znb.feishu.cn/docs/doccnMnLv3iZ3epFvjXprnPum3b
"
...
...
@@ -163,7 +179,7 @@ export default {
display: flex;
flex: 1;
justify-content: flex-start;
min-height: 5
8
px;
min-height: 5
6
px;
}
/deep/.app_item {
cursor: pointer;
...
...
@@ -173,7 +189,7 @@ export default {
}
&.view:hover {
.app_icon {
bottom: -
4
px;
bottom: -
2
px;
z-index: 4;
}
.app_name,
...
...
src/renderer/pages/quick-apps/components/app.vue
浏览文件 @
d024ae72
...
...
@@ -37,7 +37,7 @@ export default {
border-radius: 50%;
overflow: hidden;
position: relative;
bottom: -
2
0px;
bottom: -
1
0px;
transition: all 0.3s;
box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.1);
-webkit-app-region: no-drag;
...
...
@@ -47,7 +47,7 @@ export default {
color: #666;
font-size: 12px;
text-align: center;
margin-top:
10
px;
margin-top:
4
px;
opacity: 0;
transition: all 0.3s;
}
...
...
src/renderer/pages/search/subpages/market.vue
浏览文件 @
d024ae72
...
...
@@ -99,6 +99,7 @@ export default {
pluginList
:
[],
loading
:
{},
bannerList
:
[],
downloadPath
:
""
,
show
:
false
,
currentSelect
:
{}
};
...
...
@@ -195,10 +196,26 @@ export default {
methods
:
{
getPlugins
()
{
api
.
getPlugins
().
then
(({
data
:
res
})
=>
{
this
.
pluginList
=
res
;
api
.
getPlugins
().
then
(
async
({
data
:
res
})
=>
{
res
.
forEach
(
async
plugin
=>
{
const
pluginItem
=
await
this
.
getPluginDetail
(
plugin
);
this
.
pluginList
.
push
(
pluginItem
);
});
});
},
async
getPluginDetail
(
plugin
)
{
const
{
data
:
{
pluginName
,
description
,
logo
}
}
=
await
api
.
getPluginDetail
(
plugin
.
name
);
plugin
.
pluginName
=
pluginName
;
plugin
.
description
=
description
;
plugin
.
logo
=
`https://gitcode.net/weixin_43881430/quicker-market/-/raw/master/plugins/
${
plugin
.
name
}
/
${
logo
}
`
;
plugin
.
downloadUrl
=
"
https://gitcode.net/api/v4/projects/weixin_43881430%2Fquicker-market/repository/archive.zip
"
;
console
.
log
(
plugin
);
return
plugin
;
},
async
download
(
index
,
item
)
{
if
(
this
.
loading
[
index
])
return
;
this
.
$set
(
this
.
loading
,
index
,
true
);
...
...
@@ -209,6 +226,9 @@ export default {
}
this
.
$set
(
this
.
loading
,
index
,
false
);
},
async
getZipPathOfPlugin
()
{
this
.
downloadPath
=
await
api
.
getZipPathOfPlugin
();
},
showButton
(
item
)
{
return
!
this
.
devPlugins
.
filter
(
plugin
=>
plugin
.
name
===
item
.
name
&&
plugin
.
type
===
"
prod
"
...
...
src/renderer/store/modules/main.js
浏览文件 @
d024ae72
...
...
@@ -7,6 +7,7 @@ import {
mergePlugins
,
find
,
downloadZip
,
downloadZipFromGitCode
,
fileLists
}
from
"
../../assets/common/utils
"
;
import
systemMethod
from
"
../../assets/common/system
"
;
...
...
@@ -441,7 +442,8 @@ const actions = {
});
},
async
downloadPlugin
({
commit
},
payload
)
{
const
distUrl
=
await
downloadZip
(
payload
.
downloadUrl
,
payload
.
name
);
const
distUrl
=
await
downloadZipFromGitCode
(
payload
.
downloadUrl
,
payload
.
name
);
// const distUrl = await downloadZip(payload.downloadUrl, payload.name);
const
fileUrl
=
find
(
distUrl
);
// 复制文件
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录