|
|
@@ -23,7 +23,7 @@
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
import { ref } from 'vue'
|
|
|
-import { checkAttendance } from '@/api/mine.js'
|
|
|
+import { checkAttendance, changePWD } from '@/api/mine.js'
|
|
|
import config from '@/config.js'
|
|
|
import $modal from '@/plugins/modal.js'
|
|
|
import $tab from '@/plugins/tab.js'
|
|
|
@@ -48,13 +48,46 @@ function handleLogin() {
|
|
|
} else {
|
|
|
$modal.loading("登录中,请耐心等待...")
|
|
|
// TEST: 测试登录接口
|
|
|
- userStore.Login(loginForm.value).then(() => {
|
|
|
- $modal.closeLoading()
|
|
|
- loginSuccess()
|
|
|
+ userStore.Login(loginForm.value).then((res) => {
|
|
|
+ if (loginForm.value.password == '123456') {
|
|
|
+ changeOrgPWD(res.returnParams.useId)
|
|
|
+ } else {
|
|
|
+ $modal.closeLoading()
|
|
|
+ loginSuccess()
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+function changeOrgPWD(staffId) {
|
|
|
+ $modal.editable('修改初始密码', '请输入大于6位的新密码', false).then((newpassword) => {
|
|
|
+ if (newpassword < 99999) {
|
|
|
+ $modal.syncAlert('密码需大于6位').then(() => {
|
|
|
+ changeOrgPWD(staffId)
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (newpassword == '123456') {
|
|
|
+ $modal.syncAlert('请勿使用123456作为密码').then(() => {
|
|
|
+ changeOrgPWD(staffId)
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const params = {
|
|
|
+ staffId,
|
|
|
+ oldpassword: loginForm.value.password,
|
|
|
+ newpassword,
|
|
|
+ }
|
|
|
+ changePWD(params).then(res => {
|
|
|
+ loginForm.value.password = newpassword
|
|
|
+ $modal.showToast(res.returnMsg);
|
|
|
+ if ("1" == res.returnCode) { //修改成功
|
|
|
+ handleLogin()
|
|
|
+ } else {
|
|
|
+ changeOrgPWD(staffId)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+}
|
|
|
onLoad((options) => {
|
|
|
//判断是否要自动登录
|
|
|
if (options.type) {
|