校园网研究

以下是加密和保存的代码

function i(e) {
                var n;
                Object(c.a)(this, i),
                (n = t.call(this, e)).state = {
                    isDoing: !1,
                    err: null,
                    isShowQR: !1,
                    QR: "",
                    QRSec: 0,
                    QRTimer: 0
                },
                n.V = {
                    remember: !1,
                    password: "",
                    username: "",
                    randomPassword: ""
                },
                n.f_key = function(e) {
                    return $.a.enc.Utf8.parse(e.slice(-4) + e + "12345678")
                }
                ,
                n.check = function() {
                    j.a.post(be.url, {
                        DoWhat: "Check"
                    }).then((function(e) {
                        var t = e.data;
                        !0 === t.Result && (x.b.success(t.Message, 5),
                        be.App.setState({
                            isLogin: !0
                        }))
                    }
                    )).catch((function(e) {
                        x.b.error("\u901a\u8baf\u5931\u8d25\uff01\u8bf7\u68c0\u67e5\u7f51\u7edc\u662f\u5426\u6b63\u5e38\u63a5\u5165\uff01")
                    }
                    ))
                }
                ,
                n.onFinish = function(e) {
                    if (x.b.destroy(),
                    n.setState({
                        isDoing: !0
                    }),
                    e.DoWhat = "Login",
                    e.username !== n.V.username || e.password !== n.V.randomPassword ? e.password = $.a.DES.encrypt(e.password, n.f_key(e.username), {
                        mode: $.a.mode.ECB,
                        padding: $.a.pad.Pkcs7
                    }).ciphertext.toString() : e.password = n.V.password,
                    e.remember) {
                        var t = new Date(Date.now() + 2592e6);
                        ie.a.save("username", e.username, {
                            dt: t,
                            maxAge: 2592e3
                        }),
                        ie.a.save("password", e.password, {
                            dt: t,
                            maxAge: 2592e3
                        })
                    } else
                        ie.a.remove("username"),
                        ie.a.remove("password"),
                        ie.a.remove("remember");
                    j.a.post(be.url, e).then((function(e) {
                        var t = e.data;
                        !1 === t.Result ? (x.b.error(t.Message, 5),
                        n.setState({
                            err: t.Message
                        })) : !0 === t.Result && (x.b.success(t.Message, 5),
                        be.App.setState({
                            isLogin: !0
                        }))
                    }
                    )).catch((function(e) {
                        x.b.warning("\u901a\u8baf\u5931\u8d25\uff01\u8bf7\u68c0\u67e5\u7f51\u7edc\u662f\u5426\u6b63\u5e38\u63a5\u5165\uff01")
                    }
                    )).finally((function() {
                        n.setState({
                            isDoing: !1
                        })
                    }
                    ))
                }
                ,
                n.onFinishVisitor = function(e) {
                    x.b.destroy(),
                    n.setState({
                        isDoing: !0
                    }),
                    e.DoWhat = "Login",
                    e.username = "V" + e.username,
                    e.password = $.a.DES.encrypt(e.password, n.f_key(e.username), {
                        mode: $.a.mode.ECB,
                        padding: $.a.pad.Pkcs7
                    }).ciphertext.toString(),
                    j.a.post(be.url, e).then((function(e) {
                        var t = e.data;
                        !1 === t.Result ? x.b.error(t.Message, 5) : !0 === t.Result && (x.b.success(t.Message, 5),
                        be.App.setState({
                            isLogin: !0
                        }))
                    }
                    )).catch((function(e) {
                        x.b.warning("\u901a\u8baf\u5931\u8d25\uff01\u8bf7\u68c0\u67e5\u7f51\u7edc\u662f\u5426\u6b63\u5e38\u63a5\u5165\uff01")
                    }
                    )).finally((function() {
                        n.setState({
                            isDoing: !1
                        })
                    }
                    ))
                }

已断点测试 加密逻辑如上

网站组成