first commit
This commit is contained in:
@@ -108,30 +108,6 @@
|
|||||||
rememberMe.value = !rememberMe.value;
|
rememberMe.value = !rememberMe.value;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 模拟登录API - 实际项目中替换为真实API
|
|
||||||
const mockLoginApi = (user, pwd) => {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
setTimeout(() => {
|
|
||||||
// 模拟登录验证
|
|
||||||
if (user && pwd) {
|
|
||||||
// 模拟返回的跳转URL
|
|
||||||
resolve({
|
|
||||||
success: true,
|
|
||||||
redirectUrl: 'https://ws.yuxindazhineng.com',
|
|
||||||
userInfo: {
|
|
||||||
username: user,
|
|
||||||
name: '用户' + user.substring(0, 3)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
reject({
|
|
||||||
success: false,
|
|
||||||
message: '账号或密码错误'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}, 1500);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// 表单验证
|
// 表单验证
|
||||||
const validateForm = () => {
|
const validateForm = () => {
|
||||||
@@ -173,12 +149,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
isLoggingIn.value = true;
|
isLoggingIn.value = true;
|
||||||
loginError.value = '';s
|
loginError.value = '';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// 发起实际API请求
|
// 发起实际API请求
|
||||||
const res = await uni.request({
|
const res = await uni.request({
|
||||||
url: 'http://cloud_test.yuxindazhineng.com/cloud_api/app/verify_domain',
|
url: 'http://cloud.yuxindazhineng.com/cloud_api/app/verify_domain',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
header: {
|
header: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
@@ -196,6 +172,7 @@
|
|||||||
|
|
||||||
// 解析接口响应数据
|
// 解析接口响应数据
|
||||||
const responseData = res.data;
|
const responseData = res.data;
|
||||||
|
console.log(responseData);
|
||||||
|
|
||||||
// 业务层面的成功判断
|
// 业务层面的成功判断
|
||||||
if (responseData.success) {
|
if (responseData.success) {
|
||||||
@@ -212,7 +189,7 @@
|
|||||||
console.log('域名前缀:', domainData.domain_prefix);
|
console.log('域名前缀:', domainData.domain_prefix);
|
||||||
|
|
||||||
// 构建跳转URL
|
// 构建跳转URL
|
||||||
redirectUrl.value = `https://${domainData.full_domain}`;
|
redirectUrl.value = `http://${domainData.full_domain}`;
|
||||||
|
|
||||||
// 自动跳转
|
// 自动跳转
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"hash": "e66e26ef",
|
"hash": "b9353e6d",
|
||||||
"configHash": "95216d54",
|
"configHash": "9816e0c6",
|
||||||
"lockfileHash": "e3b0c442",
|
"lockfileHash": "e3b0c442",
|
||||||
"browserHash": "965e6bcf",
|
"browserHash": "3555bf25",
|
||||||
"optimized": {},
|
"optimized": {},
|
||||||
"chunks": {}
|
"chunks": {}
|
||||||
}
|
}
|
||||||
43
unpackage/dist/dev/app-plus/app-service.js
vendored
43
unpackage/dist/dev/app-plus/app-service.js
vendored
@@ -62,28 +62,6 @@ if (uni.restoreGlobal) {
|
|||||||
const loginError = vue.ref("");
|
const loginError = vue.ref("");
|
||||||
const toggleRememberMe = () => {
|
const toggleRememberMe = () => {
|
||||||
rememberMe.value = !rememberMe.value;
|
rememberMe.value = !rememberMe.value;
|
||||||
formatAppLog("log", "at pages/light-theme/light-theme.vue:109", "111");
|
|
||||||
};
|
|
||||||
const mockLoginApi = (user, pwd) => {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
setTimeout(() => {
|
|
||||||
if (user && pwd) {
|
|
||||||
resolve({
|
|
||||||
success: true,
|
|
||||||
redirectUrl: "https://ws.yuxindazhineng.com",
|
|
||||||
userInfo: {
|
|
||||||
username: user,
|
|
||||||
name: "用户" + user.substring(0, 3)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
reject({
|
|
||||||
success: false,
|
|
||||||
message: "账号或密码错误"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}, 1500);
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
const validateForm = () => {
|
const validateForm = () => {
|
||||||
let isValid = true;
|
let isValid = true;
|
||||||
@@ -118,7 +96,7 @@ if (uni.restoreGlobal) {
|
|||||||
loginError.value = "";
|
loginError.value = "";
|
||||||
try {
|
try {
|
||||||
const res = await uni.request({
|
const res = await uni.request({
|
||||||
url: "http://cloud_test.yuxindazhineng.com/cloud_api/app/verify_domain",
|
url: "http://cloud.yuxindazhineng.com/cloud_api/app/verify_domain",
|
||||||
method: "POST",
|
method: "POST",
|
||||||
header: {
|
header: {
|
||||||
"Content-Type": "application/json"
|
"Content-Type": "application/json"
|
||||||
@@ -132,6 +110,7 @@ if (uni.restoreGlobal) {
|
|||||||
throw new Error(`接口请求失败,状态码:${res.statusCode}`);
|
throw new Error(`接口请求失败,状态码:${res.statusCode}`);
|
||||||
}
|
}
|
||||||
const responseData = res.data;
|
const responseData = res.data;
|
||||||
|
formatAppLog("log", "at pages/light-theme/light-theme.vue:175", responseData);
|
||||||
if (responseData.success) {
|
if (responseData.success) {
|
||||||
if (rememberMe.value) {
|
if (rememberMe.value) {
|
||||||
uni.setStorageSync("yxd_username", username.value);
|
uni.setStorageSync("yxd_username", username.value);
|
||||||
@@ -139,9 +118,9 @@ if (uni.restoreGlobal) {
|
|||||||
uni.removeStorageSync("yxd_username");
|
uni.removeStorageSync("yxd_username");
|
||||||
}
|
}
|
||||||
const domainData = responseData.data;
|
const domainData = responseData.data;
|
||||||
formatAppLog("log", "at pages/light-theme/light-theme.vue:212", "完整域名:", domainData.full_domain);
|
formatAppLog("log", "at pages/light-theme/light-theme.vue:188", "完整域名:", domainData.full_domain);
|
||||||
formatAppLog("log", "at pages/light-theme/light-theme.vue:213", "域名前缀:", domainData.domain_prefix);
|
formatAppLog("log", "at pages/light-theme/light-theme.vue:189", "域名前缀:", domainData.domain_prefix);
|
||||||
redirectUrl.value = `https://${domainData.full_domain}`;
|
redirectUrl.value = `http://${domainData.full_domain}`;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
openExternalLink();
|
openExternalLink();
|
||||||
}, 2e3);
|
}, 2e3);
|
||||||
@@ -178,9 +157,9 @@ if (uni.restoreGlobal) {
|
|||||||
username.value = savedUsername;
|
username.value = savedUsername;
|
||||||
rememberMe.value = true;
|
rememberMe.value = true;
|
||||||
}
|
}
|
||||||
formatAppLog("log", "at pages/light-theme/light-theme.vue:292", "登录组件已挂载");
|
formatAppLog("log", "at pages/light-theme/light-theme.vue:268", "登录组件已挂载");
|
||||||
});
|
});
|
||||||
const __returned__ = { username, password, rememberMe, showPassword, isLoggingIn, redirectUrl, copySuccess, usernameError, passwordError, loginError, toggleRememberMe, mockLoginApi, validateForm, clearError, handleLogin, openExternalLink, copyToClipboard, ref: vue.ref, onMounted: vue.onMounted };
|
const __returned__ = { username, password, rememberMe, showPassword, isLoggingIn, redirectUrl, copySuccess, usernameError, passwordError, loginError, toggleRememberMe, validateForm, clearError, handleLogin, openExternalLink, copyToClipboard, ref: vue.ref, onMounted: vue.onMounted };
|
||||||
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
||||||
return __returned__;
|
return __returned__;
|
||||||
}
|
}
|
||||||
@@ -315,7 +294,7 @@ if (uni.restoreGlobal) {
|
|||||||
])
|
])
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
const PagesLightThemeLightTheme = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$2], ["__scopeId", "data-v-68542e3f"], ["__file", "D:/Projects/uniapp/app-test/fronted-phone/pages/light-theme/light-theme.vue"]]);
|
const PagesLightThemeLightTheme = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$2], ["__scopeId", "data-v-68542e3f"], ["__file", "D:/Projects/intelligentProject-phone/pages/light-theme/light-theme.vue"]]);
|
||||||
const _sfc_main$2 = {
|
const _sfc_main$2 = {
|
||||||
__name: "index",
|
__name: "index",
|
||||||
setup(__props, { expose: __expose }) {
|
setup(__props, { expose: __expose }) {
|
||||||
@@ -380,7 +359,7 @@ if (uni.restoreGlobal) {
|
|||||||
])
|
])
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
const PagesIndexIndex = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$1], ["__scopeId", "data-v-1cf27b2a"], ["__file", "D:/Projects/uniapp/app-test/fronted-phone/pages/index/index.vue"]]);
|
const PagesIndexIndex = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$1], ["__scopeId", "data-v-1cf27b2a"], ["__file", "D:/Projects/intelligentProject-phone/pages/index/index.vue"]]);
|
||||||
const _sfc_main$1 = {
|
const _sfc_main$1 = {
|
||||||
__name: "night-theme",
|
__name: "night-theme",
|
||||||
setup(__props, { expose: __expose }) {
|
setup(__props, { expose: __expose }) {
|
||||||
@@ -631,7 +610,7 @@ if (uni.restoreGlobal) {
|
|||||||
])
|
])
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
const PagesNightThemeNightTheme = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render], ["__scopeId", "data-v-197fbf56"], ["__file", "D:/Projects/uniapp/app-test/fronted-phone/pages/night-theme/night-theme.vue"]]);
|
const PagesNightThemeNightTheme = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render], ["__scopeId", "data-v-197fbf56"], ["__file", "D:/Projects/intelligentProject-phone/pages/night-theme/night-theme.vue"]]);
|
||||||
__definePage("pages/light-theme/light-theme", PagesLightThemeLightTheme);
|
__definePage("pages/light-theme/light-theme", PagesLightThemeLightTheme);
|
||||||
__definePage("pages/index/index", PagesIndexIndex);
|
__definePage("pages/index/index", PagesIndexIndex);
|
||||||
__definePage("pages/night-theme/night-theme", PagesNightThemeNightTheme);
|
__definePage("pages/night-theme/night-theme", PagesNightThemeNightTheme);
|
||||||
@@ -646,7 +625,7 @@ if (uni.restoreGlobal) {
|
|||||||
formatAppLog("log", "at App.vue:10", "App Hide");
|
formatAppLog("log", "at App.vue:10", "App Hide");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "D:/Projects/uniapp/app-test/fronted-phone/App.vue"]]);
|
const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "D:/Projects/intelligentProject-phone/App.vue"]]);
|
||||||
function createApp() {
|
function createApp() {
|
||||||
const app = vue.createVueApp(App);
|
const app = vue.createVueApp(App);
|
||||||
return {
|
return {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user