Browse Source

Merge commit '9f75d00'

develop
CareyWong 5 years ago
parent
commit
c7ec41e5b5
  1. 6
      README.md
  2. 11
      src/views/Subconverter.vue

6
README.md

@ -4,12 +4,18 @@
## Table of Contents ## Table of Contents
- [Update](#Update)
- [Requirements](#Requirements) - [Requirements](#Requirements)
- [Install](#install) - [Install](#install)
- [Usage](#usage) - [Usage](#usage)
- [Contributing](#contributing) - [Contributing](#contributing)
- [License](#license) - [License](#license)
## Update
- 20200227
- 提供了短链接服务,可用于缩短生成的订阅 url,请和谐使用。
> 注:需要后端支持。自行搭建服务,请参考 [bitly](https://github.com/CareyWang/bitly) 并修改 Subconverter.vue 中 **shortUrlBackend** 配置项。
## Requirements ## Requirements
你需要安装 [Node](https://nodejs.org/zh-cn/) 与 [Yarn](https://legacy.yarnpkg.com/en/docs/install) 来安装依赖与打包发布。你可以通过以下命令查看是否安装成功。 你需要安装 [Node](https://nodejs.org/zh-cn/) 与 [Yarn](https://legacy.yarnpkg.com/en/docs/install) 来安装依赖与打包发布。你可以通过以下命令查看是否安装成功。
注:以下步骤为 Ubuntu 下相应命令,其他系统请自行修改。为了方便后来人解决问题,有问题请发 issue。 注:以下步骤为 Ubuntu 下相应命令,其他系统请自行修改。为了方便后来人解决问题,有问题请发 issue。

11
src/views/Subconverter.vue

@ -209,7 +209,7 @@ const remoteConfigSample =
"https://raw.githubusercontent.com/tindy2013/subconverter/master/base/config/example_external_config.ini"; "https://raw.githubusercontent.com/tindy2013/subconverter/master/base/config/example_external_config.ini";
const gayhubRelease = "https://github.com/tindy2013/subconverter/releases"; const gayhubRelease = "https://github.com/tindy2013/subconverter/releases";
const defaultBackend = "https://api.wcc.best/sub?"; const defaultBackend = "https://api.wcc.best/sub?";
const shortUrlBackend = ""; const shortUrlBackend = "https://api.wcc.best/short";
const configUploadBackend = "https://api.wcc.best/config/upload"; const configUploadBackend = "https://api.wcc.best/config/upload";
const tgBotLink = "https://t.me/CareyWong_bot"; const tgBotLink = "https://t.me/CareyWong_bot";
@ -482,11 +482,6 @@ export default {
this.$message.success("定制订阅已复制到剪贴板"); this.$message.success("定制订阅已复制到剪贴板");
}, },
makeShortUrl() { makeShortUrl() {
if (shortUrlBackend === "") {
this.$message.warning("短链接服务后端自定义正在咕……");
return false;
}
if (this.customSubUrl === "") { if (this.customSubUrl === "") {
this.$message.warning("请先生成订阅链接,再获取对应短链接"); this.$message.warning("请先生成订阅链接,再获取对应短链接");
return false; return false;
@ -495,9 +490,7 @@ export default {
this.loading = true; this.loading = true;
this.$axios this.$axios
.get( .get(shortUrlBackend + "?longUrl=" + btoa(this.customSubUrl))
shortUrlBackend + "?longUrl=" + encodeURIComponent(this.customSubUrl)
)
.then(res => { .then(res => {
if (res.data.Code === 1 && res.data.ShortUrl !== "") { if (res.data.Code === 1 && res.data.ShortUrl !== "") {
this.$copyText(res.data.ShortUrl); this.$copyText(res.data.ShortUrl);

Loading…
Cancel
Save