mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-13 03:08:59 +08:00
fix: unable to delete subscription with trailing spaces #build
This commit is contained in:
parent
89164c3e7a
commit
50a3eb5592
@ -56,16 +56,28 @@ const types = [
|
|||||||
value: "ssr"
|
value: "ssr"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "V2Ray",
|
name: "VMess",
|
||||||
value: "vmess"
|
value: "vmess"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "VLess",
|
||||||
|
value: "vless"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "Trojan",
|
name: "Trojan",
|
||||||
value: "trojan"
|
value: "trojan"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "HTTP",
|
name: "HTTP(s)",
|
||||||
value: "http"
|
value: "http"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Socks5",
|
||||||
|
value: "socks5"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Snell",
|
||||||
|
value: "snell"
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
export default {
|
export default {
|
||||||
|
@ -296,7 +296,7 @@ export default {
|
|||||||
|
|
||||||
copy(artifact) {
|
copy(artifact) {
|
||||||
if (artifact.url) {
|
if (artifact.url) {
|
||||||
this.$clipboard(artifact.url + (isPlainName(artifact.name) ? '' : `#${artifact.name}`));
|
this.$clipboard(artifact.url);
|
||||||
this.$store.commit("SET_SUCCESS_MESSAGE", "成功复制配置链接");
|
this.$store.commit("SET_SUCCESS_MESSAGE", "成功复制配置链接");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -357,10 +357,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function isPlainName(name) {
|
|
||||||
return /^[0-9a-zA-Z-_]*$/.test(name);
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
@ -224,14 +224,14 @@ export default {
|
|||||||
console.log(`${action} --> ${sub.name}`);
|
console.log(`${action} --> ${sub.name}`);
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case 'COPY':
|
case 'COPY':
|
||||||
this.$clipboard(`${this.subscriptionBaseURL}/download/${encodeURIComponent(sub.name)}${isPlainName(sub.name) ? '' : '#' + sub.name}`);
|
this.$clipboard(`${this.subscriptionBaseURL}/download/${encodeURIComponent(sub.name)}`);
|
||||||
this.$store.commit("SET_SUCCESS_MESSAGE", "成功复制订阅链接");
|
this.$store.commit("SET_SUCCESS_MESSAGE", "成功复制订阅链接");
|
||||||
break
|
break
|
||||||
case 'EDIT':
|
case 'EDIT':
|
||||||
this.$router.push(`/sub-edit/${encodeURIComponent(sub.name)}`);
|
this.$router.push(`/sub-edit/${encodeURIComponent(sub.name)}`);
|
||||||
break
|
break
|
||||||
case 'DELETE':
|
case 'DELETE':
|
||||||
this.$store.dispatch("DELETE_SUBSCRIPTION", sub.name);
|
this.$store.dispatch("DELETE_SUBSCRIPTION", encodeURIComponent(sub.name));
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -239,7 +239,7 @@ export default {
|
|||||||
console.log(`${action} --> ${collection.name}`);
|
console.log(`${action} --> ${collection.name}`);
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case 'COPY':
|
case 'COPY':
|
||||||
this.$clipboard(`${this.subscriptionBaseURL}/download/collection/${encodeURIComponent(collection.name)}${isPlainName(collection.name) ? '' : '#' + collection.name}`);
|
this.$clipboard(`${this.subscriptionBaseURL}/download/collection/${encodeURIComponent(collection.name)}`);
|
||||||
this.$store.commit("SET_SUCCESS_MESSAGE", "成功复制订阅链接");
|
this.$store.commit("SET_SUCCESS_MESSAGE", "成功复制订阅链接");
|
||||||
break
|
break
|
||||||
case 'EDIT':
|
case 'EDIT':
|
||||||
@ -278,10 +278,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function isPlainName(name) {
|
|
||||||
return /^[0-9a-zA-Z-_]*$/.test(name);
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user