Commit 2700e536 authored by 李苏's avatar 李苏 💬

Gtoken

parent 038220d9
...@@ -9,7 +9,7 @@ let apiUrl = configService.apiUrl; ...@@ -9,7 +9,7 @@ let apiUrl = configService.apiUrl;
const getTokenStorage = () => { const getTokenStorage = () => {
let token = '' let token = ''
try{ try{
token = uni.getStorageSync(ACCESS_TOKEN) token = uni.getStorageSync('Gtoken')
}catch(e){ }catch(e){
//TODO handle the exception //TODO handle the exception
console.log("getTokenStorage",token) console.log("getTokenStorage",token)
...@@ -50,7 +50,7 @@ uni.getStorageInfo({ ...@@ -50,7 +50,7 @@ uni.getStorageInfo({
}) })
config.header = { config.header = {
...config.header, ...config.header,
'X-Access-Token':getTokenStorage() 'Gtoken':getTokenStorage()
} }
/* /*
if (!token) { // 如果token不存在,调用cancel 会取消本次请求,但是该函数的catch() 仍会执行 if (!token) { // 如果token不存在,调用cancel 会取消本次请求,但是该函数的catch() 仍会执行
......
...@@ -223,6 +223,16 @@ ...@@ -223,6 +223,16 @@
"password":"" "password":""
}) })
} }
uni.setStorage({
key:'Gtoken',
data:res.data.data.token,
success:function(){
},
fail() {
}
})
uni.setStorage({ uni.setStorage({
key:'url_ley', key:'url_ley',
data:s, data:s,
......
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