联调接口
This commit is contained in:
@@ -81,10 +81,11 @@ import {showAlert} from '@/utils/message';
|
||||
import { getVerifyCode,login } from '@/api/auth';
|
||||
import cache from '@/utils/cache';
|
||||
import { AGREEWELCOME_KEY } from '@/enums/cacheEnums';
|
||||
|
||||
import { getNavBarPaddingTop} from '@/utils/system.js'
|
||||
|
||||
import { useUserStore } from '@/stores/user';
|
||||
import encryptObj from '@/utils/encrypt.js'
|
||||
import { CLIENT_ID } from '@/enums/cacheEnums';
|
||||
|
||||
const userStore = useUserStore()
|
||||
onLoad(async(opt) => {
|
||||
uni.setStorageSync('page_cache',true);
|
||||
@@ -187,7 +188,7 @@ let resetCountdown =()=>{
|
||||
// 账号登录
|
||||
const form2 = ref(null);
|
||||
const formData2 = ref({
|
||||
username: 'admin',
|
||||
username: '445',
|
||||
password: '123456',
|
||||
loginType:1
|
||||
});
|
||||
@@ -196,13 +197,13 @@ const rules2 = {
|
||||
username: {
|
||||
rules: [
|
||||
{ required: true, errorMessage: '请输入用户名' },
|
||||
{ minLength: 3, maxLength: 10, errorMessage: '用户名长度在3到10个字符之间' }
|
||||
// { minLength: 3, maxLength: 10, errorMessage: '用户名长度在3到10个字符之间' }
|
||||
]
|
||||
},
|
||||
password: {
|
||||
rules: [
|
||||
{ required: true, errorMessage: '请输入密码' },
|
||||
{ pattern: /^[a-zA-Z0-9]{6,12}$/, errorMessage: '密码必须是6-12位字母或数字' }
|
||||
// { pattern: /^[a-zA-Z0-9]{6,12}$/, errorMessage: '密码必须是6-12位字母或数字' }
|
||||
]
|
||||
}
|
||||
};
|
||||
@@ -242,7 +243,13 @@ const submitForm = () => {
|
||||
}else if(activeTab.value===1){
|
||||
// 用户名和密码登录
|
||||
form2.value.validate().then(async param => {
|
||||
param.loginType = activeTab.value; console.log('表单数据11:', formData2.value);
|
||||
param.loginType = activeTab.value;
|
||||
let cilentId = `${CLIENT_ID || 2}`;
|
||||
let password = encryptObj.Encrypt(param.username + cilentId + "," + param.password);
|
||||
param.password = password;
|
||||
param.uniqCode = uni.getStorageSync('app_device_id');//先从缓存取之后处理
|
||||
|
||||
console.log("login->param->",param)
|
||||
let res = await login(param);
|
||||
userStore.login(res);
|
||||
uni.switchTab({ url: '/pages/home/home' })
|
||||
|
||||
Reference in New Issue
Block a user