移出apisRequer冗余文件
This commit is contained in:
113
apis/request.js
113
apis/request.js
@@ -1,113 +0,0 @@
|
||||
/**
|
||||
|
||||
*/
|
||||
|
||||
import store from '@/store'
|
||||
|
||||
// 基础配置
|
||||
const config = {
|
||||
apiUrl: 'https://e-chain.cnskl.com/api/',
|
||||
timeout: 60000
|
||||
}
|
||||
|
||||
let loginHintState = false
|
||||
|
||||
// 网络请求
|
||||
const request = (parameter) => {
|
||||
|
||||
// 检查url配置
|
||||
if (parameter.url === 'undefined' || parameter.url === '') {
|
||||
uni.showToast({
|
||||
title: '请求地址不能为空',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
// 注入header
|
||||
config.header = {
|
||||
'Accept': 'application/json',
|
||||
'Authorization': store.getters.getToken || ''
|
||||
}
|
||||
// 请求实例
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.request({
|
||||
url: config.apiUrl + parameter.url,
|
||||
timeout: config.timeout,
|
||||
header: config.header || {},
|
||||
data: parameter.data || {},
|
||||
method: parameter.method || 'GET',
|
||||
success: res => {
|
||||
if (res.header.Authorization) {
|
||||
updateToken('token', res.header.Authorization)
|
||||
}
|
||||
if (res.statusCode === 200) {
|
||||
const resolveData = res.data
|
||||
if (resolveData.status_code === 200) {
|
||||
resolve(resolveData.data)
|
||||
return
|
||||
}
|
||||
if (resolveData.status_code === 401) {
|
||||
loginHint()
|
||||
return
|
||||
}
|
||||
reject(resolveData)
|
||||
return
|
||||
}
|
||||
errToast(res.statusCode)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// 处理一些http请求错误提示
|
||||
const errToast = (code) => {
|
||||
switch (code) {
|
||||
case 404:
|
||||
uni.showToast({
|
||||
title: code + '接口不存在,请联系系统管理员',
|
||||
icon: 'none'
|
||||
})
|
||||
break;
|
||||
case 405:
|
||||
uni.showToast({
|
||||
title: code + '请检查接口请求方式错误',
|
||||
icon: 'none'
|
||||
})
|
||||
break;
|
||||
case 500:
|
||||
uni.showToast({
|
||||
title: code + '服务端错误,请检查服务器信息',
|
||||
icon: 'none'
|
||||
})
|
||||
break;
|
||||
case 401:
|
||||
console.log('没有权限')
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 更新token
|
||||
const updateToken = (token) => {
|
||||
store.commit('setToken', token)
|
||||
}
|
||||
|
||||
// 处理登录提示
|
||||
const loginHint = () => {
|
||||
if (loginHintState) return
|
||||
if (!loginHintState) loginHintState = true
|
||||
updateToken('')
|
||||
uni.showModal({
|
||||
title: '登录提示',
|
||||
content: '您的登录信息已过期,请重新登录',
|
||||
confirmColor: '#0055ff',
|
||||
showCancel: false,
|
||||
success: res => {
|
||||
loginHintState = false
|
||||
if (res.confirm) uni.reLaunch({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export default request
|
||||
@@ -207,15 +207,13 @@
|
||||
appcodeData = res[1]
|
||||
|
||||
this.base = userInfoData.base
|
||||
|
||||
console.log(userInfoData.base)
|
||||
|
||||
this.count = userInfoData.count
|
||||
this.message = userInfoData.message
|
||||
this.relations = userInfoData.relations
|
||||
this.shareCode = appcodeData.code
|
||||
this.loding = true
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon : 'none'
|
||||
|
||||
@@ -58,7 +58,7 @@ class userAuth {
|
||||
mask : true
|
||||
})
|
||||
uni.preLogin({
|
||||
provider: 'univerify',
|
||||
provider: 'univerify',
|
||||
success : res=> {
|
||||
this.keyLogin().then(() => {
|
||||
resolve({
|
||||
@@ -69,19 +69,10 @@ class userAuth {
|
||||
})
|
||||
},
|
||||
fail : err=> {
|
||||
uni.showToast({
|
||||
title: err,
|
||||
icon : 'none'
|
||||
})
|
||||
|
||||
// router.push({name: 'Login'})
|
||||
router.push({name: 'Login'})
|
||||
},
|
||||
complete: comp=> {
|
||||
uni.showToast({
|
||||
title: comp,
|
||||
icon : 'none'
|
||||
})
|
||||
// uni.hideLoading()
|
||||
complete() {
|
||||
uni.hideLoading()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1 +1 @@
|
||||
forceInstall
|
||||
installed
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
BIN
unpackage/dist/build/app-plus/__uniapperror.png
vendored
BIN
unpackage/dist/build/app-plus/__uniapperror.png
vendored
Binary file not shown.
|
Before Width: | Height: | Size: 5.7 KiB |
File diff suppressed because one or more lines are too long
4
unpackage/dist/build/app-plus/app-service.js
vendored
4
unpackage/dist/build/app-plus/app-service.js
vendored
File diff suppressed because one or more lines are too long
2
unpackage/dist/build/app-plus/app-view.js
vendored
2
unpackage/dist/build/app-plus/app-view.js
vendored
File diff suppressed because one or more lines are too long
2
unpackage/dist/build/app-plus/manifest.json
vendored
2
unpackage/dist/build/app-plus/manifest.json
vendored
@@ -1 +1 @@
|
||||
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__CD19AAD","name":"易品新境","version":{"name":"1.0.0","code":"100"},"description":"易品新境为商家提供营销引流工具","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"OAuth":{},"Payment":{},"Share":{},"Geolocation":{},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"autoclose":false,"waiting":true,"delay":0},"popGesture":"close","launchwebview":{"id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#f5f5f5"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"safearea":{"bottom":{"offset":"none"}},"distribute":{"icons":{"android":{"hdpi":"unpackage/res/icons/72x72.png","xhdpi":"unpackage/res/icons/96x96.png","xxhdpi":"unpackage/res/icons/144x144.png","xxxhdpi":"unpackage/res/icons/192x192.png"},"ios":{"appstore":"unpackage/res/icons/1024x1024.png","ipad":{"app":"unpackage/res/icons/76x76.png","app@2x":"unpackage/res/icons/152x152.png","notification":"unpackage/res/icons/20x20.png","notification@2x":"unpackage/res/icons/40x40.png","proapp@2x":"unpackage/res/icons/167x167.png","settings":"unpackage/res/icons/29x29.png","settings@2x":"unpackage/res/icons/58x58.png","spotlight":"unpackage/res/icons/40x40.png","spotlight@2x":"unpackage/res/icons/80x80.png"},"iphone":{"app@2x":"unpackage/res/icons/120x120.png","app@3x":"unpackage/res/icons/180x180.png","notification@2x":"unpackage/res/icons/40x40.png","notification@3x":"unpackage/res/icons/60x60.png","settings@2x":"unpackage/res/icons/58x58.png","settings@3x":"unpackage/res/icons/87x87.png","spotlight@2x":"unpackage/res/icons/80x80.png","spotlight@3x":"unpackage/res/icons/120x120.png"}}},"splashscreen":{"androidStyle":"common"},"google":{"permissions":["<uses-feature android:name=\"android.hardware.camera\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"]},"apple":{},"plugins":{"oauth":{"univerify":{},"weixin":{"appid":"wx222fbe58feee7819","appsecret":"3d24525a636d7573a8fae885097d5cf7","UniversalLinks":""}},"payment":{"weixin":{"__platform__":["android"],"appid":"wx222fbe58feee7819","UniversalLinks":""}},"share":{"weixin":{"appid":"wx222fbe58feee7819","UniversalLinks":""}},"maps":{},"ad":{},"geolocation":{},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}}},"allowsInlineMediaPlayback":true,"uni-app":{"compilerVersion":"3.2.9","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"color":"#bababa","selectedColor":"#e93340","backgroundColor":"#FFFFFF","borderStyle":"rgba(255,255,255,0.4)","list":[{"pagePath":"pages/equity/index","text":"通证权易","iconPath":"static/tabBar/tabBar_icon_00.png","selectedIconPath":"static/tabBar/tabBar_show_00.png"},{"pagePath":"pages/market/index","text":"转让市场","iconPath":"static/tabBar/tabBar_icon_01.png","selectedIconPath":"static/tabBar/tabBar_show_01.png"},{"pagePath":"pages/store/index","text":"企业工具","iconPath":"static/tabBar/tabBar_icon_02.png","selectedIconPath":"static/tabBar/tabBar_show_02.png"},{"pagePath":"pages/property/index","text":"我的资产","iconPath":"static/tabBar/tabBar_icon_03.png","selectedIconPath":"static/tabBar/tabBar_show_03.png"}],"height":"50px","child":["lauchwebview"],"selected":0},"launch_path":"__uniappview.html"}}
|
||||
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__CD19AAD","name":"易品新境","version":{"name":"1.0.0","code":"100"},"description":"易品新境为商家提供营销引流工具","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"OAuth":{},"Payment":{},"Share":{},"Geolocation":{},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"autoclose":false,"waiting":true,"delay":0},"popGesture":"close","launchwebview":{"id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#f5f5f5"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"safearea":{"bottom":{"offset":"none"}},"distribute":{"icons":{"android":{"hdpi":"unpackage/res/icons/72x72.png","xhdpi":"unpackage/res/icons/96x96.png","xxhdpi":"unpackage/res/icons/144x144.png","xxxhdpi":"unpackage/res/icons/192x192.png"},"ios":{"appstore":"unpackage/res/icons/1024x1024.png","ipad":{"app":"unpackage/res/icons/76x76.png","app@2x":"unpackage/res/icons/152x152.png","notification":"unpackage/res/icons/20x20.png","notification@2x":"unpackage/res/icons/40x40.png","proapp@2x":"unpackage/res/icons/167x167.png","settings":"unpackage/res/icons/29x29.png","settings@2x":"unpackage/res/icons/58x58.png","spotlight":"unpackage/res/icons/40x40.png","spotlight@2x":"unpackage/res/icons/80x80.png"},"iphone":{"app@2x":"unpackage/res/icons/120x120.png","app@3x":"unpackage/res/icons/180x180.png","notification@2x":"unpackage/res/icons/40x40.png","notification@3x":"unpackage/res/icons/60x60.png","settings@2x":"unpackage/res/icons/58x58.png","settings@3x":"unpackage/res/icons/87x87.png","spotlight@2x":"unpackage/res/icons/80x80.png","spotlight@3x":"unpackage/res/icons/120x120.png"}}},"splashscreen":{"androidStyle":"common"},"google":{"permissions":["<uses-feature android:name=\"android.hardware.camera\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"]},"apple":{},"plugins":{"oauth":{"univerify":{},"weixin":{"appid":"wx222fbe58feee7819","appsecret":"3d24525a636d7573a8fae885097d5cf7","UniversalLinks":""}},"payment":{"weixin":{"__platform__":["android"],"appid":"wx222fbe58feee7819","UniversalLinks":""}},"share":{"weixin":{"appid":"wx222fbe58feee7819","UniversalLinks":""}},"maps":{},"ad":{},"geolocation":{},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}}},"allowsInlineMediaPlayback":true,"uni-app":{"compilerVersion":"3.1.18","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"color":"#bababa","selectedColor":"#e93340","backgroundColor":"#FFFFFF","borderStyle":"rgba(255,255,255,0.4)","list":[{"pagePath":"pages/equity/index","text":"通证权易","iconPath":"static/tabBar/tabBar_icon_00.png","selectedIconPath":"static/tabBar/tabBar_show_00.png"},{"pagePath":"pages/market/index","text":"转让市场","iconPath":"static/tabBar/tabBar_icon_01.png","selectedIconPath":"static/tabBar/tabBar_show_01.png"},{"pagePath":"pages/store/index","text":"企业工具","iconPath":"static/tabBar/tabBar_icon_02.png","selectedIconPath":"static/tabBar/tabBar_show_02.png"},{"pagePath":"pages/property/index","text":"我的资产","iconPath":"static/tabBar/tabBar_icon_03.png","selectedIconPath":"static/tabBar/tabBar_show_03.png"}],"height":"50px","child":["lauchwebview"],"selected":0},"launch_path":"__uniappview.html"}}
|
||||
2
unpackage/dist/build/app-plus/view.css
vendored
2
unpackage/dist/build/app-plus/view.css
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
4
unpackage/dist/dev/app-plus/app-service.js
vendored
4
unpackage/dist/dev/app-plus/app-service.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user