This commit is contained in:
robin
2026-03-13 14:25:13 +08:00
parent a25a474d6a
commit afbaaa869c
95 changed files with 4591 additions and 2578 deletions

View File

@@ -124,6 +124,27 @@
</tr>
</tbody>
<!-- TypeE -->
<tbody v-show="type == 'typeE'">
<tr>
<td>鉴权密钥 *</td>
<td>
<input type="text" maxlength="40" name="typeESecret" v-model="typeESecret" autocomplete="off"/>
<p class="comment">只能包含字母、数字长度不超过40。<a href="" @click.prevent="generateTypeESecret()">[随机生成]</a></p>
</td>
</tr>
<tr>
<td>有效时间</td>
<td>
<div class="ui input right labeled">
<input type="text" maxlength="8" name="typeELife" value="30" style="width: 7em"/>
<span class="ui label"></span>
</div>
<p class="comment">URL 格式:<code-label>/hash/timestamp/path</code-label>;签名算法:<code-label>md5(secret + uri + timestamp)</code-label>timestamp 为十六进制 Unix 秒数。</p>
</td>
</tr>
</tbody>
<!-- BasicAuth -->
<tbody v-show="type == 'basicAuth'">
<tr>
@@ -138,7 +159,7 @@
</td>
</tr>
<tr v-show="moreBasicAuthOptionsVisible">
<td>认证领域名<em>Realm</em></td>
<td>认证领域名 <em>(Realm)</em></td>
<td>
<input type="text" name="basicAuthRealm" value="" maxlength="100"/>
</td>
@@ -147,7 +168,7 @@
<td>字符集</td>
<td>
<input type="text" name="basicAuthCharset" style="width: 6em" maxlength="50"/>
<p class="comment">类似于<code-label>UTF-8</code-label></p>
<p class="comment">类似于 <code-label>UTF-8</code-label></p>
</td>
</tr>
</tbody>
@@ -186,7 +207,7 @@
<td>限定文件扩展名</td>
<td>
<values-box name="exts"></values-box>
<p class="comment">如果不为空,则表示只有这些扩展名的文件才需要鉴权;扩展名需要包含点符号.,比如<code-label>.png</code-label></p>
<p class="comment">如果不为空,则表示只有这些扩展名的文件才需要鉴权;扩展名需要包含点符号,比如 <code-label>.png</code-label></p>
</td>
</tr>
<tr>
@@ -200,4 +221,4 @@
</table>
<submit-btn></submit-btn>
</form>
</form>

View File

@@ -84,6 +84,18 @@ Tea.context(function () {
this.authDescription = this.authDescription.replace("t=", this.typeDTimestampParamName + "=")
}
/**
* TypeE
*/
this.typeESecret = ""
this.generateTypeESecret = function () {
this.$post(".random")
.success(function (resp) {
this.typeESecret = resp.data.random
})
}
/**
* 基本认证
*/
@@ -97,4 +109,4 @@ Tea.context(function () {
* 子请求
*/
this.subRequestFollowRequest = 1
})
})

View File

@@ -122,6 +122,27 @@
</tr>
</tbody>
<!-- TypeE -->
<tbody v-show="type == 'typeE'">
<tr>
<td>鉴权密钥 *</td>
<td>
<input type="text" maxlength="40" name="typeESecret" v-model="typeESecret" autocomplete="off"/>
<p class="comment">只能包含字母、数字长度不超过40。<a href="" @click.prevent="generateTypeESecret()">[随机生成]</a></p>
</td>
</tr>
<tr>
<td>有效时间</td>
<td>
<div class="ui input right labeled">
<input type="text" maxlength="8" name="typeELife" value="30" style="width: 7em" v-model="policy.params.life"/>
<span class="ui label"></span>
</div>
<p class="comment">URL 格式:<code-label>/hash/timestamp/path</code-label>;签名算法:<code-label>md5(secret + uri + timestamp)</code-label>timestamp 为十六进制 Unix 秒数。</p>
</td>
</tr>
</tbody>
<!-- BasicAuth -->
<tbody v-show="type == 'basicAuth'">
<tr>
@@ -136,7 +157,7 @@
</td>
</tr>
<tr v-show="moreBasicAuthOptionsVisible">
<td>认证领域名<em>Realm</em></td>
<td>认证领域名 <em>(Realm)</em></td>
<td>
<input type="text" name="basicAuthRealm" value="" maxlength="100" v-model="policy.params.realm"/>
</td>
@@ -145,7 +166,7 @@
<td>字符集</td>
<td>
<input type="text" name="basicAuthCharset" style="width: 6em" v-model="policy.params.charset" maxlength="50"/>
<p class="comment">类似于<code-label>utf-8</code-label></p>
<p class="comment">类似于 <code-label>utf-8</code-label></p>
</td>
</tr>
</tbody>
@@ -185,7 +206,7 @@
<td>限定文件扩展名</td>
<td>
<values-box name="exts" :v-values="policy.params.exts"></values-box>
<p class="comment">如果不为空,则表示只有这些扩展名的文件才需要鉴权;扩展名需要包含点符号.,比如<code-label>.png</code-label></p>
<p class="comment">如果不为空,则表示只有这些扩展名的文件才需要鉴权;扩展名需要包含点符号,比如 <code-label>.png</code-label></p>
</td>
</tr>
<tr>
@@ -203,4 +224,4 @@
</table>
<submit-btn></submit-btn>
</form>
</form>

View File

@@ -115,6 +115,22 @@ Tea.context(function () {
this.authDescription = this.authDescription.replace("t=", this.typeDTimestampParamName + "=")
}
/**
* TypeE
*/
this.typeESecret = ""
if (this.policy.type == "typeE") {
this.typeESecret = this.policy.params.secret
}
this.generateTypeESecret = function () {
this.$post(".random")
.success(function (resp) {
this.typeESecret = resp.data.random
})
}
/**
* 基本鉴权
*/
@@ -128,4 +144,4 @@ Tea.context(function () {
* 子请求
*/
this.subRequestFollowRequest = (this.policy.params.method != null && this.policy.params.method.length > 0) ? 0 : 1
})
})