|
@@ -61,7 +61,7 @@
|
|
|
data() {
|
|
|
return {
|
|
|
loginForm: {
|
|
|
- Env: 'http://10.201.3.146',//测试地址
|
|
|
+ // Env: 'http://10.201.3.146',//测试地址
|
|
|
// Env: 'http://10.200.0.222',
|
|
|
acctID: '5d5812913fe36c',
|
|
|
FStockOrgId: '100',
|
|
@@ -119,6 +119,9 @@
|
|
|
},
|
|
|
onLoad() {
|
|
|
uni.setStorageSync('Url', this.loginForm.Env)
|
|
|
+ if(uni.getStorageSync('Env') == ''){
|
|
|
+ this.loginForm.Env = 'http://10.201.3.146'
|
|
|
+ }
|
|
|
},
|
|
|
mounted() {
|
|
|
//记住密码
|
|
@@ -127,18 +130,20 @@
|
|
|
//缓存的密码
|
|
|
const HBpassword = uni.getStorageSync('HBpassword');
|
|
|
//缓存的业务类型
|
|
|
- const HBFacadeName = uni.getStorageSync('HBFacadeName');
|
|
|
+ const Env = uni.getStorageSync('Env');
|
|
|
console.log('缓存的账号:' + HBusername);
|
|
|
console.log('缓存的密码:' + HBpassword);
|
|
|
+ console.log('缓存的地址:' + Env);
|
|
|
// console.log('缓存的业务类型:' + HBFacadeName);
|
|
|
//有缓存就赋值给文本没有就清空
|
|
|
if (HBusername && HBpassword) {
|
|
|
this.loginForm.UserName = HBusername;
|
|
|
this.loginForm.Password = HBpassword;
|
|
|
- // this.loginForm.FacadeName = HBFacadeName;
|
|
|
+ this.loginForm.Env = Env;
|
|
|
} else {
|
|
|
this.loginForm.UserName = '';
|
|
|
this.loginForm.Password = '';
|
|
|
+ this.loginForm.Env = 'http://10.201.3.146';
|
|
|
|
|
|
}
|
|
|
//自动登录
|
|
@@ -157,10 +162,12 @@
|
|
|
//获取缓存的账号 赋值
|
|
|
uni.getStorageSync('HBusername', this.loginForm.UserName);
|
|
|
uni.getStorageSync('HBpassword', this.loginForm.Password);
|
|
|
+ uni.getStorageSync('Env', this.loginForm.Env);
|
|
|
} else {
|
|
|
//销毁
|
|
|
uni.removeStorageSync('HBusername');
|
|
|
uni.removeStorageSync('HBpassword');
|
|
|
+ uni.removeStorageSync('Env');
|
|
|
}
|
|
|
},
|
|
|
// 登录方法
|
|
@@ -199,12 +206,12 @@
|
|
|
if (this.rememberPsw) {
|
|
|
uni.setStorageSync('HBusername', this.loginForm.UserName);
|
|
|
uni.setStorageSync('HBpassword', this.loginForm.Password);
|
|
|
- // uni.setStorageSync('HBFacadeName', this.loginForm.FacadeName);
|
|
|
+ uni.setStorageSync('Env', this.loginForm.Env);
|
|
|
} else {
|
|
|
//销毁缓存
|
|
|
uni.removeStorageSync('HBusername');
|
|
|
uni.removeStorageSync('HBpassword');
|
|
|
- // uni.removeStorageSync('HBFacadeName');
|
|
|
+ uni.removeStorageSync('Env');
|
|
|
}
|
|
|
|
|
|
// 设置用户信息
|