From 3930a1d44ab273a6d7155f4fa4163944458c7ca1 Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期二, 10 一月 2023 15:53:51 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master' into master
---
pages/login/login.vue | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/pages/login/login.vue b/pages/login/login.vue
index 722e0a9..d9d9ccd 100644
--- a/pages/login/login.vue
+++ b/pages/login/login.vue
@@ -44,11 +44,12 @@
load: {
loading: false,
btnText: '鐧诲綍'
- }
+ },
}
},
onLoad:function(){
this.user.userName = uni.getStorageSync('userName')
+ this.user.password = uni.getStorageSync('password')
// #ifdef APP-PLUS
var that=this
plus.runtime.getProperty( plus.runtime.appid, function ( wgtinfo ) {
@@ -65,9 +66,9 @@
onLogin() {
let that = this
uni.request({
- url: 'http://192.168.50.101:9528/login.action',
+ url: that.baseUrl + '/login.action',
fail(result) {
- uni.showToast({title: '璇锋眰澶辫触'})
+ uni.showToast({icon:'error',title: '璇锋眰澶辫触'})
},
data: {
username:that.user.userName,
@@ -77,12 +78,17 @@
"content-type": "application/json"
},
success(result) {
+ if (result.statusCode === 404) {
+ uni.showToast({title: '鐧诲綍澶辫触', icon: "error"})
+ return
+ }
let res = result.data
if (res.code === 200 ){
that.load.loading = true;
that.load.btnText = '鐧诲綍涓�';
uni.setStorageSync('token', res.data.token);
uni.setStorageSync('userName', that.user.userName);
+ uni.setStorageSync('password', that.user.password);
setTimeout(()=> {
uni.showToast({title: '鐧诲綍鎴愬姛'})
setTimeout(()=> {
--
Gitblit v1.9.1