Skip to content

Commit 12b94c9

Browse files
fix: 修改header中的错误判断bug,发布1.2.3版本
1 parent ac007a2 commit 12b94c9

File tree

4 files changed

+20
-11
lines changed

4 files changed

+20
-11
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414

1515
## 版本说明
1616

17+
### 1.2.3(2020-3-9)
18+
19+
- 修复获取路径中获取 `header` 简单字符串属性的错误
20+
1721
### 1.2.2(2020-3-8)
1822

1923
- 完善鉴权页面的配置,解决时长校验规则问题
@@ -56,7 +60,7 @@ yapi plugin --name yapi-plugin-interface-oauth2-token
5660

5761
我的升级过程不一定是最好的方法
5862

59-
1. 修改 `package.json``package-lock.json` 中的 `yapi-plugin-interface-oauth2-token` 的版本号为 `1.2.2`
63+
1. 修改 `package.json``package-lock.json` 中的 `yapi-plugin-interface-oauth2-token` 的版本号为 `1.2.3`
6064

6165
2. 删除 `node_modules`,然后重新 `npm install`
6266

@@ -125,7 +129,7 @@ yapi unplugin --name yapi-plugin-interface-oauth2-token
125129
npm install node-sass
126130
```
127131

128-
修改 `package.json``package-lock.json` 的版本号,再重新安装插件,目前最新版本为 `1.2.2`
132+
修改 `package.json``package-lock.json` 的版本号,再重新安装插件,目前最新版本为 `1.2.3`
129133

130134
```shell
131135
yapi plugin --name yapi-plugin-interface-oauth2-token

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "yapi-plugin-interface-oauth2-token",
3-
"version": "1.2.2",
3+
"version": "1.2.3",
44
"description": "为了解决yapi每个接口都需要鉴权的问题",
55
"main": "index.js",
66
"scripts": {

utils/syncTokenUtil.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,18 @@ class syncTokenUtils {
8888
tokenPathList.forEach(item => {
8989
token = token[item];
9090
});
91-
token.forEach((item, index) => {
92-
if (index === token.length - 1) {
93-
accessToken += item.split(';')[0];
94-
} else {
95-
accessToken += item.split(';')[0] + '; ';
96-
}
97-
});
91+
if (typeof token == 'object') {
92+
token.forEach((item, index) => {
93+
if (index === token.length - 1) {
94+
accessToken += item.split(';')[0];
95+
} else {
96+
accessToken += item.split(';')[0] + '; ';
97+
}
98+
});
99+
} else {
100+
accessToken += token;
101+
}
102+
98103
} else {
99104
let tokenPath = path.replace(/'/g, '').replace(/"/g, '');
100105
accessToken += tokenPath;

0 commit comments

Comments
 (0)