|
@@ -19,7 +19,7 @@
|
|
<text class="title">请登录</text>
|
|
<text class="title">请登录</text>
|
|
|
|
|
|
<!-- #ifdef APP-PLUS -->
|
|
<!-- #ifdef APP-PLUS -->
|
|
- <view id="okay">首次账号登录请先配置服务器</view>
|
|
|
|
|
|
+ <view id="okay" v-if="!linkUrl">首次账号登录请先配置服务器</view>
|
|
<!-- <u-icon class="icons" name="scan" color="gray" size="22"></u-icon> -->
|
|
<!-- <u-icon class="icons" name="scan" color="gray" size="22"></u-icon> -->
|
|
<view class="setting" @tap="goSeverConfig"> 配置服务器 </view>
|
|
<view class="setting" @tap="goSeverConfig"> 配置服务器 </view>
|
|
<!--#endif-->
|
|
<!--#endif-->
|
|
@@ -62,7 +62,7 @@
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
import { onLoad, onShow, onHide, onLaunch } from "@dcloudio/uni-app";
|
|
import { onLoad, onShow, onHide, onLaunch } from "@dcloudio/uni-app";
|
|
-import { reactive, getCurrentInstance, toRefs, inject } from "vue";
|
|
|
|
|
|
+import { reactive, getCurrentInstance, toRefs, inject, watchEffect } from "vue";
|
|
import { getToken, setToken, removeToken } from "@/utils/auth";
|
|
import { getToken, setToken, removeToken } from "@/utils/auth";
|
|
import { Lock, User, Cellphone } from "@element-plus/icons-vue";
|
|
import { Lock, User, Cellphone } from "@element-plus/icons-vue";
|
|
import { getCodeImg, getMobileTenantConfig } from "@/api/login";
|
|
import { getCodeImg, getMobileTenantConfig } from "@/api/login";
|
|
@@ -90,11 +90,13 @@ const data = reactive({
|
|
username: undefined,
|
|
username: undefined,
|
|
password: undefined,
|
|
password: undefined,
|
|
inputIconBool: true,
|
|
inputIconBool: true,
|
|
|
|
+ /** 服务器配置数据 */
|
|
|
|
+ linkUrl: uni.getStorageSync("serveUrl"),
|
|
|
|
|
|
// VerificationCodeOne
|
|
// VerificationCodeOne
|
|
});
|
|
});
|
|
|
|
|
|
-const { title, bg, bottomTitle, logo, phone, verify, codeTime, switchText, username, password, tenantId, inputIconBool } = toRefs(data);
|
|
|
|
|
|
+const { title, bg, bottomTitle, logo, phone, verify, codeTime, switchText, username, password, tenantId, inputIconBool, linkUrl } = toRefs(data);
|
|
|
|
|
|
function goSeverConfig() {
|
|
function goSeverConfig() {
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
@@ -158,22 +160,18 @@ function env() {
|
|
// }
|
|
// }
|
|
|
|
|
|
//#ifdef H5
|
|
//#ifdef H5
|
|
- var linkUrl = window.location.host;
|
|
|
|
|
|
+ linkUrl.value = window.location.host;
|
|
// var linkUrl='ces.cn';
|
|
// var linkUrl='ces.cn';
|
|
// var linkUrl='172.16.120.165:13203'
|
|
// var linkUrl='172.16.120.165:13203'
|
|
//#endif
|
|
//#endif
|
|
|
|
|
|
- //#ifdef APP-PLUS
|
|
|
|
- var linkUrl = newPublicStore.serveUrl;
|
|
|
|
- //#endif
|
|
|
|
|
|
+ getMobileTenantConfigApi({ url: linkUrl.value });
|
|
|
|
|
|
// uni.showToast({
|
|
// uni.showToast({
|
|
// title: '服务器链接地址为'+linkUrl,
|
|
// title: '服务器链接地址为'+linkUrl,
|
|
// icon: "none",
|
|
// icon: "none",
|
|
// })
|
|
// })
|
|
|
|
|
|
- getMobileTenantConfigApi({ url: linkUrl });
|
|
|
|
-
|
|
|
|
// let port = uni.getSystemInfoSync().platform;
|
|
// let port = uni.getSystemInfoSync().platform;
|
|
// switch (port) {
|
|
// switch (port) {
|
|
// case "android":
|
|
// case "android":
|
|
@@ -196,8 +194,7 @@ function env() {
|
|
/** 点击提交按钮 */
|
|
/** 点击提交按钮 */
|
|
async function submitRes() {
|
|
async function submitRes() {
|
|
//#ifdef APP-PLUS
|
|
//#ifdef APP-PLUS
|
|
- var linkUrl = newPublicStore.serveUrl;
|
|
|
|
- if (!newPublicStore.serveUrl) {
|
|
|
|
|
|
+ if (!uni.getStorageSync("serveUrl")) {
|
|
proxy.$modal.msg("首次登录请先进行服务器配置");
|
|
proxy.$modal.msg("首次登录请先进行服务器配置");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -271,6 +268,15 @@ async function getMobileTenantConfigApi(params) {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+watchEffect(() => {
|
|
|
|
+ //#ifdef APP-PLUS
|
|
|
|
+ if (uni.getStorageSync("serveUrl")) {
|
|
|
|
+ linkUrl.value = uni.getStorageSync("serveUrl");
|
|
|
|
+ getMobileTenantConfigApi({ url: linkUrl.value });
|
|
|
|
+ }
|
|
|
|
+ //#endif
|
|
|
|
+});
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* @onLoad
|
|
* @onLoad
|
|
*/
|
|
*/
|
|
@@ -383,6 +389,8 @@ page {
|
|
|
|
|
|
:deep(uni-image) {
|
|
:deep(uni-image) {
|
|
height: 40px;
|
|
height: 40px;
|
|
|
|
+ // width:40px;
|
|
|
|
+ width: auto;
|
|
}
|
|
}
|
|
.logo {
|
|
.logo {
|
|
margin-right: 10px;
|
|
margin-right: 10px;
|