|
|
|
<template>
|
<view class="content" >
|
<image class="logo" src="/static/favicon.ico"></image>
|
<view class="text-area">
|
<text class="title">NorthGlass_Scaner 初始化</text>
|
</view>
|
|
|
<view class="text-area" >
|
<uni-easyinput
|
@blur="changeIP"
|
class='input_1'
|
style="text-align: center;"
|
placeholder="请输入服务器ip"
|
:passwordIcon='false'
|
v-model="ipVal"
|
type="input" />
|
</view>
|
|
<view>
|
<!-- 提示信息弹窗 -->
|
<uni-popup ref="message" type="message">
|
<uni-popup-message :type="msgType" :message="messageText" :duration="2000" />
|
</uni-popup>
|
</view>
|
</view>
|
</template>
|
|
<script setup>
|
import {onMounted, reactive,ref} from "vue"
|
import userInfo from '@/stores/userInfo'
|
import request from '@/utils/request'
|
import {ip,webPort} from '@/utils/config.js'
|
|
const store=userInfo()
|
let searchUserList = ref({
|
userName:null
|
})
|
let users = ref([])
|
const message = ref(null)
|
const type=ref('center')
|
const msgType=ref('success')
|
const messageText=ref('')
|
const viewShow = ref(false)
|
let ipVal = ref(null)
|
|
onMounted(async()=>{
|
|
/* if(ip===null){
|
return
|
}
|
uni.reLaunch({
|
url: `/pages/login/login`
|
}) */
|
})
|
|
|
|
//提示打开
|
const messageToggle = (type,msg) =>{
|
msgType.value = type
|
messageText.value = msg
|
message.value.open()
|
}
|
|
|
const changeIP =async () => {
|
const ipRegex = /^(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
|
if(ipRegex.test(ipVal.value)){
|
await uni.setStorageSync('ip', ipVal.value);
|
plus.runtime.restart()
|
|
}else{
|
messageToggle('error','请输入IP范围:0.0.0.0~255.255.255.255')
|
}
|
}
|
|
</script>
|
|
<style>
|
/* .login{
|
width: 100px;height: 45px;margin: 0 auto;
|
} */
|
.content {
|
display: flex;
|
flex-direction: column;
|
align-items: center;
|
justify-content: center;
|
margin-top: -30%;
|
}
|
|
.logo {
|
height: 200rpx;
|
width: 200rpx;
|
margin-top: 200rpx;
|
margin-left: auto;
|
margin-right: auto;
|
margin-bottom: 50rpx;
|
}
|
|
.text-area {
|
display: flex;
|
justify-content: center;
|
padding-bottom: 1rem;
|
}
|
</style>
|