@ -1,8 +1,8 @@
|
||||
|
||||
var isReady=false;var onReadyCallbacks=[]; |
||||
var isServiceReady=false;var onServiceReadyCallbacks=[]; |
||||
var __uniConfig = {"pages":["pages/index/index","pages/rawMaterial/rawMaterial","pages/rawMaterialInfo/rawMaterialInfo","pages/firstInspection/firstInspection","pages/firstInspectionInfo/firstInspectionInfo","pages/stampingInspection/stampingInspection","pages/stampingInspectionInfo/stampingInspectionInfo","pages/spray/spray","pages/sprayInfo/sprayInfo","pages/assemble/assemble","pages/assembleInfo/assembleInfo","pages/hardware/hardware","pages/hardwareInfo/hardwareInfo","pages/stampingRecordList/stampingRecordList","pages/stopLine/stopLine"],"window":{"navigationBarTextStyle":"white","navigationBarTitleText":"uni-app","navigationBarBackgroundColor":"#008EBC","backgroundColor":"#F8F8F8"},"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"Erp","compilerVersion":"3.1.22","entryPagePath":"pages/index/index","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}}; |
||||
var __uniRoutes = [{"path":"/pages/index/index","meta":{"isQuit":true},"window":{"navigationBarTitleText":"首页"}},{"path":"/pages/rawMaterial/rawMaterial","meta":{},"window":{"navigationBarTitleText":"原材料列表","enablePullDownRefresh":false}},{"path":"/pages/rawMaterialInfo/rawMaterialInfo","meta":{},"window":{"navigationBarTitleText":"原材料检验","enablePullDownRefresh":false}},{"path":"/pages/firstInspection/firstInspection","meta":{},"window":{"navigationBarTitleText":"首检列表","enablePullDownRefresh":false}},{"path":"/pages/firstInspectionInfo/firstInspectionInfo","meta":{},"window":{"navigationBarTitleText":"产品首检","enablePullDownRefresh":false}},{"path":"/pages/stampingInspection/stampingInspection","meta":{},"window":{"navigationBarTitleText":"冲压巡检","enablePullDownRefresh":false}},{"path":"/pages/stampingInspectionInfo/stampingInspectionInfo","meta":{},"window":{"navigationBarTitleText":"冲压巡检","enablePullDownRefresh":false}},{"path":"/pages/spray/spray","meta":{},"window":{"navigationBarTitleText":"喷涂巡检","enablePullDownRefresh":false}},{"path":"/pages/sprayInfo/sprayInfo","meta":{},"window":{"navigationBarTitleText":"喷涂巡检","enablePullDownRefresh":false}},{"path":"/pages/assemble/assemble","meta":{},"window":{"navigationBarTitleText":"组装巡检","enablePullDownRefresh":false}},{"path":"/pages/assembleInfo/assembleInfo","meta":{},"window":{"navigationBarTitleText":"组装巡检","enablePullDownRefresh":false}},{"path":"/pages/hardware/hardware","meta":{},"window":{"navigationBarTitleText":"五金巡检","enablePullDownRefresh":false}},{"path":"/pages/hardwareInfo/hardwareInfo","meta":{},"window":{"navigationBarTitleText":"五金巡检","enablePullDownRefresh":false}},{"path":"/pages/stampingRecordList/stampingRecordList","meta":{},"window":{"navigationBarTitleText":"冲压记录","enablePullDownRefresh":false}},{"path":"/pages/stopLine/stopLine","meta":{},"window":{"navigationBarTitleText":"冲压记录","enablePullDownRefresh":false}}]; |
||||
var __uniConfig = {"pages":["pages/index/index","pages/rawMaterial/rawMaterial","pages/rawMaterialInfo/rawMaterialInfo","pages/firstInspection/firstInspection","pages/firstInspectionInfo/firstInspectionInfo","pages/stampingInspection/stampingInspection","pages/stampingInspectionInfo/stampingInspectionInfo","pages/spray/spray","pages/sprayInfo/sprayInfo","pages/assemble/assemble","pages/assembleInfo/assembleInfo","pages/hardware/hardware","pages/hardwareInfo/hardwareInfo","pages/stampingRecordList/stampingRecordList","pages/stopLine/stopLine","pages/offLine/offLine","pages/badProduct/badProduct","pages/rework/rework","pages/login/login","pages/forgetPassword/forgetPassword","pages/editePsd/editePsd","pages/user/user","pages/stampingInspectionList/stampingInspectionList","pages/firstInspectionList/firstInspectionList","pages/sprayList/sprayList","pages/assembleList/assembleList","pages/hardwareList/hardwareList","pages/TCQ/TCQ","pages/tcqList/tcqList","pages/tcqInfo/tcqInfo","pages/stopLineList/stopLineList","pages/modeMaintainList/modeMaintainList","pages/modeMaintainAdd/modeMaintainAdd","pages/lineList/lineList","pages/deviceList/deviceList","pages/deviceByAdd/deviceByAdd"],"window":{"navigationBarTextStyle":"white","navigationBarTitleText":"uni-app","navigationBarBackgroundColor":"#007aff","backgroundColor":"#F8F8F8"},"tabBar":{"backgroundColor":"#FFFFFF","color":"#C3C3C3","selectedColor":"#419CFF","list":[{"pagePath":"pages/index/index","text":"首页","iconPath":"./static/shouye-g.png","selectedIconPath":"./static/shouye.png"},{"pagePath":"pages/user/user","text":"我的","iconPath":"./static/wode-g.png","selectedIconPath":"./static/wode.png"}]},"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"Erp","compilerVersion":"3.2.3","entryPagePath":"pages/index/index","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}}; |
||||
var __uniRoutes = [{"path":"/pages/index/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"首页"}},{"path":"/pages/rawMaterial/rawMaterial","meta":{},"window":{"navigationBarTitleText":"原材料列表","enablePullDownRefresh":false}},{"path":"/pages/rawMaterialInfo/rawMaterialInfo","meta":{},"window":{"navigationBarTitleText":"原材料检验","enablePullDownRefresh":false}},{"path":"/pages/firstInspection/firstInspection","meta":{},"window":{"navigationBarTitleText":"首检列表","enablePullDownRefresh":false}},{"path":"/pages/firstInspectionInfo/firstInspectionInfo","meta":{},"window":{"navigationBarTitleText":"产品首检","enablePullDownRefresh":false}},{"path":"/pages/stampingInspection/stampingInspection","meta":{},"window":{"navigationBarTitleText":"冲压巡检","enablePullDownRefresh":false}},{"path":"/pages/stampingInspectionInfo/stampingInspectionInfo","meta":{},"window":{"navigationBarTitleText":"冲压巡检","enablePullDownRefresh":false}},{"path":"/pages/spray/spray","meta":{},"window":{"navigationBarTitleText":"喷涂巡检","enablePullDownRefresh":false}},{"path":"/pages/sprayInfo/sprayInfo","meta":{},"window":{"navigationBarTitleText":"喷涂巡检","enablePullDownRefresh":false}},{"path":"/pages/assemble/assemble","meta":{},"window":{"navigationBarTitleText":"组装巡检","enablePullDownRefresh":false}},{"path":"/pages/assembleInfo/assembleInfo","meta":{},"window":{"navigationBarTitleText":"组装巡检","enablePullDownRefresh":false}},{"path":"/pages/hardware/hardware","meta":{},"window":{"navigationBarTitleText":"五金巡检","enablePullDownRefresh":false}},{"path":"/pages/hardwareInfo/hardwareInfo","meta":{},"window":{"navigationBarTitleText":"五金巡检","enablePullDownRefresh":false}},{"path":"/pages/stampingRecordList/stampingRecordList","meta":{},"window":{"navigationBarTitleText":"冲压记录","enablePullDownRefresh":false}},{"path":"/pages/stopLine/stopLine","meta":{},"window":{"navigationBarTitleText":"冲压记录","enablePullDownRefresh":false}},{"path":"/pages/offLine/offLine","meta":{},"window":{"navigationBarTitleText":"","enablePullDownRefresh":false}},{"path":"/pages/badProduct/badProduct","meta":{},"window":{"navigationBarTitleText":"","enablePullDownRefresh":false}},{"path":"/pages/rework/rework","meta":{},"window":{"navigationBarTitleText":"","enablePullDownRefresh":false}},{"path":"/pages/login/login","meta":{},"window":{"navigationBarTitleText":"登录","enablePullDownRefresh":false}},{"path":"/pages/forgetPassword/forgetPassword","meta":{},"window":{"navigationBarTitleText":"修改密码","enablePullDownRefresh":false}},{"path":"/pages/editePsd/editePsd","meta":{},"window":{"navigationBarTitleText":"","enablePullDownRefresh":false}},{"path":"/pages/user/user","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"","enablePullDownRefresh":false}},{"path":"/pages/stampingInspectionList/stampingInspectionList","meta":{},"window":{"navigationBarTitleText":"","enablePullDownRefresh":false}},{"path":"/pages/firstInspectionList/firstInspectionList","meta":{},"window":{"navigationBarTitleText":"首检记录","enablePullDownRefresh":false}},{"path":"/pages/sprayList/sprayList","meta":{},"window":{"navigationBarTitleText":"","enablePullDownRefresh":false}},{"path":"/pages/assembleList/assembleList","meta":{},"window":{"navigationBarTitleText":"","enablePullDownRefresh":false}},{"path":"/pages/hardwareList/hardwareList","meta":{},"window":{"navigationBarTitleText":"","enablePullDownRefresh":false}},{"path":"/pages/TCQ/TCQ","meta":{},"window":{"navigationBarTitleText":"","enablePullDownRefresh":false}},{"path":"/pages/tcqList/tcqList","meta":{},"window":{"navigationBarTitleText":"","enablePullDownRefresh":false}},{"path":"/pages/tcqInfo/tcqInfo","meta":{},"window":{"navigationBarTitleText":"","enablePullDownRefresh":false}},{"path":"/pages/stopLineList/stopLineList","meta":{},"window":{"navigationBarTitleText":"停线列表","enablePullDownRefresh":false}},{"path":"/pages/modeMaintainList/modeMaintainList","meta":{},"window":{"navigationBarTitleText":"","enablePullDownRefresh":false}},{"path":"/pages/modeMaintainAdd/modeMaintainAdd","meta":{},"window":{"navigationBarTitleText":"","enablePullDownRefresh":false}},{"path":"/pages/lineList/lineList","meta":{},"window":{"navigationBarTitleText":"线路列表","enablePullDownRefresh":false}},{"path":"/pages/deviceList/deviceList","meta":{},"window":{"navigationBarTitleText":"设备列表","enablePullDownRefresh":false}},{"path":"/pages/deviceByAdd/deviceByAdd","meta":{},"window":{"navigationBarTitleText":"","enablePullDownRefresh":false}}]; |
||||
__uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}}); |
||||
__uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}}); |
||||
service.register("uni-app-config",{create(a,b,c){if(!__uniConfig.viewport){var d=b.weex.config.env.scale,e=b.weex.config.env.deviceWidth,f=Math.ceil(e/d);Object.assign(__uniConfig,{viewport:f,defaultFontSize:Math.round(f/20)})}return{instance:{__uniConfig:__uniConfig,__uniRoutes:__uniRoutes,global:void 0,window:void 0,document:void 0,frames:void 0,self:void 0,location:void 0,navigator:void 0,localStorage:void 0,history:void 0,Caches:void 0,screen:void 0,alert:void 0,confirm:void 0,prompt:void 0,fetch:void 0,XMLHttpRequest:void 0,WebSocket:void 0,webkit:void 0,print:void 0}}}}); |
||||
|
@ -1 +1 @@
|
||||
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__E896C30","name":"Erp","version":{"name":"1.0.0","code":"100"},"description":"","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"target":"id:1","autoclose":true,"waiting":true,"delay":0},"popGesture":"close","launchwebview":{"render":"always","id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"light","background":"#008EBC"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"distribute":{"google":{"permissions":["<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-feature android:name=\"android.hardware.camera\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"]},"apple":{},"plugins":{"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}}},"allowsInlineMediaPlayback":true,"uni-app":{"compilerVersion":"3.1.22","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"launch_path":"__uniappview.html"}} |
||||
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__E896C30","name":"Erp","version":{"name":"1.0.0","code":"100"},"description":"","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"target":"id:1","autoclose":true,"waiting":true,"delay":0},"popGesture":"close","launchwebview":{"id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"light","background":"#007aff"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"distribute":{"google":{"permissions":["<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-feature android:name=\"android.hardware.camera\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"]},"apple":{},"plugins":{"ad":{},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}}},"allowsInlineMediaPlayback":true,"safearea":{"background":"#FFFFFF","bottom":{"offset":"auto"}},"uni-app":{"compilerVersion":"3.2.3","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"backgroundColor":"#FFFFFF","color":"#C3C3C3","selectedColor":"#419CFF","list":[{"pagePath":"pages/index/index","text":"首页","iconPath":"./static/shouye-g.png","selectedIconPath":"./static/shouye.png"},{"pagePath":"pages/user/user","text":"我的","iconPath":"./static/wode-g.png","selectedIconPath":"./static/wode.png"}],"borderStyle":"rgba(0,0,0,0.4)","height":"50px","child":["lauchwebview"],"selected":0},"launch_path":"__uniappview.html"}} |
After Width: | Height: | Size: 6.9 KiB |
After Width: | Height: | Size: 5.8 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 7.1 KiB |
After Width: | Height: | Size: 6.4 KiB |
After Width: | Height: | Size: 5.8 KiB |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 7.4 KiB |
After Width: | Height: | Size: 6.8 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 6.5 KiB |
@ -0,0 +1,37 @@
|
||||
import store from "../store/index.js" |
||||
|
||||
/** |
||||
* 获取token |
||||
*/ |
||||
export function getToken() { |
||||
|
||||
return store.state.moduleAuth.token || "" |
||||
|
||||
} |
||||
|
||||
/** |
||||
* 设置token |
||||
* @param {Object} token |
||||
*/ |
||||
export function setToken(token) { |
||||
|
||||
store.commit('setToken', token) |
||||
} |
||||
|
||||
/** |
||||
* 获取刷新token |
||||
*/ |
||||
export function getRefreshToken() { |
||||
|
||||
return store.state.moduleAuth.refreshToken || "" |
||||
|
||||
} |
||||
|
||||
/** |
||||
* 设置刷新token |
||||
* @param {Object} token |
||||
*/ |
||||
export function setRefreshToken(refreshToken) { |
||||
|
||||
store.commit('setRefreshToken', refreshToken) |
||||
} |
@ -0,0 +1,72 @@
|
||||
import functions from "@/utils/functions.js"; |
||||
import { |
||||
setToken, |
||||
getToken, |
||||
getRefreshToken |
||||
} from "@/utils/auth.js"; |
||||
|
||||
const service = (params) => { |
||||
|
||||
return new Promise((relove, reject) => { |
||||
|
||||
if (!params.hideLoading) { |
||||
functions.showWaiting(); |
||||
} |
||||
|
||||
uni.request({ |
||||
url: params.url, |
||||
data: params.data, |
||||
method: params.method, |
||||
dataType: "json", |
||||
header: { |
||||
"content-type": "application/json;charset=utf-8", |
||||
"token": getToken() |
||||
} |
||||
}).then(res => { |
||||
|
||||
functions.closeWaiting(); |
||||
|
||||
//停止下拉刷新
|
||||
uni.stopPullDownRefresh(); |
||||
|
||||
let [err, success] = res; |
||||
|
||||
if (!err) { |
||||
|
||||
if (success.statusCode == 200) { |
||||
|
||||
let data = success.data; |
||||
|
||||
switch (data.code) { |
||||
|
||||
case 200: |
||||
relove(data.data); |
||||
break; |
||||
case 203: |
||||
functions.logout(); |
||||
break; |
||||
default: |
||||
reject(data); |
||||
functions.error(data.msg); |
||||
} |
||||
|
||||
} else { |
||||
|
||||
//请求失败
|
||||
functions.error("服务器请求失败"); |
||||
} |
||||
|
||||
} else { |
||||
|
||||
//请求失败
|
||||
functions.error("服务器请求失败"); |
||||
} |
||||
|
||||
}); |
||||
|
||||
}) |
||||
|
||||
|
||||
|
||||
} |
||||
export default service; |
@ -1,68 +1,111 @@
|
||||
import functions from "@/utils/functions.js"; |
||||
import store from "@/store/index.js"; |
||||
import { |
||||
getToken, |
||||
getRefreshToken, |
||||
setToken |
||||
} from "@/utils/auth.js"; |
||||
|
||||
const service = (params) => { |
||||
|
||||
return new Promise((relove, reject) => { |
||||
|
||||
if (!params.hideLoading) { |
||||
functions.showWaiting(); |
||||
} |
||||
let result = doRequest(params); |
||||
|
||||
uni.request({ |
||||
url: params.url, |
||||
data: params.data, |
||||
method: params.method, |
||||
dataType: "json", |
||||
header: { |
||||
"content-type": "application/json;charset=utf-8", |
||||
"token": store.state.moduleAuth.token |
||||
result.then(res => { |
||||
if (res) { |
||||
relove(res); |
||||
} |
||||
}).then(res => { |
||||
}) |
||||
|
||||
}); |
||||
|
||||
functions.closeWaiting(); |
||||
} |
||||
|
||||
//停止下拉刷新
|
||||
uni.stopPullDownRefresh(); |
||||
//请求接口
|
||||
async function doRequest(params) { |
||||
|
||||
let [err, success] = res; |
||||
functions.showWaiting(); |
||||
|
||||
if (!err) { |
||||
let header = { |
||||
"Content-Type": "application/json", |
||||
"token": getToken() |
||||
} |
||||
|
||||
if (success.statusCode == 200) { |
||||
if (params.header) { |
||||
header = { |
||||
...header, |
||||
...params.header |
||||
}; |
||||
} |
||||
|
||||
let data = success.data; |
||||
const [err, success] = await uni.request({ |
||||
url: params.url, |
||||
data: params.data, |
||||
method: params.method, |
||||
dataType: "json", |
||||
header: header |
||||
}); |
||||
|
||||
switch (data.code) { |
||||
functions.closeWaiting(); |
||||
|
||||
case 200: |
||||
relove(data.data); |
||||
break; |
||||
case 203: |
||||
functions.logout(); |
||||
break; |
||||
default: |
||||
reject(data); |
||||
functions.error(data.msg); |
||||
} |
||||
if (!err) { |
||||
|
||||
} else { |
||||
if (success.statusCode == 200) { |
||||
|
||||
//请求失败
|
||||
functions.error("服务器请求失败"); |
||||
} |
||||
let data = success.data; |
||||
|
||||
if (data.code == 200) { |
||||
return data.data; |
||||
} else if (data.code == 203) { |
||||
return refreshTokenRequest(params); |
||||
} else if (data.code == 205) { |
||||
functions.logout(); |
||||
return false; |
||||
} else { |
||||
|
||||
//请求失败
|
||||
functions.error("服务器请求失败"); |
||||
functions.error(data.msg); |
||||
return null; |
||||
} |
||||
|
||||
}); |
||||
} else { |
||||
|
||||
}) |
||||
//请求失败
|
||||
functions.error("服务器请求失败"); |
||||
return null; |
||||
} |
||||
|
||||
} else { |
||||
|
||||
//请求失败
|
||||
functions.error("服务器请求失败"); |
||||
return null; |
||||
} |
||||
|
||||
} |
||||
|
||||
//刷新token
|
||||
async function refreshTokenRequest(params) { |
||||
|
||||
if (!getRefreshToken()) { |
||||
functions.logout(); |
||||
return false; |
||||
} |
||||
|
||||
let apiUrl = `${functions.getDomain()}/api/cy-check-sure`; |
||||
|
||||
const result = doRequest({ |
||||
url: apiUrl, |
||||
method: "post", |
||||
data: {}, |
||||
header: { |
||||
"Refresh-Token": getRefreshToken() |
||||
} |
||||
}); |
||||
|
||||
const newToken = await result; |
||||
|
||||
setToken(newToken.token); |
||||
|
||||
return doRequest(params); |
||||
} |
||||
|
||||
export default service; |
||||
|