密码验证和登陆验证

master
wuzuowei 4 months ago
parent ca09d6b427
commit a6d71bc678

@ -1,6 +1,6 @@
import LoadingComponent from "@/microhost/components/pageLoading" import LoadingComponent from "@/microhost/components/pageLoading"
import { dynamic } from 'umi' import { dynamic } from 'umi'
import {AppstoreOutlined, HomeOutlined} from "@ant-design/icons" import { AppstoreOutlined, HomeOutlined } from "@ant-design/icons"
import lodash, { isArray } from "lodash" import lodash, { isArray } from "lodash"
import MicroApps from './microhost/system/apps' import MicroApps from './microhost/system/apps'
import Runtime from './microhost/runtimes' import Runtime from './microhost/runtimes'
@ -34,10 +34,10 @@ export function patchRoutes({ routes }) {
//console.log(localStorage.getItem("_sk_act")) //console.log(localStorage.getItem("_sk_act"))
for(let i = 0; i < routes.length; i++){ for (let i = 0; i < routes.length; i++) {
let route = routes[i] let route = routes[i]
if(route.path == "/"){ if (route.path == "/") {
// route.component = dynamic({ // route.component = dynamic({
// loader: (a: any) => import(/* webpackChunkName: 'layouts__MicroAppLayout' */ `@/microhost/layouts/${themeFounder.skin}/patterns/microapp`), // loader: (a: any) => import(/* webpackChunkName: 'layouts__MicroAppLayout' */ `@/microhost/layouts/${themeFounder.skin}/patterns/microapp`),
// //loader: () => import(/* webpackChunkName: 'layouts__MicroAppLayout' */ '@/layouts/iBKLinkerLayout'), // //loader: () => import(/* webpackChunkName: 'layouts__MicroAppLayout' */ '@/layouts/iBKLinkerLayout'),
@ -52,17 +52,17 @@ export function patchRoutes({ routes }) {
} }
} }
if(!docked){ if (!docked) {
// let plats = patchPlatformRoutes() // let plats = patchPlatformRoutes()
// console.log("platform routes", plats) // console.log("platform routes", plats)
routes.push({ routes.push({
path: "/", path: "/",
component: dynamic({ component: dynamic({
loader: (a: any) => import(/* webpackChunkName: 'layouts__MicroAppLayout' */ `@/microhost/layouts/${themeFounder.skin}`), loader: (a: any) => import(/* webpackChunkName: 'layouts__MicroAppLayout' */ `@/microhost/layouts/${themeFounder.skin}`),
//loader: () => import(/* webpackChunkName: 'layouts__MicroAppLayout' */ '@/layouts/iBKLinkerLayout'), //loader: () => import(/* webpackChunkName: 'layouts__MicroAppLayout' */ '@/layouts/iBKLinkerLayout'),
loading: LoadingComponent, loading: LoadingComponent,
tmpl: `@/microhost/layouts/${themeFounder.skin}`, tmpl: `@/microhost/layouts/${themeFounder.skin}`,
}), }),
// routes: extraRoutes.concat(plats) // routes: extraRoutes.concat(plats)
routes: [ routes: [
...extraRoutes, ...extraRoutes,
@ -108,7 +108,7 @@ export function patchRoutes({ routes }) {
}) })
} }
MicroApps.GetRuntimeRouter().patchRoutes(routes) MicroApps.GetRuntimeRouter().patchRoutes(routes)
MicroApps.GetRuntimeRouter().routeWorking = routes MicroApps.GetRuntimeRouter().routeWorking = routes
//let apppath = MicroApps.GetRuntimeTheme().pattern("app") //let apppath = MicroApps.GetRuntimeTheme().pattern("app")
//console.log("patch routes", routes, apppath) //console.log("patch routes", routes, apppath)
//window.RuntimeRoutes = routes //window.RuntimeRoutes = routes
@ -116,11 +116,11 @@ export function patchRoutes({ routes }) {
function patchPlatformRoutes() { function patchPlatformRoutes() {
let results: any[] = [] let results: any[] = []
if(!PlatformRoutes || PlatformRoutes.length == 0) return results if (!PlatformRoutes || PlatformRoutes.length == 0) return results
PlatformRoutes.forEach((route) => { PlatformRoutes.forEach((route) => {
let handle = patchSeekRoutes(route) let handle = patchSeekRoutes(route)
if(handle){ if (handle) {
results.push(handle) results.push(handle)
} }
}) })
@ -129,14 +129,14 @@ function patchPlatformRoutes() {
} }
function patchSeekRoutes(route: any) { function patchSeekRoutes(route: any) {
if(!route) return undefined if (!route) return undefined
let children: any[] = [] let children: any[] = []
if(isArray(route.children) && route.children.length > 0){ if (isArray(route.children) && route.children.length > 0) {
route.children.forEach((child: any) => { route.children.forEach((child: any) => {
let handle = patchSeekRoutes(child) let handle = patchSeekRoutes(child)
if(handle){ if (handle) {
children.push(handle) children.push(handle)
} }
}) })
@ -160,11 +160,11 @@ function patchSeekRoutes(route: any) {
*/ */
export function render(oldRender: () => void) { export function render(oldRender: () => void) {
//extraRoutes = lodash.cloneDeep(MicroApps.runtimes.router.routeExtends) //extraRoutes = lodash.cloneDeep(MicroApps.runtimes.router.routeExtends)
oldRender(); oldRender();
} }
export function onRouteChange(params: any) { export function onRouteChange(params: any) {
//console.log("on route change", params) //console.log("on route change", params)
MicroApps.GetRuntimeRouter().onRouteChanged(params) MicroApps.GetRuntimeRouter().onRouteChanged(params)
} }
@ -238,7 +238,14 @@ export async function getInitialState() {
let model = new SystemData() let model = new SystemData()
let params = await model.parameters() let params = await model.parameters()
//console.log("params", params) //console.log("params", params)
const host: string = window.location.hostname
if (host.indexOf("localhost") !== -1) {
} else {
if (window.top === window.self) {
window.location.href = 'https://metal.dayesteel.com.cn';
return;
}
}
return { return {
userRoutes: MicroApps.runtimes.router.routeExtends, userRoutes: MicroApps.runtimes.router.routeExtends,
userInfo: userData, userInfo: userData,

@ -183,12 +183,14 @@ const ManagementAccountEditor: React.FC<IManagementAccountEditor> = (props) => {
return null return null
} }
}, },
"rules": [{ // "rules": [{
// pattern: '^[A-Za-z0-9]+$', // // pattern: '^[A-Za-z0-9]+$',
pattern: '^[A-Za-z0-9@!-]+$', // // pattern: '^[A-Za-z0-9@!-]+$',
// message: '密码只能由英文字母和数字组成' // pattern: /^[A-Za-z0-9@!-]+$/,
message: '密码只能包含数字字母和@!-'
}], // // message: '密码只能由英文字母和数字组成'
// message: '密码只能包含数字字母和@!-'
// }],
"inputComponent": <Input.Password iconRender={visible => (visible ? <EyeTwoTone /> : <EyeInvisibleOutlined />)} "inputComponent": <Input.Password iconRender={visible => (visible ? <EyeTwoTone /> : <EyeInvisibleOutlined />)}
/> />
}, { }, {
@ -411,6 +413,7 @@ const ManagementAccountEditor: React.FC<IManagementAccountEditor> = (props) => {
console.log("submit data", subvals, values) console.log("submit data", subvals, values)
submitData() submitData()
}}> }}>
<div>222222222222222222222222222222222222222</div>
<Form form={thisForm} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}> <Form form={thisForm} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}>
{ {
userColumns.slice(1, 9).map((col: any) => ( userColumns.slice(1, 9).map((col: any) => (

@ -107,8 +107,8 @@ const UserManager = (props: any) => {
} }
}, },
"rules": [{ required: true }, { "rules": [{ required: true }, {
pattern: '^[A-Za-z0-9@!-]+$', // pattern: '^[A-Za-z0-9@!-]+$',
// pattern: /^[A-Za-z0-9@!-]+$/, pattern: /^[A-Za-z0-9@!-]+$/,
// pattern: /^(?=.*[0-9])(?=.*[!@#$%^&*])(?=.*[a-z])(?=.*[A-Z]).{8,}$/, // pattern: /^(?=.*[0-9])(?=.*[!@#$%^&*])(?=.*[a-z])(?=.*[A-Z]).{8,}$/,
message: '密码只能包含数字字母和@!-' message: '密码只能包含数字字母和@!-'
}], }],

@ -53,12 +53,12 @@ const TechLoginView = () => {
} else { } else {
message.error('获取财智系统用户信息报错!'); message.error('获取财智系统用户信息报错!');
// window.location.href = "https://metal.dayesteel.com.cn"; window.location.href = "https://metal.dayesteel.com.cn";
} }
}) })
.catch((reason) => { .catch((reason) => {
message.error('调取财智系统用户信息报错' + reason); message.error('调取财智系统用户信息报错' + reason);
// window.location.href = "https://metal.dayesteel.com.cn"; window.location.href = "https://metal.dayesteel.com.cn";
}); });
}; };
const doLogin = async (UserId: string) => { const doLogin = async (UserId: string) => {

Loading…
Cancel
Save