Skip to content

Commit bdbf9cb

Browse files
author
li-guohao
committed
feat: 支持jwt令牌的请求
1 parent 8a2a130 commit bdbf9cb

4 files changed

Lines changed: 24 additions & 3 deletions

File tree

CHANGELOG.MD

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
更新日志文档,版本顺序从新到旧,最新版本在最前(上)面。
44

5+
# 0.12.10
6+
7+
## 修复
8+
9+
- 获取jwt令牌
10+
511
# 0.12.9
612

713
## 修复

console/src/views/AListControl.vue

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,21 @@ const doPostImportPath = () => {
2525
let data = {
2626
path: base64Path
2727
};
28+
29+
// 设置jwt token的请求头
30+
const userStoreJson = window.localStorage.getItem('ikaros-store-user');
31+
if (!userStoreJson) {
32+
window.alert("操作取消,jwt令牌为空。")
33+
return
34+
}
35+
const userStore = JSON.parse(userStoreJson);
36+
if (!userStore || !userStore.jwtToken) {
37+
window.alert("操作取消,jwt令牌为空。")
38+
return
39+
}
40+
const jwtToken = userStore.jwtToken;
41+
http.defaults.headers.common['Authorization'] = 'Bearer ' + jwtToken;
42+
2843
var submitBtn = document.getElementById('submitBtn')
2944
console.debug('submitBtn:', submitBtn)
3045
if (submitBtn) submitBtn.innerHTML = '处理中...'

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
group=run.ikaros.plugin.alist
22
description=A ikaros plugin for alist.
3-
version=0.12.9
3+
version=0.12.10

src/main/resources/plugin.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ name: PluginAList
44
# plugin entry class that extends BasePlugin
55
clazz: run.ikaros.plugin.alist.AListPlugin
66
# plugin 'version' is a valid semantic version string (see semver.org).
7-
version: 0.12.9
8-
requires: ">=0.12.1"
7+
version: 0.12.10
8+
requires: ">=0.12.0"
99
author:
1010
name: Ikaros OSS Team
1111
website: https://github.com/ikaros-dev

0 commit comments

Comments
 (0)