更新
This commit is contained in:
@@ -29,6 +29,18 @@
|
||||
<el-button class="login_btn" type="primary" :loading="loading" @click.native.prevent="handleLogin">{{
|
||||
$t('login.logIn') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<div class="login_ws_setting">
|
||||
<el-button type="text" @click="showSocketSetting = !showSocketSetting">
|
||||
{{ showSocketSetting ? '收起' : '设置 WebSocket 服务地址' }}
|
||||
</el-button>
|
||||
<div v-if="showSocketSetting" class="login_ws_input">
|
||||
<el-input v-model="socketApi" placeholder="例如 ws://127.0.0.1:10010 或 ws://服务器IP:10010"
|
||||
@blur="saveSocketApi" size="small" />
|
||||
<span class="login_ws_tip">网页端部署后请填写实际服务地址,保存后刷新或重新登录生效</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
@@ -83,10 +95,25 @@ export default {
|
||||
},
|
||||
isChecked: true,
|
||||
loading: false,
|
||||
pwdType: 'password'
|
||||
pwdType: 'password',
|
||||
showSocketSetting: false,
|
||||
socketApi: ''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
try {
|
||||
this.socketApi = localStorage.getItem('WS_SOCKET_API') || 'ws://127.0.0.1:10010'
|
||||
} catch (e) {
|
||||
this.socketApi = 'ws://127.0.0.1:10010'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
saveSocketApi() {
|
||||
try {
|
||||
const v = (this.socketApi || '').trim()
|
||||
if (v) localStorage.setItem('WS_SOCKET_API', v)
|
||||
} catch (e) {}
|
||||
},
|
||||
showPwd() {
|
||||
if (this.pwdType === 'password') {
|
||||
this.pwdType = ''
|
||||
@@ -260,6 +287,20 @@ $light_gray: #eee;
|
||||
font-size: 24px;
|
||||
color: #00BCC3;
|
||||
}
|
||||
|
||||
.login_ws_setting {
|
||||
width: 100%;
|
||||
.login_ws_input {
|
||||
margin-top: 8px;
|
||||
.el-input { width: 100%; }
|
||||
}
|
||||
.login_ws_tip {
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
margin-top: 4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user