页面功能修改
This commit is contained in:
+20
-2
@@ -10,7 +10,13 @@
|
||||
<view class="inputs_button">
|
||||
<view class="inputs">
|
||||
<view class="account">
|
||||
<input type="text" v-model="email" :placeholder="$t('account')" />
|
||||
<u--input
|
||||
type="text"
|
||||
:placeholder="$t('account')"
|
||||
v-model="email"
|
||||
border="none"
|
||||
></u--input>
|
||||
<!-- <input type="text" v-model="email" :placeholder="$t('account')" /> -->
|
||||
</view>
|
||||
<view class="password">
|
||||
<u--input
|
||||
@@ -81,9 +87,15 @@
|
||||
id: 'ru'
|
||||
}]
|
||||
],
|
||||
language:'zh-Hans'
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
if(uni.getStorageSync('token')){
|
||||
uni.reLaunch({
|
||||
url: '/pages/index/index',// 替换为你要跳转的页面路径
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
close(){
|
||||
@@ -96,6 +108,7 @@
|
||||
confirmlang(e) {
|
||||
this.$i18n.locale = e.value[0].id
|
||||
uni.setStorageSync('i18locale', e.value[0].id);
|
||||
this.language = e.value[0].id
|
||||
this.showlang = false
|
||||
this.columns =[
|
||||
[{
|
||||
@@ -166,12 +179,16 @@
|
||||
});
|
||||
return false
|
||||
}
|
||||
if(this.language=='zh-Hans'){
|
||||
this.language= 'zh_CN'
|
||||
}
|
||||
request({
|
||||
url:'user/login',
|
||||
method:'POST',
|
||||
data:{
|
||||
email: this.email,
|
||||
password: this.password,
|
||||
language: this.language,
|
||||
}
|
||||
}).then(res => {
|
||||
console.log(res.data.data)
|
||||
@@ -179,10 +196,11 @@
|
||||
uni.showToast({
|
||||
title: res.data.message,
|
||||
icon: 'none'
|
||||
});token
|
||||
});
|
||||
|
||||
} else if (res.data.code == 0) {
|
||||
//存取session
|
||||
uni.setStorageSync('userinfo',JSON.stringify(res.data.data));
|
||||
uni.setStorageSync('token', res.data.data.token);
|
||||
//返回数据接收成功
|
||||
uni.reLaunch({
|
||||
|
||||
Reference in New Issue
Block a user