Commit 057a258a authored by 王向前's avatar 王向前

no message

parent 0434c41e
...@@ -41,7 +41,8 @@ http.validateStatus = (statusCode) => { ...@@ -41,7 +41,8 @@ http.validateStatus = (statusCode) => {
http.interceptor.request((config, cancel) => { /* 请求之前拦截器 */ http.interceptor.request((config, cancel) => { /* 请求之前拦截器 */
config.header = { config.header = {
...config.header, ...config.header,
'X-Access-Token':getTokenStorage() 'X-Access-Token':getTokenStorage(),
'GToken':getTokenStorage()||"notoken"
} }
/* /*
if (!token) { // 如果token不存在,调用cancel 会取消本次请求,但是该函数的catch() 仍会执行 if (!token) { // 如果token不存在,调用cancel 会取消本次请求,但是该函数的catch() 仍会执行
......
This diff is collapsed.
...@@ -304,13 +304,6 @@ ...@@ -304,13 +304,6 @@
console.log(resp.data.data.username); console.log(resp.data.data.username);
} }
}); });
uni.setStorage({
key: 'ACCESS_TOKEN',
data: resp.data.data.token,
success: function () {
console.log(resp.data.data.token)
}
});
// 本地存储信息 // 本地存储信息
uni.setStorage({ uni.setStorage({
key: 'userName', key: 'userName',
...@@ -326,10 +319,19 @@ ...@@ -326,10 +319,19 @@
console.log("用户名获取成功") console.log("用户名获取成功")
} }
}); });
uni.setStorage({
key: 'ACCESS_TOKEN',
data: resp.data.data.token,
success: function () {
console.log(resp.data.data.token)
_this.$tip.success('登录成功!')
_this.$Router.replaceAll({name:'index'})
}
});
// this.$router.go(0) // this.$router.go(0)
//ACCESS_TOKEN //ACCESS_TOKEN
this.$tip.success('登录成功!')
this.$Router.replaceAll({name:'index'})
}else{ }else{
this.loading=false; this.loading=false;
this.$tip.alert(resp.data.message||"请求失败"); this.$tip.alert(resp.data.message||"请求失败");
......
...@@ -240,13 +240,7 @@ ...@@ -240,13 +240,7 @@
console.log(res.data.data.username); console.log(res.data.data.username);
} }
}); });
uni.setStorage({
key: 'ACCESS_TOKEN',
data: res.data.data.token,
success: function () {
console.log(res.data.data.token)
}
});
// 本地存储信息 // 本地存储信息
uni.setStorage({ uni.setStorage({
key: 'userName', key: 'userName',
...@@ -262,17 +256,19 @@ ...@@ -262,17 +256,19 @@
console.log("用户名获取成功") console.log("用户名获取成功")
} }
}); });
uni.setStorage({
key: 'ACCESS_TOKEN',
data: res.data.data.token,
success: function () {
_this.$tip.success('登录成功!')
_this.$Router.replaceAll({name:'index'})
console.log(res.data.data.token)
}
});
//ACCESS_TOKEN //ACCESS_TOKEN
this.$tip.success('登录成功!')
this.$Router.replaceAll({name:'index'})
// #ifdef APP-PLUS
// this.saveClientId()
// #endif
// #ifndef APP-PLUS
this.$tip.success('登录成功!')
this.$Router.replaceAll({name:'index'})
// #endif
}else{ }else{
this.loading=false; this.loading=false;
this.$tip.alert(res.data.message); this.$tip.alert(res.data.message);
......
<template>
<view class="page uodateMain">
<!-- 升级模态框 -->
<view class="text-center">
<image :src="imgsrc" mode='aspectFit' class="zai-logo "></image>
<view class="zai-title text-shadow">欢迎格物云ERP</view>
</view>
<!-- 进度条 -->
<view class="progress">
<view class="tips">
tips:{{text}}
</view>
<view class="">
<view class="uni-padding-wrap uni-common-mt">
<view class="progress-box">
<progress :percent="percent" activeColor="#10AEFF" stroke-width="8" />
</view>
<view class="percent">
{{percent}}%
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import appUpdate from 'common/util/appUpdate.js'
export default {
onLoad() {
// this.showLoading()
// #ifdef APP-PLUS
setTimeout(()=>{
appUpdate(this)
},500)
// #endif
// #ifdef H5
this.$Router.replaceAll({name:'cusmerLogin'})
// #endif
},
data() {
return {
downLoad:false,
imgsrc: "/static/image/logon.png",
percent:0,
text:'正在检测版本'
}
},
methods: {
/* 修改进度 */
showProcess(text,percent){
this.text=text
this.percent=percent
},
showLoading(){
uni.showLoading({
title: this.text
})
},
hideLoading(){
uni.hideLoading()
}
}
}
</script>
<style>
.percent{
height: 25px;line-height: 25px;text-align: center;
font-size: 12px;
}
.tips{
height: 30px;
font-size: 12px;
}
.progress {
width: 100%;
position: absolute;
bottom: 4vh;
padding: 20px;
}
.zai-title {
font-size: 20px;
color: #000000;
text-align: center;
}
.uodateMain {
height: 100vh;
width: 100vw;
padding-top: 80px;
background-color: #fff;
}
.zai-logo {
/* width: 200upx; */
height: 200upx;
}
</style>
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