mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-11 18: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"
|
||||
},
|
||||
{
|
||||
name: "V2Ray",
|
||||
name: "VMess",
|
||||
value: "vmess"
|
||||
},
|
||||
{
|
||||
name: "VLess",
|
||||
value: "vless"
|
||||
},
|
||||
{
|
||||
name: "Trojan",
|
||||
value: "trojan"
|
||||
},
|
||||
{
|
||||
name: "HTTP",
|
||||
name: "HTTP(s)",
|
||||
value: "http"
|
||||
},
|
||||
{
|
||||
name: "Socks5",
|
||||
value: "socks5"
|
||||
},
|
||||
{
|
||||
name: "Snell",
|
||||
value: "snell"
|
||||
}
|
||||
];
|
||||
export default {
|
||||
|
@ -296,7 +296,7 @@ export default {
|
||||
|
||||
copy(artifact) {
|
||||
if (artifact.url) {
|
||||
this.$clipboard(artifact.url + (isPlainName(artifact.name) ? '' : `#${artifact.name}`));
|
||||
this.$clipboard(artifact.url);
|
||||
this.$store.commit("SET_SUCCESS_MESSAGE", "成功复制配置链接");
|
||||
}
|
||||
},
|
||||
@ -357,10 +357,6 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function isPlainName(name) {
|
||||
return /^[0-9a-zA-Z-_]*$/.test(name);
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
@ -224,14 +224,14 @@ export default {
|
||||
console.log(`${action} --> ${sub.name}`);
|
||||
switch (action) {
|
||||
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", "成功复制订阅链接");
|
||||
break
|
||||
case 'EDIT':
|
||||
this.$router.push(`/sub-edit/${encodeURIComponent(sub.name)}`);
|
||||
break
|
||||
case 'DELETE':
|
||||
this.$store.dispatch("DELETE_SUBSCRIPTION", sub.name);
|
||||
this.$store.dispatch("DELETE_SUBSCRIPTION", encodeURIComponent(sub.name));
|
||||
break
|
||||
}
|
||||
},
|
||||
@ -239,7 +239,7 @@ export default {
|
||||
console.log(`${action} --> ${collection.name}`);
|
||||
switch (action) {
|
||||
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", "成功复制订阅链接");
|
||||
break
|
||||
case 'EDIT':
|
||||
@ -278,10 +278,6 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function isPlainName(name) {
|
||||
return /^[0-9a-zA-Z-_]*$/.test(name);
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
Loading…
x
Reference in New Issue
Block a user