Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
梁建民
/
wmsApp
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2c4b1ef1
authored
Nov 09, 2023
by
LJM
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
深圳华云数智工业科技有限公司
parent
2e8db2c7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
95 additions
and
92 deletions
pages/mine/login.vue
pages/mine/login.vue
View file @
2c4b1ef1
<
template
>
<view
class=
"page-login column rowCenter verCenter"
>
<view
class=
"logo"
><image
src=
"/static/WMS@2x.png"
mode=
"aspectFill"
></image></view>
<view
class=
"logo"
>
<image
src=
"/static/WMS@2x.png"
mode=
"aspectFill"
></image>
</view>
<view
class=
"company row rowCenter verCenter"
>
<picker
@
change=
"bindPickerChange"
:value=
"index"
:range=
"array"
>
<view
class=
"row verCenter"
>
...
...
@@ -23,109 +25,109 @@
</
template
>
<
script
>
import
{
API
}
from
'@/util/api.js'
;
import
md5
from
'@/util/md5.js'
;
import
{
API
}
from
'@/util/api.js'
;
import
md5
from
'@/util/md5.js'
;
export
default
{
data
()
{
return
{
index
:
0
,
array
:
[
'深圳市猎芯科技有限公司'
,
'深贸电子
有限公司'
],
name
:
''
,
passwd
:
''
,
disabled
:
false
};
},
onLoad
()
{
uni
.
removeStorageSync
(
'oa_skey'
);
uni
.
removeStorageSync
(
'oa_user_id'
);
uni
.
removeStorageSync
(
'company_id'
);
uni
.
removeStorageSync
(
'oa_user_email'
);
export
default
{
data
()
{
return
{
index
:
0
,
array
:
[
'深圳市猎芯科技有限公司'
,
'深贸电子有限公司'
,
'深圳华云数智工业科技
有限公司'
],
name
:
''
,
passwd
:
''
,
disabled
:
false
};
},
onLoad
()
{
uni
.
removeStorageSync
(
'oa_skey'
);
uni
.
removeStorageSync
(
'oa_user_id'
);
uni
.
removeStorageSync
(
'company_id'
);
uni
.
removeStorageSync
(
'oa_user_email'
);
//记住密码
const
name
=
uni
.
getStorageSync
(
'name'
)
||
''
;
const
passwd
=
uni
.
getStorageSync
(
'passwd'
)
||
''
;
//记住密码
const
name
=
uni
.
getStorageSync
(
'name'
)
||
''
;
const
passwd
=
uni
.
getStorageSync
(
'passwd'
)
||
''
;
if
(
name
&&
passwd
)
{
this
.
name
=
name
;
this
.
passwd
=
passwd
;
}
},
methods
:
{
bindPickerChange
:
function
(
e
)
{
console
.
log
(
'picker发送选择改变,携带值为'
,
e
.
detail
.
value
);
this
.
index
=
e
.
detail
.
value
;
this
.
disabled
=
false
;
if
(
name
&&
passwd
)
{
this
.
name
=
name
;
this
.
passwd
=
passwd
;
}
},
/**
* 组织切换
*/
changeOrgId
()
{
this
.
request
(
API
.
changeOrgId
,
'POST'
,
{
org_id
:
Number
(
this
.
index
)
+
1
},
false
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
this
.
disabled
=
false
;
methods
:
{
bindPickerChange
:
function
(
e
)
{
console
.
log
(
'picker发送选择改变,携带值为'
,
e
.
detail
.
value
);
this
.
index
=
e
.
detail
.
value
;
this
.
disabled
=
false
;
},
/**
* 组织切换
*/
changeOrgId
()
{
this
.
request
(
API
.
changeOrgId
,
'POST'
,
{
org_id
:
Number
(
this
.
index
)
+
1
},
false
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
this
.
disabled
=
false
;
uni
.
showToast
({
title
:
'登录成功'
,
icon
:
'success'
});
setTimeout
(()
=>
{
uni
.
redirectTo
({
url
:
'/pages/index/index'
});
},
2000
);
}
else
{
this
.
disabled
=
true
;
uni
.
showModal
({
title
:
'提示'
,
content
:
res
.
msg
,
showCancel
:
false
});
}
});
},
/**
* 提交
*/
submit
()
{
if
(
!
this
.
name
)
{
uni
.
showToast
({
title
:
'
登录成功
'
,
icon
:
'
success
'
title
:
'
请输入登录账号
'
,
icon
:
'
error
'
});
setTimeout
(()
=>
{
uni
.
redirectTo
({
url
:
'/pages/index/index'
});
},
2000
);
}
else
{
this
.
disabled
=
true
;
uni
.
showModal
({
title
:
'提示'
,
content
:
res
.
msg
,
showCancel
:
false
return
false
;
}
if
(
!
this
.
passwd
)
{
uni
.
showToast
({
title
:
'请输入登录密码'
,
icon
:
'error'
});
return
false
;
}
});
},
/**
* 提交
*/
submit
()
{
if
(
!
this
.
name
)
{
uni
.
showToast
({
title
:
'请输入登录账号'
,
icon
:
'error'
});
return
false
;
}
if
(
!
this
.
passwd
)
{
uni
.
showToast
({
title
:
'请输入登录密码'
,
icon
:
'error'
uni
.
setStorageSync
(
'name'
,
this
.
name
);
uni
.
setStorageSync
(
'passwd'
,
this
.
passwd
);
this
.
request
(
API
.
login
,
'POST'
,
{
name
:
this
.
name
,
passwd
:
md5
.
hex_md5_32
(
this
.
passwd
)
},
true
).
then
(
res
=>
{
if
(
res
.
retcode
===
0
)
{
uni
.
setStorageSync
(
'oa_skey'
,
res
.
data
.
skey
);
uni
.
setStorageSync
(
'oa_user_id'
,
res
.
data
.
userId
);
uni
.
setStorageSync
(
'company_id'
,
Number
(
this
.
index
)
+
1
);
//调用选用组织
this
.
changeOrgId
();
}
else
{
uni
.
showModal
({
title
:
'提示'
,
content
:
res
.
errMsg
,
showCancel
:
false
});
}
});
return
false
;
}
uni
.
setStorageSync
(
'name'
,
this
.
name
);
uni
.
setStorageSync
(
'passwd'
,
this
.
passwd
);
this
.
request
(
API
.
login
,
'POST'
,
{
name
:
this
.
name
,
passwd
:
md5
.
hex_md5_32
(
this
.
passwd
)
},
true
).
then
(
res
=>
{
if
(
res
.
retcode
===
0
)
{
uni
.
setStorageSync
(
'oa_skey'
,
res
.
data
.
skey
);
uni
.
setStorageSync
(
'oa_user_id'
,
res
.
data
.
userId
);
uni
.
setStorageSync
(
'company_id'
,
Number
(
this
.
index
)
+
1
);
//调用选用组织
this
.
changeOrgId
();
}
else
{
uni
.
showModal
({
title
:
'提示'
,
content
:
res
.
errMsg
,
showCancel
:
false
});
}
});
}
}
};
};
</
script
>
<
style
lang=
"scss"
>
@import
'@/assets/css/mine/login.scss'
;
</
style
>
@import
'@/assets/css/mine/login.scss'
;
</
style
>
\ No newline at end of file
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