修改登录及设备授权处理
This commit is contained in:
@@ -80,7 +80,6 @@ import { v4 as uuidv4 } from 'uuid'
|
||||
import { getNavBarPaddingTop} from '@/utils/system.js';
|
||||
import { getBindStatus,authDeviceApply,authInputCode } from '@/api/auth.js';
|
||||
import {showToast,showAlert} from '@/utils/message.js'
|
||||
import { CLIENT_ID,NETWORK_ENV } from '@/enums/cacheEnums';
|
||||
import encryptObj from '@/utils/encrypt.js'
|
||||
import { requestAndroidPermissionAsync } from '@/utils/common.js'
|
||||
|
||||
@@ -94,8 +93,10 @@ const safeSave = uni.requireNativePlugin("Tm-TmSafeSaveFileModule");
|
||||
// #endif
|
||||
let systemInfo = {};
|
||||
let deviceId = ref(undefined);
|
||||
let clientId = `${proxy.$CLIENT_ID || 2}`;
|
||||
let networkEnv = ref(proxy.$NETWORK_ENV);//1-内网 2-外网
|
||||
onLoad(async(opt) => {
|
||||
console.log("deviceAuth=>onLoad");
|
||||
console.log("deviceAuth=>onLoad",clientId,networkEnv);
|
||||
uni.setStorageSync('page_cache',true);
|
||||
// uni.preloadPage({url: "/pages/login/login"});
|
||||
// uni.preloadPage({url: "/pages/home/home"});
|
||||
@@ -210,14 +211,19 @@ const submitForm = async() => {
|
||||
// 用户名和密码登录
|
||||
form2.value.validate().then(async param => {
|
||||
btnLoading.value = true;
|
||||
deviceId.value = uuidv4();
|
||||
let clientId = `${CLIENT_ID || 2}`;
|
||||
//1-内网,2-外网
|
||||
if(networkEnv==1){
|
||||
deviceId.value = form2.value.uniqCode;
|
||||
}else{
|
||||
deviceId.value = uuidv4(); //2-外网 生成的设备唯一标识
|
||||
}
|
||||
|
||||
let password = encryptObj.Encrypt(param.username + clientId + "," + param.password);
|
||||
let params = {
|
||||
username:param.username,
|
||||
password,
|
||||
networkEnv:NETWORK_ENV,//1-内网,2-外网
|
||||
uniqCode:deviceId.value,//生成的设备唯一标识
|
||||
networkEnv:networkEnv.value,//1-内网,2-外网
|
||||
uniqCode:deviceId.value,
|
||||
...systemInfo,//设备信息
|
||||
// #ifdef APP-PLUS
|
||||
verId:systemInfo.appWgtVersion,//当前版本号
|
||||
@@ -402,6 +408,7 @@ const handleSubmit=()=>{
|
||||
border-bottom: 1px solid #E7E7E7;
|
||||
}
|
||||
|
||||
|
||||
:deep(.uni-forms-item__label){
|
||||
color:#239FDF;
|
||||
font-weight: bold;
|
||||
|
||||
Reference in New Issue
Block a user