4

knife4j afterScript无法读取到返回值

 2 years ago
source link: https://www.oschina.net/question/4207366_2324684
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

knife4j afterScript无法读取到返回值

小白熊xu 发布于 昨天 11:53

SpringBoot 2.5.6 整合knife4J 3.0.3

在使用其afterScript时无法读取返回值

返回值如下:

{
  "code": 200,
  "msg": "成功",
  "data": {
    "uuid": "captcha:81e1362b-8b88-4781-820b-736f879f7dc9",
    "code": "UyqA",
    "expireTime": "2021-12-13T11:49:30.248"
  }
}

脚本内容如下:

var code=ke.response.data.code;
console.log(code)

打印结果如下:

undefined

官方文档中没有找到解决方法

请各位不吝赐教,谢谢!


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK