新框架PDA前端(祈禧6月初版本)
南骏 池
3 天以前 3ff569f00d22919e47cab8fb6d7d9867fd115d97
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
var vm = new Vue({
    el: '#app',
    data: function () {
        return {
            isLoading: false,
            phone: '',
            passwd: '',
            show: false,
            show2: false,
        }
    },
    mounted() {
        var that = this;
        if (typeof (Cookies.get('phone')) == "undefined") { }
        else {
            that.phone = Cookies.get('phone');
            that.passwd = Cookies.get('passwd');
        }
        that.phone = "admin";
        that.passwd = "123456";
    },
    methods: {
        onSubmit(name) {
            var that = this;
            that._userLogin();
        },
        _userLogin() {
            var that = this;
            that.isLoading = true;
            that.AxiosHttp("post", 'login/login', {
                userID: that.phone,
                userPass: that.passwd,
            }, false)
                .then(function (res) {
                    var json = res;
                    if (json.status == 0) {
                        var _userGuid = json.data.tbBillList.guid;
                        var _userAccount = json.data.tbBillList.account;
                        var _userName = json.data.tbBillList.userName;
                        Cookies.set('loginGuid', _userGuid);
                        Cookies.set('loginAccount', _userAccount);
                        Cookies.set('loginName', _userName);
                        window.location.href = ("/H5/Default.aspx?userGuid=" + _userGuid + "&userAccount=" + _userAccount);
                    }
                    else {
                        that.isLoading = false;
                        that.$toast.fail(json.message);
                    }
                })
                .catch(function (error) {
                    that.isLoading = false;
                    that.$toast.fail("网络错误,请重试!");
                    console.log(error);
                });
        },
    }
})