mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-12-25 15:52:43 +00:00
Compare commits
No commits in common. "d54e7a9b1411fc67d43dfb6c8ffb18388b3f3c2b" and "aab01ff11a1b35b1e491c56c704826903b7797b1" have entirely different histories.
d54e7a9b14
...
aab01ff11a
2 changed files with 4 additions and 12 deletions
|
|
@ -85,7 +85,7 @@ func (a *SUBController) subs(c *gin.Context) {
|
||||||
// Add headers
|
// Add headers
|
||||||
c.Writer.Header().Set("Subscription-Userinfo", header)
|
c.Writer.Header().Set("Subscription-Userinfo", header)
|
||||||
c.Writer.Header().Set("Profile-Update-Interval", a.updateInterval)
|
c.Writer.Header().Set("Profile-Update-Interval", a.updateInterval)
|
||||||
c.Writer.Header().Set("Profile-Title", "base64:" + base64.StdEncoding.EncodeToString([]byte(a.subTitle)))
|
c.Writer.Header().Set("Profile-Title", a.subTitle)
|
||||||
|
|
||||||
if a.subEncrypt {
|
if a.subEncrypt {
|
||||||
c.String(200, base64.StdEncoding.EncodeToString([]byte(result)))
|
c.String(200, base64.StdEncoding.EncodeToString([]byte(result)))
|
||||||
|
|
@ -119,7 +119,7 @@ func (a *SUBController) subJsons(c *gin.Context) {
|
||||||
// Add headers
|
// Add headers
|
||||||
c.Writer.Header().Set("Subscription-Userinfo", header)
|
c.Writer.Header().Set("Subscription-Userinfo", header)
|
||||||
c.Writer.Header().Set("Profile-Update-Interval", a.updateInterval)
|
c.Writer.Header().Set("Profile-Update-Interval", a.updateInterval)
|
||||||
c.Writer.Header().Set("Profile-Title", "base64:" + base64.StdEncoding.EncodeToString([]byte(a.subTitle)))
|
c.Writer.Header().Set("Profile-Title", a.subTitle)
|
||||||
|
|
||||||
c.String(200, jsonSub)
|
c.String(200, jsonSub)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -140,10 +140,8 @@ class RandomUtil {
|
||||||
|
|
||||||
static randomShadowsocksPassword() {
|
static randomShadowsocksPassword() {
|
||||||
const array = new Uint8Array(32);
|
const array = new Uint8Array(32);
|
||||||
|
|
||||||
window.crypto.getRandomValues(array);
|
window.crypto.getRandomValues(array);
|
||||||
|
return Base64.encode(String.fromCharCode(...array));
|
||||||
return Base64.alternativeEncode(String.fromCharCode(...array));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -530,12 +528,6 @@ class Base64 {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
static alternativeEncode(content) {
|
|
||||||
return window.btoa(
|
|
||||||
content
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
static decode(content = "") {
|
static decode(content = "") {
|
||||||
return new TextDecoder()
|
return new TextDecoder()
|
||||||
.decode(
|
.decode(
|
||||||
|
|
@ -815,7 +807,7 @@ const MediaQueryMixin = {
|
||||||
}
|
}
|
||||||
|
|
||||||
class FileManager {
|
class FileManager {
|
||||||
static downloadTextFile(content, filename = 'file.txt', options = { type: "text/plain" }) {
|
static downloadTextFile(content, filename='file.txt', options = { type: "text/plain" }) {
|
||||||
let link = window.document.createElement('a');
|
let link = window.document.createElement('a');
|
||||||
|
|
||||||
link.download = filename;
|
link.download = filename;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue