From a6f64303f88508d1c4d6ce53ff46be6b745cfb93 Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期二, 14 十月 2025 15:21:59 +0800
Subject: [PATCH] 完成营养师管理
---
src/views/login/component/account.vue | 34 ++++++++++++++++++----------------
1 files changed, 18 insertions(+), 16 deletions(-)
diff --git a/src/views/login/component/account.vue b/src/views/login/component/account.vue
index 38ecb11..fe3b991 100644
--- a/src/views/login/component/account.vue
+++ b/src/views/login/component/account.vue
@@ -1,7 +1,7 @@
<template>
<el-form size="large" class="login-content-form">
<el-form-item class="login-animation1">
- <el-input text :placeholder="$t('message.account.accountPlaceholder1')" v-model="state.ruleForm.userName" clearable autocomplete="off">
+ <el-input text placeholder="请输入用户登录账号默认是手机号码" v-model="state.ruleForm.userName" clearable autocomplete="off">
<template #prefix>
<el-icon class="el-input__icon"><ele-User /></el-icon>
</template>
@@ -85,9 +85,9 @@
LS_token: '',
isShowPassword: false,
ruleForm: {
- userName: 'cycems',
- password: '123456',
- code: '1234',
+ userName: '',
+ password: '',
+ code: '',
clientCode: '',
},
clients: [],
@@ -120,7 +120,7 @@
} else { //第一次登录没有选择到客户
state.loading.signIn = true;
- const signInRes = await signIn(`user_no=${state.ruleForm.userName}&user_password=${state.ruleForm.password}`);
+ const signInRes = await signIn(`userno=${state.ruleForm.userName}&password=${state.ruleForm.password}`);
if (signInRes.data) {
// 存储 token 到浏览器缓存
Session.set('token', signInRes.data);
@@ -149,17 +149,19 @@
) {
console.log('管理员登录');
- var ps= new Object ({
- page: 0,
- size: 0,
- wherecondition: '',
- ordercondition: 'create_time desc'
- })
- getclients(ps).then(re=>{
- state.clients = re.data.list;
- }).finally(()=>{
- state.loading.signIn = false;
- })
+ state.loading.signIn = false;
+ state.clients=userinfoRes?.data?.管理员能看到的客户列表
+ // 看看有没有缓存客户选择
+ const lscode=Local.get('client_'+state.ruleForm.userName)
+
+ if(lscode){
+ const x=state.clients.findIndex((cl:any)=>{return cl.code===lscode})
+ if(x>=0){
+ // 默认选择客户项
+ state.ruleForm.clientCode=lscode
+ }
+ }
+ ElMessage.success('请选择登录客户再登录')
} else {
console.log('普通登录');
--
Gitblit v1.8.0