|
@@ -12,6 +12,10 @@
|
|
|
<input class="psd_input" v-model="userInfo.passWord" :password="eye"></input>
|
|
|
<image :src="eye?Frame:browse" class='login_icon_eye' alt="" @click="showpsd">
|
|
|
</u-form-item>
|
|
|
+ <u-form-item prop="userInfo.name" class="label_left">
|
|
|
+ <image :src="user_img" class='login_icon' alt="">
|
|
|
+ <u--input v-model="addressIp"></u--input>
|
|
|
+ </u-form-item>
|
|
|
</u--form>
|
|
|
<u-button type="primary" text="登录" class="btn" @click="submit"></u-button>
|
|
|
</view>
|
|
@@ -28,6 +32,7 @@
|
|
|
import lockon from "@/static/login_img/lock-on.png"
|
|
|
import user from "@/static/login_img/user.png"
|
|
|
import browse from "@/static/login_img/browse.png"
|
|
|
+ import config from "@/config";
|
|
|
export default {
|
|
|
name: "son",
|
|
|
data() {
|
|
@@ -43,7 +48,8 @@
|
|
|
},
|
|
|
eye: true,
|
|
|
popupType:'',
|
|
|
- popupMessage:''
|
|
|
+ popupMessage:'',
|
|
|
+ addressIp:this.$storage.getJson('addressIp')?this.$storage.getJson('addressIp'):'192.168.3.177:8080'
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -57,6 +63,13 @@
|
|
|
this.$refs.Exchangepopup.open()
|
|
|
},
|
|
|
submit() {
|
|
|
+
|
|
|
+ config.uni_app_web_api_url='http://'+this.addressIp+'/api'
|
|
|
+ config.web_socket_url='ws://'+this.addressIp+'/ws/'
|
|
|
+ if(!this.addressIp){
|
|
|
+ this.ExchangeMessage('error', '请输入IP地址')
|
|
|
+ return
|
|
|
+ }
|
|
|
this.$utils.showLoading('登录中')
|
|
|
if (this.userInfo.userAccount && this.userInfo.passWord) {
|
|
|
this.$http.wxLogin(this.userInfo).then(res => {
|
|
@@ -64,6 +77,7 @@
|
|
|
if(res.code == 0){
|
|
|
this.$storage.setJson("token",res.data.token)
|
|
|
this.$storage.setJson("userId",res.data.userId)
|
|
|
+ this.$storage.setJson("addressIp",this.addressIp)
|
|
|
uni.navigateTo({
|
|
|
url: '/pages/home/index'
|
|
|
})
|
|
@@ -113,7 +127,7 @@
|
|
|
|
|
|
.u-form-item__body {
|
|
|
padding: 0px 0px;
|
|
|
- margin-bottom: 32px;
|
|
|
+ margin-bottom: 28px;
|
|
|
}
|
|
|
|
|
|
.u-form-item__body__right__content ,.psd_input{
|