Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mes-pda-scan
Project
Project
Details
Activity
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
ximai
mes-pda-scan
Commits
b4438fde
Commit
b4438fde
authored
Dec 19, 2024
by
沈翠玲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
dd04d169
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
53 deletions
+21
-53
http.api.js
common/http.api.js
+1
-1
http.interceptor.js
common/http.interceptor.js
+5
-49
th_TH.json
lang/th_TH.json
+5
-1
zh_CN.json
lang/zh_CN.json
+5
-1
login.vue
pages/sys/login/login.vue
+3
-0
index.js
uview-ui/libs/request/index.js
+2
-1
No files found.
common/http.api.js
View file @
b4438fde
...
...
@@ -13,7 +13,7 @@ const install = (Vue, vm) => {
// 基础服务:登录登出、身份信息、菜单授权、切换系统、字典数据等
login
:
(
params
=
{})
=>
vm
.
$u
.
postJson
(
config
.
adminPath
+
'/login'
,
params
),
// getInfo: (params = {}) => vm.$u.get('http://192.168.1.128:8088' + '/getInfo'),
getInfo
:
(
params
=
{})
=>
vm
.
$u
.
get
(
'http://1
92.168.222.60
:8088'
+
'/getInfo'
),
getInfo
:
(
params
=
{})
=>
vm
.
$u
.
get
(
'http://1
82.140.132.45
:8088'
+
'/getInfo'
),
changepassword
:
(
params
=
{})
=>
vm
.
$u
.
postJson
(
config
.
adminPath
+
'/cmsmv/changepassword'
,
params
),
// 到货条码打印查询
getforprint
:
(
params
=
{})
=>
vm
.
$u
.
postJson
(
config
.
adminPath
+
'/purcc/getforprint'
,
params
),
...
...
common/http.interceptor.js
View file @
b4438fde
import
i18n
from
'../lang/index'
/**
* Copyright (c) 2013-Now http://aidex.vip All rights reserved.
*/
...
...
@@ -47,63 +48,18 @@ const install = (Vue, vm) => {
// 响应拦截,判断状态码是否通过
Vue
.
prototype
.
$u
.
http
.
interceptor
.
response
=
async
(
res
,
req
)
=>
{
console
.
log
(
'res111'
,
res
)
let
data
=
res
.
data
;
if
(
!
(
data
))
{
vm
.
$u
.
toast
(
'未连接到服务器'
)
vm
.
$u
.
toast
(
i18n
.
t
(
'未连接到服务器'
)
)
return
false
;
}
// 根据返回的code值来做不同的处理
switch
(
res
.
statusCode
)
{
case
401
:
uni
.
reLaunch
({
url
:
'/pages/sys/login/login'
});
break
;
case
403
:
// 没有权限
if
(
data
.
errorMessage
!==
null
)
{
uni
.
showToast
({
title
:
data
.
errorMessage
,
duration
:
3000
})
}
else
{
uni
.
showToast
({
title
:
'失败'
,
duration
:
3000
})
}
break
;
case
500
:
// 错误
if
(
data
.
errorMessage
!==
null
)
{
uni
.
showToast
({
icon
:
'none'
,
title
:
data
.
errorMessage
||
'未连接到服务器'
,
duration
:
3000
})
}
else
{
uni
.
showToast
({
icon
:
'none'
,
title
:
'未知错误'
,
duration
:
3000
})
}
break
;
}
if
(
!
data
.
success
){
if
(
data
.
errorMessage
!==
null
)
{
uni
.
showToast
({
icon
:
'none'
,
title
:
data
.
errorMessage
,
duration
:
3000
})
vm
.
$u
.
toast
(
data
.
errorMessage
)
}
else
{
uni
.
showToast
({
title
:
'失败'
,
duration
:
3000
})
vm
.
$u
.
toast
(
i18n
.
t
(
'失败'
))
}
}
...
...
lang/th_TH.json
View file @
b4438fde
...
...
@@ -136,5 +136,9 @@
"工单已经完成领料"
:
"ใบสั่งงานเสร็จสมบูรณ์แล้ว"
,
"委外进货单不存在"
:
"ไม่มีใบนำส่งนอกประเทศ"
,
"委外进货单不存在待检明细"
:
"ไม่มีรายละเอียดที่ต้องตรวจสอบในใบส่งของเข้านอกคณะกรรมการ"
,
"未找到到货单"
:
"ไม่พบใบส่งสินค้า"
"未找到到货单"
:
"ไม่พบใบส่งสินค้า"
,
"未连接到服务器"
:
"ไม่ได้เชื่อมต่อกับเซิร์ฟเวอร์"
,
"失败"
:
"ล้มเหลว"
,
"未知错误"
:
"ข้อผิดพลาดที่ไม่รู้จัก"
,
"获取用户语言失败"
:
"ล้มเหลวในการรับภาษาผู้ใช้"
}
lang/zh_CN.json
View file @
b4438fde
...
...
@@ -136,5 +136,9 @@
"工单已经完成领料"
:
"工单已经完成领料"
,
"委外进货单不存在"
:
"委外进货单不存在"
,
"委外进货单不存在待检明细"
:
"委外进货单不存在待检明细"
,
"未找到到货单"
:
"未找到到货单"
"未找到到货单"
:
"未找到到货单"
,
"未连接到服务器"
:
"未连接到服务器"
,
"失败"
:
"失败"
,
"未知错误"
:
"未知错误"
,
"获取用户语言失败"
:
"获取用户语言失败"
}
\ No newline at end of file
pages/sys/login/login.vue
View file @
b4438fde
...
...
@@ -86,7 +86,10 @@ import {setLocal} from '@/lang'
this
.
loading
=
false
;
this
.
$u
.
vuex
(
'vuex_token'
,
res
.
data
.
token
)
this
.
$u
.
api
.
getInfo
().
then
(
res1
=>
{
if
(
!
res1
.
user
)
this
.
$u
.
toast
(
i18n
.
t
(
'获取用户语言失败'
))
res1
.
user
.
locale
?
setLocal
(
res1
.
user
.
locale
.
substring
(
0
,
2
))
:
setLocal
(
'zh'
)
}).
catch
(
e
=>
{
console
.
log
(
'getInfo'
,
e
)
})
this
.
$u
.
vuex
(
'vuex_user'
,
res
.
data
)
if
(
res
.
success
)
{
...
...
uview-ui/libs/request/index.js
View file @
b4438fde
...
...
@@ -31,9 +31,10 @@ class Request {
return
new
Promise
((
resolve
,
reject
)
=>
{
options
.
complete
=
(
response
)
=>
{
// 请求返回后,隐藏loading(如果请求返回快的话,可能会没有loading)
clearTimeout
(
this
.
config
.
timer
);
uni
.
hideLoading
();
// 清除定时器,如果请求回来了,就无需loading
clearTimeout
(
this
.
config
.
timer
);
this
.
config
.
timer
=
null
;
// 判断用户对拦截返回数据的要求,如果originalData为true,返回所有的数据(response)到拦截器,否则只返回response.data
if
(
this
.
config
.
originalData
)
{
...
...
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