feat(): 我的功能模块
parent
7aeb4aa5a0
commit
73788ce9f0
4
App.vue
4
App.vue
|
|
@ -3,19 +3,17 @@
|
||||||
onLaunch: function() {
|
onLaunch: function() {
|
||||||
const token = {
|
const token = {
|
||||||
loginName: uni.getStorageSync('loginName'),
|
loginName: uni.getStorageSync('loginName'),
|
||||||
secretKey: uni.getStorageSync('secretKey'),
|
secretKey: uni.getStorageSync('Gs-Token'),
|
||||||
}
|
}
|
||||||
if (token.secretKey){
|
if (token.secretKey){
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/homeIndex/index'
|
url: '/pages/homeIndex/index'
|
||||||
})
|
})
|
||||||
console.log(token.secretKey,'App Launch')
|
|
||||||
} else {
|
} else {
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/login/login'
|
url: '/pages/login/login'
|
||||||
// url:'/pages/mypage/mypage'
|
// url:'/pages/mypage/mypage'
|
||||||
})
|
})
|
||||||
console.log(token.secretKey,'App Launch2')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
|
||||||
28
main.js
28
main.js
|
|
@ -6,28 +6,11 @@ import App from './App'
|
||||||
import {
|
import {
|
||||||
$http
|
$http
|
||||||
} from '@escook/request-miniprogram'
|
} from '@escook/request-miniprogram'
|
||||||
|
|
||||||
Vue.config.productionTip = false
|
Vue.config.productionTip = false
|
||||||
uni.$http = $http
|
uni.$http = $http
|
||||||
// $http.baseUrl = 'http://local.gunshiiot.com:18083'
|
|
||||||
$http.baseUrl = 'http://local.gunshiiot.com:18083'
|
$http.baseUrl = 'http://local.gunshiiot.com:18083'
|
||||||
// 请求拦截器
|
// 请求拦截器
|
||||||
$http.beforeRequest = function(options) {
|
$http.beforeRequest = function (options) {
|
||||||
// uni.showLoading({
|
|
||||||
// title: '数据加载中'
|
|
||||||
// })
|
|
||||||
// if (
|
|
||||||
// options.url.indexOf('/gunshiApp/xfflood/doLogin') == -1
|
|
||||||
// && options.url.indexOf('/gunshiApp/xfflood/getLoginInfo') == -1
|
|
||||||
// && options.url.indexOf('/gunshiApp/xfflood/my/info/getByUserId') == -1
|
|
||||||
// && options.url.indexOf('/gunshiApp/xfflood/bzProjectManipulationRecord/file/get/') == -1
|
|
||||||
// ) {
|
|
||||||
// // uni.showLoading({
|
|
||||||
// // title: '数据加载中'
|
|
||||||
// // })
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
if (options.url.indexOf('/doLogin') == -1) {
|
if (options.url.indexOf('/doLogin') == -1) {
|
||||||
options.header = {
|
options.header = {
|
||||||
'Authorization': 'Bearer ' + uni.getStorageSync('Gs-Token')
|
'Authorization': 'Bearer ' + uni.getStorageSync('Gs-Token')
|
||||||
|
|
@ -35,10 +18,15 @@ $http.beforeRequest = function(options) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 响应拦截器
|
// 响应拦截器
|
||||||
$http.afterRequest = function(options) {
|
$http.afterRequest = function (options) {
|
||||||
|
if (options.data.code == 405) {
|
||||||
|
uni.redirectTo({
|
||||||
|
url: '/pages/login/login'
|
||||||
|
})
|
||||||
|
}
|
||||||
// uni.hideLoading()
|
// uni.hideLoading()
|
||||||
}
|
}
|
||||||
uni.$showMsg = function(title = '数据请求失败了', duration = 1500) {
|
uni.$showMsg = function (title = '数据请求失败了', duration = 1500) {
|
||||||
return uni.showToast({
|
return uni.showToast({
|
||||||
title,
|
title,
|
||||||
duration,
|
duration,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "咸丰水利",
|
"name" : "小玉潭水库",
|
||||||
"appid" : "__UNI__CB311EF",
|
"appid" : "__UNI__7573222",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "1.0.0",
|
"versionName" : "1.0.0",
|
||||||
"versionCode" : "100",
|
"versionCode" : "100",
|
||||||
|
|
@ -18,10 +18,10 @@
|
||||||
},
|
},
|
||||||
"modules" : {
|
"modules" : {
|
||||||
"VideoPlayer" : {},
|
"VideoPlayer" : {},
|
||||||
"Contacts" : {},
|
|
||||||
"Messaging" : {},
|
"Messaging" : {},
|
||||||
"Camera" : {},
|
"Camera" : {},
|
||||||
"Maps" : {}
|
"Maps" : {},
|
||||||
|
"Contacts" : {}
|
||||||
},
|
},
|
||||||
/* 模块配置 */
|
/* 模块配置 */
|
||||||
"distribute" : {
|
"distribute" : {
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
</u-navbar>
|
</u-navbar>
|
||||||
<view class="" style="margin-top: 44px;;background-color: #f0f0f0;border-top: 1px solid #f0f0f0;">
|
<view class="" style="margin-top: 44px;;background-color: #f0f0f0;border-top: 1px solid #f0f0f0;">
|
||||||
<view style="padding:0 10px,backgroundColor:#fff">
|
<view style="padding:0 10px,backgroundColor:#fff">
|
||||||
<view class="time-ranger">
|
<view class="time-ranger" style="padding:10px;background-color: #fff;">
|
||||||
<view class="start-time">
|
<view class="start-time">
|
||||||
<text>开始时间</text>
|
<text>开始时间</text>
|
||||||
<text @click="showTime=true" style="margin-left:15%;color:#3399ef">{{startTime}}</text>
|
<text @click="showTime=true" style="margin-left:15%;color:#3399ef">{{startTime}}</text>
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="" v-for="item in list" style="margin: 10px;background-color: #fff;padding: 10px;">
|
<view class="" v-for="(item,index) in list" :key="index" style="margin: 10px;background-color: #fff;padding: 10px;">
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<view class="align-center">
|
<view class="align-center">
|
||||||
<view class="blueTiao">
|
<view class="blueTiao">
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue