精易论坛
标题:
POST提交内容如何转换为JSON数据呢
[打印本页]
作者:
378385038
时间:
2024-11-24 13:37
标题:
POST提交内容如何转换为JSON数据呢
token=e671a32e2216d6f0aa68437c04a0d178&phone_code=%2B86&phone=1111111111111&password=222222222222222%3D%3D&captcha=AAAA
我要怎么把他变成JSON数据 方便我操作??
哪个命令
作者:
果心豆腐酱
时间:
2024-11-24 13:37
只能自己分割文本,重新组成JSON文本。
作者:
abc2585258313
时间:
2024-11-24 14:37
.版本 2
' 这里假设已经导入了精易模块
' 定义相关变量
变量名
类 型
静态
数组
备 注
json对象
类_json
token
文本型
phone_code
文本型
phone
文本型
password
文本型
captcha
文本型
token = "e671a32e2216d6f0aa68437c04a0d178"
phone_code = "+86"
phone = "1111111111111"
password = "222222222222222=="
captcha = "AAAA"
' 创建JSON对象
json对象.
创建
(
)
' 添加各个键值对到JSON对象中
json对象.
置属性
(
"token", token
)
json对象.
置属性
(
"phone_code", phone_code
)
json对象.
置属性
(
"phone", phone
)
json对象.
置属性
(
"password", password
)
json对象.
置属性
(
"captcha", captcha
)
' 将JSON对象转换为文本形式的JSON数据
调试输出
(
json对象.
取数据文本
(
)
)
i
支持库列表
支持库注释
eAPI
(未知支持库)
.版本 2
.支持库 eAPI
' 这里假设已经导入了精易模块
' 定义相关变量
.局部变量 json对象, 类_json
.局部变量 token, 文本型
.局部变量 phone_code, 文本型
.局部变量 phone, 文本型
.局部变量 password, 文本型
.局部变量 captcha, 文本型
token = "e671a32e2216d6f0aa68437c04a0d178"
phone_code = "+86"
phone = "1111111111111"
password = "222222222222222=="
captcha = "AAAA"
' 创建JSON对象
json对象.创建 ()
' 添加各个键值对到JSON对象中
json对象.置属性 ("token", token)
json对象.置属性 ("phone_code", phone_code)
json对象.置属性 ("phone", phone)
json对象.置属性 ("password", password)
json对象.置属性 ("captcha", captcha)
' 将JSON对象转换为文本形式的JSON数据
调试输出 (json对象.取数据文本 ())
作者:
丶TiGa
时间:
2024-11-24 14:54
.版本 2
.局部变量 入库数据, 类_json
入库数据.置属性 (“orderItemId”, JSON.取成员 (n - 1, “showResult”).取通用属性 (“orderItemId”)) ' 订单行号
入库数据.置属性 (“drugName”, JSON.取成员 (n - 1, “showResult”).取通用属性 (“drugName”)) ' 药品名称
入库数据.置属性 (“drugStandard”, JSON.取成员 (n - 1, “showResult”).取通用属性 (“drugStandard”)) ' 规格
入库数据.置属性 (“quatity”, JSON.取成员 (n - 1, “showResult”).取通用属性 (“quatity”)) ' 采购数量
入库数据.置属性 (“purchaseUnit”, JSON.取成员 (n - 1, “showResult”).取通用属性 (“purchaseUnit”)) ' 采购单位
入库数据.置属性 (“manufactoryCode”, JSON.取成员 (n - 1, “showResult”).取通用属性 (“manufactoryCode”)) ' 生产厂家编号
入库数据.置属性 (“manufactoryName”, JSON.取成员 (n - 1, “showResult”).取通用属性 (“manufactoryName”)) ' 生产厂家名称
入库数据.置属性 (“manuInvoiceNum”, “”) ' 生产厂家发票号
入库数据.置属性 (“supplierCode”, JSON.取成员 (n - 1, “showResult”).取通用属性 (“supplierCode”)) ' 供应商编号
入库参数 = “deliveryHeaderNo=” + 编辑框1.内容 + “&meterialtype=DRUG&jsonInfo=” + 入库JSON文本
入库返回 = UTF8到文本 (网页_访问_对象 (#入库地址, 1, 编码_URL编码_JS (入库参数), 返回Cookies))
我自己工作用到的是这样去处理的,不知道你后端支不支持可以试一下,用到精E模块
作者:
378385038
时间:
2024-11-24 16:07
abc2585258313 发表于 2024-11-24 14:37
[e=2].版本 2
.支持库 eAPI
是需要自己来分割成
token = "e671a32e2216d6f0aa68437c04a0d178"
phone_code = "+86"
phone = "1111111111111"
password = "222222222222222=="
captcha = "AAAA"
这个吗?
JSON的创建自文本 不能是 token=e671a32e2216d6f0aa68437c04a0d178&phone_code=%2B86&phone=1111111111111&password=222222222222222%3D%3D&captcha=AAAA
这个?
欢迎光临 精易论坛 (https://125.confly.eu.org/)
Powered by Discuz! X3.4