feat(): 我的功能模块

master
李神峰 2024-11-07 16:41:17 +08:00
parent 7aeb4aa5a0
commit 73788ce9f0
5 changed files with 16 additions and 30 deletions

View File

@ -3,19 +3,17 @@
onLaunch: function() {
const token = {
loginName: uni.getStorageSync('loginName'),
secretKey: uni.getStorageSync('secretKey'),
secretKey: uni.getStorageSync('Gs-Token'),
}
if (token.secretKey){
uni.reLaunch({
url: '/pages/homeIndex/index'
})
console.log(token.secretKey,'App Launch')
} else {
uni.reLaunch({
url: '/pages/login/login'
// url:'/pages/mypage/mypage'
})
console.log(token.secretKey,'App Launch2')
}
},

28
main.js
View File

@ -6,28 +6,11 @@ import App from './App'
import {
$http
} from '@escook/request-miniprogram'
Vue.config.productionTip = false
uni.$http = $http
// $http.baseUrl = 'http://local.gunshiiot.com:18083'
$http.baseUrl = 'http://local.gunshiiot.com:18083'
// 请求拦截器
$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: '数据加载中'
// // })
// }
$http.beforeRequest = function (options) {
if (options.url.indexOf('/doLogin') == -1) {
options.header = {
'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.$showMsg = function(title = '数据请求失败了', duration = 1500) {
uni.$showMsg = function (title = '数据请求失败了', duration = 1500) {
return uni.showToast({
title,
duration,

View File

@ -1,6 +1,6 @@
{
"name" : "咸丰水利",
"appid" : "__UNI__CB311EF",
"name" : "小玉潭水库",
"appid" : "__UNI__7573222",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
@ -18,10 +18,10 @@
},
"modules" : {
"VideoPlayer" : {},
"Contacts" : {},
"Messaging" : {},
"Camera" : {},
"Maps" : {}
"Maps" : {},
"Contacts" : {}
},
/* */
"distribute" : {

View File

@ -9,7 +9,7 @@
</u-navbar>
<view class="" style="margin-top: 44px;;background-color: #f0f0f0;border-top: 1px solid #f0f0f0;">
<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">
<text>开始时间</text>
<text @click="showTime=true" style="margin-left:15%;color:#3399ef">{{startTime}}</text>
@ -23,7 +23,7 @@
</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="align-center">
<view class="blueTiao">

View File

@ -84,7 +84,7 @@
}
}
},
},
}
</script>