Commit 6dcb6030 by liang ce

token过多问题

parent f2edd76b
...@@ -2,6 +2,7 @@ import * as dd from 'dingtalk-jsapi' ...@@ -2,6 +2,7 @@ import * as dd from 'dingtalk-jsapi'
import axios from 'axios' import axios from 'axios'
import qs from 'qs' import qs from 'qs'
import { MINGPAY_CONSTANT } from './constant' import { MINGPAY_CONSTANT } from './constant'
axios.defaults.headers['Authorization'] = `Bearer ${localStorage.getItem('token')}`
const config = { const config = {
ddconfig: () => { ddconfig: () => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
...@@ -62,13 +63,7 @@ const config = { ...@@ -62,13 +63,7 @@ const config = {
code: info.code, code: info.code,
orgId: localStorage.getItem('orgId') orgId: localStorage.getItem('orgId')
}) })
return axios.post(`http://139.196.213.18:8300/v1/auth/token?${senddate}`, return axios.post(`http://139.196.213.18:8300/v1/auth/token?${senddate}`).then((res) => {
{
headers: {
'Authorization': `Bearer ${localStorage.getItem('token')}`
}
}
).then((res) => {
if (res.data.resultCode === '0') { if (res.data.resultCode === '0') {
localStorage.setItem('token', res.data.data.accessToken.access_token) localStorage.setItem('token', res.data.data.accessToken.access_token)
localStorage.setItem('userId', res.data.data.oapiUser.userid) localStorage.setItem('userId', res.data.data.oapiUser.userid)
......
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