Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cxerpapp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李苏
cxerpapp
Commits
057a258a
Commit
057a258a
authored
Jan 30, 2023
by
王向前
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
0434c41e
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
422 additions
and
91 deletions
+422
-91
service.js
common/service/service.js
+2
-1
appUpdate.js
common/util/appUpdate.js
+292
-65
cusmerLogin.vue
pages/login/cusmerLogin.vue
+11
-9
login.vue
pages/login/login.vue
+12
-16
update.vue
pages/login/update.vue
+105
-0
No files found.
common/service/service.js
View file @
057a258a
...
@@ -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() 仍会执行
...
...
common/util/appUpdate.js
View file @
057a258a
This diff is collapsed.
Click to expand it.
pages/login/cusmerLogin.vue
View file @
057a258a
...
@@ -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
||
"请求失败"
);
...
...
pages/login/login.vue
View file @
057a258a
...
@@ -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
);
...
...
pages/login/update.vue
0 → 100644
View file @
057a258a
<
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
:
200
upx
;
}
</
style
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment