Commit 5641b37e authored by xinzhedeai's avatar xinzhedeai

详情出问题 刷新接口 解密为空则重新处理

parent 9f9b5168
......@@ -15,9 +15,8 @@ var http2 = {
*
*/
const data = SM.encrypt(JSON.stringify(params.reqParams), params.interfacePublicKey)
console.log('http2方法进来了~普通请求参数', JSON.stringify(params.reqParams))
console.log('http请求普通参数前', params.reqParams)
console.log('http请求参数加密后', data)
const extraData = { // 公共请求头设置
// header: {
// // Authorization: "Bearer eyJhbGciOiJIUzUxMiJ9.eyJqdGkiOiI0ODA3ODFkZmQxYmE0MmM0OGQyZDQ5NTllYzcyYTUwNCIsInVzZXIiOiJqYyIsInN1YiI6ImpjIn0.WfLq11T7iWPiMuzqDY2N54aIqdv-ciYCe6pINqQAeBdqlMiJmkufsqlD2YMmUzsHA-o4WerkiSYnPzexEMiAJA"
......@@ -34,11 +33,12 @@ var http2 = {
if(params.fileList){ // 用于接口传递的额外参数 如文件流等){
extraData.fileList = params.fileList
}
console.log('http2方法进来了~extraData', extraData)
console.log('http请求额外参数', JSON.stringify(extraData))
// console.log('http2方法进来了~extraData', extraData)
// vaildInterfacefn("gqyjglptxiefn", params.serviceId, data, "1", "https://" + urldomaincreatesign, "https://" + urldomaingateway).then((value) => {
vaildInterfacefn("gqyjglptxiefn", params.serviceId, data, "1", extraData).then((value) => {
// console.log('vaildInterfacefn响应', value)
console.log('vaildInterfacefn响应value', value)
/**
* code: 200
data: "048b04671ad85e52e" // value 值就是接口返回的data值
......@@ -46,11 +46,11 @@ var http2 = {
success: true
*/
if(!value){
vant.Dialog.alert({
title: '信息提示',
message: '网络异常, 请重试',
// message: '请求异常'
})
// vant.Dialog.alert({
// title: '信息提示',
// message: '网络异常, 请重试',
// // message: '请求异常'
// })
fn && fn(null)
return
}
......@@ -60,6 +60,11 @@ var http2 = {
let sm2_decrypt_result = sm2_Decrypt(sm2_encrypt_result, params.interfacePrivateKey)
console.log('vaildInterfacefn响应解密', sm2_decrypt_result)
if(!sm2_decrypt_result){ // 解密为空字符串
fn && fn(null)
return
}
const decryptRes = JSON.parse(sm2_decrypt_result)
if(decryptRes.code === 400 || decryptRes.code === 401 || decryptRes.status === 401){
vant.Dialog.alert({
......
......@@ -32,6 +32,10 @@ window.addEventListener("load", function() {
lawId: gemhoUtil.getParameter('law_id')
}
}, (res) => {
if(!res){ // 中台返回为undefined 重新请求
this.detail()
return
}
if(res){
console.log('接口回调数据', JSON.parse(res))
var result = JSON.parse(res)
......
......@@ -30,7 +30,10 @@ window.addEventListener("load", function() {
noticeId: gemhoUtil.getParameter('noticeId')
}
}, (res) => {
if(!res){ // 中台返回为undefined 重新请求
this.detail()
return
}
if(res){
console.log('接口回调数据', JSON.parse(res))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment