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
c3b9f3cb
Commit
c3b9f3cb
authored
Jan 14, 2025
by
沈翠玲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
自动更新改成选择公司后请求
parent
b6c0f4e5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
23 deletions
+13
-23
App.vue
App.vue
+1
-12
http.api.js
common/http.api.js
+0
-4
login.vue
pages/sys/login/login.vue
+12
-7
No files found.
App.vue
View file @
c3b9f3cb
<
script
>
import
i18n
from
'./lang/index'
import
checkappupdate
from
'common/checkappupdate.js'
export
default
{
onLaunch
:
function
()
{
// #ifdef APP-PLUS
...
...
@@ -10,17 +9,7 @@ export default {
// plus.screen.lockOrientation("landscape-primary");
// 锁定竖屏
plus
.
screen
.
lockOrientation
(
"portrait-primary"
);
const
fn
=
()
=>
{
checkappupdate
.
check
({
title
:
i18n
.
t
(
'检测到有新版本!'
),
content
:
i18n
.
t
(
'请升级app到最新版本!'
),
canceltext
:
i18n
.
t
(
'暂不升级'
),
oktext
:
i18n
.
t
(
'立即升级'
)
})
return
fn
// 函数中返回自身
}
setInterval
(
fn
(),
3600
*
1000
)
// #endif
// #endif
},
onShow
:
function
()
{
},
...
...
common/http.api.js
View file @
c3b9f3cb
...
...
@@ -14,10 +14,6 @@ const install = (Vue, vm) => {
// 基础服务:登录登出、身份信息、菜单授权、切换系统、字典数据等
login
:
(
params
=
{})
=>
vm
.
$u
.
postJson
(
uni
.
getStorageSync
(
'apiUrl'
)
+
'/login'
,
params
),
getExAccountInfoApi
:
(
params
=
{})
=>
vm
.
$u
.
postJson
(
config
.
adminPath
+
'/common/getExAccountInfo'
,
params
),
// 上海环境
// getInfo: (params = {}) => vm.$u.get('http://192.168.1.128:8088' + '/getInfo'),
// 外网环境
// getInfo: (params = {}) => vm.$u.get('http://182.140.132.45:9011' + '/getInfo'),
changepassword
:
(
params
=
{})
=>
vm
.
$u
.
postJson
(
uni
.
getStorageSync
(
'apiUrl'
)
+
'/cmsmv/changepassword'
,
params
),
// 到货条码打印查询
getforprint
:
(
params
=
{})
=>
vm
.
$u
.
postJson
(
uni
.
getStorageSync
(
'apiUrl'
)
+
'/purcc/getforprint'
,
params
),
...
...
pages/sys/login/login.vue
View file @
c3b9f3cb
...
...
@@ -2,7 +2,7 @@
<view
class=
"login"
>
<NavBar
:title=
"$t('希迈条码系统')"
left=
""
></NavBar>
<u-form
ref=
"loginForm"
:modelValue=
"loginForm"
:rules=
"loginRules"
class=
"login-form"
>
<u-form-item
prop=
"
username
"
>
<u-form-item
prop=
"
company
"
>
<zxz-uni-data-select
:clear=
'false'
class=
"item-select"
filterable
v-model=
"loginForm.company"
dataKey=
"label"
dataValue=
"value"
:localdata=
"factoryData"
@
change=
"handleChange"
/>
</u-form-item>
...
...
@@ -31,7 +31,7 @@
:loading=
"loading"
size=
"medium"
type=
"primary"
:disabled=
"!loginForm.username || !loginForm.password"
:disabled=
"!loginForm.username || !loginForm.password
|| !loginForm.company
"
style=
"margin-top: 50rpx"
@
click=
"submit()"
>
...
...
@@ -44,6 +44,7 @@
<
script
>
import
i18n
from
'../../../lang/index'
import
checkappupdate
from
'@/common/checkappupdate.js'
import
{
setLocal
}
from
'@/lang'
import
config
from
"../../../common/staticConfig"
;
...
...
@@ -54,7 +55,7 @@ import {setLocal} from '@/lang'
loginForm
:
{
username
:
""
,
password
:
""
,
company
:
config
.
factoryData
[
0
].
value
company
:
null
},
loginRules
:
{
username
:
{
...
...
@@ -62,7 +63,6 @@ import {setLocal} from '@/lang'
{
required
:
true
,
trigger
:
"blur"
,
errorMessage
:
i18n
.
t
(
'请输入您的账号'
)
}
],
},
password
:
{
rules
:
[
{
required
:
true
,
trigger
:
"blur"
,
errorMessage
:
i18n
.
t
(
'请输入您的密码'
)
}
...
...
@@ -85,15 +85,20 @@ import {setLocal} from '@/lang'
value
:
item
.
id
}
});
this
.
loginForm
.
company
=
this
.
factoryData
[
0
].
value
uni
.
setStorageSync
(
'mesUrl'
,
this
.
factoryData
[
0
].
mesUrl
)
uni
.
setStorageSync
(
'apiUrl'
,
this
.
factoryData
[
0
].
apiUrl
)
})
},
handleChange
(
val
)
{
config
.
baseUrl
=
val
.
mesUrl
;
uni
.
setStorageSync
(
'mesUrl'
,
val
.
mesUrl
)
uni
.
setStorageSync
(
'apiUrl'
,
val
.
apiUrl
)
// #ifdef APP-PLUS
checkappupdate
.
check
({
title
:
i18n
.
t
(
'检测到有新版本!'
),
content
:
i18n
.
t
(
'请升级app到最新版本!'
),
canceltext
:
i18n
.
t
(
'暂不升级'
),
oktext
:
i18n
.
t
(
'立即升级'
)
})
// #endif
},
submit
(){
this
.
$refs
.
loginForm
.
validate
().
then
(
valid
=>
{
...
...
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