联调接口

This commit is contained in:
xuli3099
2025-08-12 16:19:19 +08:00
parent 7c5233f8f5
commit 107cc64a81
9 changed files with 70 additions and 73 deletions

View File

@@ -77,7 +77,6 @@ import { ref,onMounted } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import customTabs from '@/components/customTabs.vue';
import {isPhoneNumber} from '@/utils/validate';
import {showAlert} from '@/utils/message';
import { getVerifyCode,login } from '@/api/auth';
import cache from '@/utils/cache';
import { AGREEWELCOME_KEY } from '@/enums/cacheEnums';
@@ -103,8 +102,8 @@ const tabList = ['验证码登录', '账号登录'];
// 验证码登录
const form = ref(null);
const formData = ref({
phone: '15112345600',
verifyCode: '123456',
phone: '',
verifyCode: '',
loginType:0
});
@@ -188,8 +187,8 @@ let resetCountdown =()=>{
// 账号登录
const form2 = ref(null);
const formData2 = ref({
username: '445',
password: '123456',
username: '',
password: '',
loginType:1
});
@@ -230,7 +229,7 @@ const submitForm = () => {
if(activeTab.value===0){
form.value.validate().then(async param => {
// 2.调用登录接口
param.loginType = activeTab.value; console.log('表单数据00:', param);
param.loginType = activeTab.value;
let res = await login(param)
// 3.登录后存储token
userStore.login(res);
@@ -244,12 +243,11 @@ const submitForm = () => {
// 用户名和密码登录
form2.value.validate().then(async param => {
param.loginType = activeTab.value;
let cilentId = `${CLIENT_ID || 2}`;
let password = encryptObj.Encrypt(param.username + cilentId + "," + param.password);
let clientId = `${CLIENT_ID || "2"}`;
let password = encryptObj.Encrypt(param.username + clientId + "," + param.password);
param.password = password;
param.uniqCode = uni.getStorageSync('app_device_id');//先从缓存取之后处理
console.log("login->param->",param)
param.uniqCode = 'bf52f71a-a951-43c3-a63d-0927d7854955'// uni.getStorageSync('app_device_id');//先从缓存取之后处理
param.clientId = clientId;
let res = await login(param);
userStore.login(res);
uni.switchTab({ url: '/pages/home/home' })