Commit 129f3d64 authored by lei's avatar lei

fix:引入index.js

parent f39171dd
...@@ -31,7 +31,10 @@ ...@@ -31,7 +31,10 @@
document.write('<script type="text/javascript" src="sdk/jssdk2/index.js"><\/script>') document.write('<script type="text/javascript" src="sdk/jssdk2/index.js"><\/script>')
} }
</script> </script>
<script
type="text/javascript"
src="./index.js"
></script>
<div <div
id="app" id="app"
class="page_wrapper" class="page_wrapper"
......
...@@ -9,7 +9,7 @@ axios.defaults.timeout = 50000 ...@@ -9,7 +9,7 @@ axios.defaults.timeout = 50000
axios.defaults.headers.post['Content-Type'] = 'application/json' axios.defaults.headers.post['Content-Type'] = 'application/json'
// axios.defaults.headers.common['Authorization'] = gemhoUtil.getCookie('token') // axios.defaults.headers.common['Authorization'] = gemhoUtil.getCookie('token')
axios.defaults.headers.common['Authorization'] = axios.defaults.headers.common['Authorization'] =
'Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiLlvKDlrZ3lvakiLCJsb2dpbl91c2VyX2tleSI6IjNjMmRiMWFiLWIyZGMtNDBjYi04YjM5LWRiNTJmM2VmYzNkYyJ9.sfZyPP-COShNCjwxKR26zGDsPHXss97gu7JEpaMapIZyMQEsxzMigVickcqdhaqDwTRcfr0IxAj64vnrriS9Cw' 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxNTcyMTAzMTg4NiIsImxvZ2luX3VzZXJfa2V5IjoiMGFmNjhkZjItZjc3Ni00OTlkLTkzYjQtOGNkMmNlMDg2ZTVjIn0.NynQrQAUSqbWRGtjc00PHedLPvKdo0oHmHocwwdJmZyXQJjs0_B9_CeCeTs2PUkbEkRuYupzzPN3MvqtWC-GLw'
// 请求拦截器 // 请求拦截器
axios.interceptors.request.use((config) => { axios.interceptors.request.use((config) => {
......
...@@ -23,8 +23,8 @@ var http2 = { ...@@ -23,8 +23,8 @@ var http2 = {
JSON.stringify(params.reqParams), JSON.stringify(params.reqParams),
params.interfacePublicKey params.interfacePublicKey
) )
console.log('http请求普通参数前', params.reqParams) // console.log('http请求普通参数前', params.reqParams)
console.log('http请求参数加密后', data) // console.log('http请求参数加密后', data)
const extraData = { const extraData = {
// 公共请求头设置 // 公共请求头设置
// header: { // header: {
...@@ -49,8 +49,8 @@ var http2 = { ...@@ -49,8 +49,8 @@ var http2 = {
// 用于接口传递的额外参数 如文件流等){ // 用于接口传递的额外参数 如文件流等){
extraData.fileList = params.fileList extraData.fileList = params.fileList
} }
console.log('http请求额外参数', JSON.stringify(extraData)) // console.log('http请求额外参数', JSON.stringify(extraData))
console.log('http2方法进来了~extraData', extraData) // console.log('http2方法进来了~extraData', extraData)
// vaildInterfacefn("gqyjglptxiefn", params.serviceId, data, "1", "https://" + urldomaincreatesign, "https://" + urldomaingateway).then((value) => { // vaildInterfacefn("gqyjglptxiefn", params.serviceId, data, "1", "https://" + urldomaincreatesign, "https://" + urldomaingateway).then((value) => {
vaildInterfacefn( vaildInterfacefn(
...@@ -97,6 +97,8 @@ var http2 = { ...@@ -97,6 +97,8 @@ var http2 = {
} }
const decryptRes = JSON.parse(sm2_decrypt_result) const decryptRes = JSON.parse(sm2_decrypt_result)
console.log('vaildInterfacefn响应解密', decryptRes);
if ( if (
decryptRes.code === 400 || decryptRes.code === 400 ||
decryptRes.code === 401 || decryptRes.code === 401 ||
......
...@@ -35,7 +35,7 @@ function getUserInfo() { ...@@ -35,7 +35,7 @@ function getUserInfo() {
}) })
return return
} }
console.log(data, '用户授权请求成功的数据'); // console.log(data, '用户授权请求成功的数据');
if (typeof data == 'string') data = JSON.parse(data) if (typeof data == 'string') data = JSON.parse(data)
...@@ -55,11 +55,11 @@ function getUserInfo() { ...@@ -55,11 +55,11 @@ function getUserInfo() {
let aes_encrypt_result = sm2_decrypt_result.data let aes_encrypt_result = sm2_decrypt_result.data
let aes_decrypt_result = aes_Decrypt(aes_encrypt_result, appword) let aes_decrypt_result = aes_Decrypt(aes_encrypt_result, appword)
if (!aes_decrypt_result) { if (!aes_decrypt_result) {
console.log('授权用户信息为空') // console.log('授权用户信息为空')
return return
} }
let tempResult = JSON.parse(aes_decrypt_result) let tempResult = JSON.parse(aes_decrypt_result)
console.log('授权用户信息', tempResult) // console.log('授权用户信息', tempResult)
let reqParammm = { let reqParammm = {
sex: tempResult.sex, sex: tempResult.sex,
mobile: tempResult.mobile, mobile: tempResult.mobile,
...@@ -87,12 +87,7 @@ function getUserInfo() { ...@@ -87,12 +87,7 @@ function getUserInfo() {
// localStorage.setItem('token', result.token) // localStorage.setItem('token', result.token)
if (result.code == 200) { if (result.code == 200) {
gemhoUtil.setCookie('token', result.token, 1) // 存储1天后过期 gemhoUtil.setCookie('token', result.token, 1) // 存储1天后过期
gemhoUtil.navigatePage('index.html', '跳转中...') // gemhoUtil.navigatePage('index.html', '跳转中...')
} else if (result.code == 500) {
vant.Dialog.alert({
title: '信息提示',
message: '服务器错误,请联系管理员',
})
} else { } else {
vant.Dialog.alert({ vant.Dialog.alert({
title: '信息提示', title: '信息提示',
...@@ -117,7 +112,7 @@ function getTicket() { ...@@ -117,7 +112,7 @@ function getTicket() {
lightAppJssdk.user.getTicketWithoutDialog({ lightAppJssdk.user.getTicketWithoutDialog({
success: function (res) { success: function (res) {
//成功回调 //成功回调
console.log(JSON.stringify(res) + 1) // console.log(JSON.stringify(res) + 1)
var jsonData = JSON.parse(res) var jsonData = JSON.parse(res)
if (jsonData.retcode == '000000') { if (jsonData.retcode == '000000') {
var dataValueObj = JSON.parse(jsonData.data) var dataValueObj = JSON.parse(jsonData.data)
...@@ -131,7 +126,7 @@ function getTicket() { ...@@ -131,7 +126,7 @@ function getTicket() {
}, },
fail: function (res) { fail: function (res) {
//错误返回 //错误返回
console.log(JSON.stringify(res)) // console.log(JSON.stringify(res))
resolve(res) // 成功时调用 resolve(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