Browse Source

Add shortUrl display

develop
CareyWong 5 years ago
parent
commit
6395b89e4b
  1. 7
      README.md
  2. 73
      src/views/Subconverter.vue

7
README.md

@ -24,11 +24,12 @@
- 20200227
- 提供了短链接服务,可用于缩短生成的订阅 url,请和谐使用。
> 注:需要后端支持。自行搭建服务,请参考 [bitly](https://github.com/CareyWang/bitly) 并修改 Subconverter.vue 中 **shortUrlBackend** 配置项。
> 注:需要后端支持。自行搭建服务,请参考 [bitly](https://github.com/CareyWang/bitly) 并修改 src/views/Subconverter.vue 中 **shortUrlBackend** 配置项。
## Docker
若需要对代码进行修改,你需要在本地构建镜像并运行。
注:每次修改代码,你都需要重新执行 docker build 来执行打包操作。
```shell
docker build -t subweb-local:latest .
@ -36,8 +37,6 @@ docker build -t subweb-local:latest .
docker run -d -p 58080:80 --restart always --name subweb subweb-local:latest
```
> 注:每次修改代码,你都需要重新执行 docker build 来执行打包操作。
## Requirements
你需要安装 [Node](https://nodejs.org/zh-cn/) 与 [Yarn](https://legacy.yarnpkg.com/en/docs/install) 来安装依赖与打包发布。你可以通过以下命令查看是否安装成功。
@ -64,7 +63,7 @@ yarn serve
## Deploy
发布到线上环境,你需要安装依赖,执行以下打包命令,生成的 dist 目录即为发布目录。
发布到线上环境,你需要安装依赖,执行以下打包命令,生成的 dist 目录即为发布目录。如需修改默认后端,请修改 src/views/Subconverter.vue 中 **defaultBackend** 配置项。
```shell
yarn build

73
src/views/Subconverter.vue

@ -115,6 +115,17 @@
>复制</el-button>
</el-input>
</el-form-item>
<el-form-item label="订阅短链接:">
<el-input class="copy-content" disabled v-model="curtomShortSubUrl">
<el-button
slot="append"
v-clipboard:copy="curtomShortSubUrl"
v-clipboard:success="onCopy"
ref="copy-btn"
icon="el-icon-document-copy"
>复制</el-button>
</el-input>
</el-form-item>
<el-form-item label-width="0px" style="margin-top: 40px; text-align: center">
<el-button
@ -295,66 +306,6 @@ export default {
"https://raw.githubusercontent.com/CareyWang/Rules/master/RemoteConfig/special/netease.ini"
}
]
},
{
label: "友商推荐",
options: [
{
label: "ACL4SSR_Online 与Github规则同步",
value:
"https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online.ini"
},
{
label: "ACL4SSR_Online_Mini 精简版 与Github规则同步",
value:
"https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Mini.ini"
},
{
label: "ACL4SSR_Online_NoAuto 与Github规则同步",
value:
"https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_NoAuto.ini"
},
{
label: "ACL4SSR",
value:
"https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR.ini"
},
{
label: "ACL4SSR_Mini 精简版",
value:
"https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Mini.ini"
},
{
label: "ACL4SSR_BackCN",
value:
"https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_BackCN.ini"
},
{
label: "ACL4SSR_NoApple",
value:
"https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_NoApple.ini"
},
{
label: "ACL4SSR_NoAuto",
value:
"https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_NoAuto.ini"
},
{
label: "ACL4SSR_NoAuto_NoApple",
value:
"https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_NoAuto_NoApple.ini"
},
{
label: "ACL4SSR_NoMicrosoft",
value:
"https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_NoMicrosoft.ini"
},
{
label: "ACL4SSR_WithGFW",
value:
"https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_WithGFW.ini"
}
]
}
]
},
@ -379,6 +330,7 @@ export default {
loading: false,
customSubUrl: "",
curtomShortSubUrl: "",
dialogUploadConfigVisible: false,
uploadConfig: "",
@ -497,6 +449,7 @@ export default {
.get(shortUrlBackend + "?longUrl=" + btoa(this.customSubUrl))
.then(res => {
if (res.data.Code === 1 && res.data.ShortUrl !== "") {
this.curtomShortSubUrl = res.data.ShortUrl;
this.$copyText(res.data.ShortUrl);
this.$message.success("短链接已复制到剪贴板");
} else {

Loading…
Cancel
Save