|
@@ -1,6 +1,7 @@
|
|
|
<template>
|
|
|
<view class="section">
|
|
|
|
|
|
+ <!-- <view style="position:absolute;top:10px;right:10px;z-index:99;color:#2a98ff" @tap="goSeverConfig">服务器配置</view> -->
|
|
|
|
|
|
<!-- #ifdef APP-PLUS-->
|
|
|
<view style="position:absolute;top:10px;right:10px;z-index:99;color:#2a98ff" @tap="goSeverConfig">服务器配置</view>
|
|
@@ -163,33 +164,56 @@ function env() {
|
|
|
// }else{
|
|
|
// }
|
|
|
|
|
|
- let port = uni.getSystemInfoSync().platform;
|
|
|
- switch (port) {
|
|
|
- case "android":
|
|
|
- getMobileTenantConfigApi({ url: window.location.host });
|
|
|
- console.log("Android"); //android
|
|
|
- break;
|
|
|
- case "ios":
|
|
|
- console.log("iOS"); //ios
|
|
|
- getMobileTenantConfigApi({ url: window.location.host });
|
|
|
- break;
|
|
|
- case "windows":
|
|
|
- // console.log("H5"); //H5
|
|
|
- //getMobileTenantConfigApi({ url: "172.16.1.47:3000" })
|
|
|
- getMobileTenantConfigApi({ url: window.location.host });
|
|
|
- break;
|
|
|
- default: //devtools
|
|
|
- console.log("小程序");
|
|
|
- break;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //#ifdef H5
|
|
|
+ var linkUrl=window.location.host;
|
|
|
+ //#endif
|
|
|
+
|
|
|
+ //#ifdef APP-PLUS
|
|
|
+ var linkUrl=newPublicStore.serveUrl;
|
|
|
+ if(!newPublicStore.serveUrl){
|
|
|
+ uni.showToast({
|
|
|
+ title: '请进行服务器配置...',
|
|
|
+ icon: "none",
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ uni.showToast({
|
|
|
+ title: linkUrl,
|
|
|
+ icon: "none",
|
|
|
+ })
|
|
|
}
|
|
|
+ //#endif
|
|
|
+
|
|
|
+ getMobileTenantConfigApi({ url:linkUrl });
|
|
|
+
|
|
|
+ // let port = uni.getSystemInfoSync().platform;
|
|
|
+ // switch (port) {
|
|
|
+ // case "android":
|
|
|
+ // getMobileTenantConfigApi({ url: window.location.host });
|
|
|
+ // console.log("Android"); //android
|
|
|
+ // break;
|
|
|
+ // case "ios":
|
|
|
+ // console.log("iOS"); //ios
|
|
|
+ // getMobileTenantConfigApi({ url: window.location.host });
|
|
|
+ // break;
|
|
|
+ // case "windows":
|
|
|
+ // getMobileTenantConfigApi({ url: window.location.host });
|
|
|
+ // break;
|
|
|
+ // default: //devtools
|
|
|
+ // console.log("小程序");
|
|
|
+ // break;
|
|
|
+ // }
|
|
|
}
|
|
|
|
|
|
-// #ifdef H5
|
|
|
-env();
|
|
|
-// #endif
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
/** 点击提交按钮 */
|
|
|
async function submitRes() {
|
|
|
+
|
|
|
if (switchText.value == "账号密码登录") {
|
|
|
if (!phone.value) {
|
|
|
uni.showToast({
|
|
@@ -232,16 +256,7 @@ async function submitRes() {
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
- // #ifdef APP-PLUS
|
|
|
- if(newPublicStore.serveUrl){
|
|
|
- login({
|
|
|
- username: username.value,
|
|
|
- password: password.value,
|
|
|
- serveUrl: newPublicStore.serveUrl
|
|
|
- });
|
|
|
- }
|
|
|
- // #endif
|
|
|
+
|
|
|
|
|
|
|
|
|
login({
|
|
@@ -253,7 +268,7 @@ async function submitRes() {
|
|
|
|
|
|
/** 获取登录数据 */
|
|
|
async function login(data) {
|
|
|
- proxy.$modal.loading("登录中,请耐心等待...");
|
|
|
+ // proxy.$modal.loading("登录中,请耐心等待...");
|
|
|
|
|
|
useStore.Login(data).then(() => {
|
|
|
info();
|
|
@@ -295,6 +310,10 @@ function inputIcon() {
|
|
|
* @onLoad
|
|
|
*/
|
|
|
onLoad(() => {
|
|
|
+
|
|
|
+ env();
|
|
|
+
|
|
|
+
|
|
|
const token = getToken();
|
|
|
//需要登录
|
|
|
if (token) {
|