"login_bg"
>
"login_wrap"
>
"el-login"
>
"title"
>
}<
!--登入表單-->
"formref" class=
"form_wrap" :rules=
"formrules" :model=
"forminfo"
>
"margin-bottom: 40px;" prop=
"phone"
>
"inputstyle" v-model=
"forminfo.phone" placeholder=
"請輸入使用者名稱/賬號"
>
"password"
>
"password" autocomplete=
"off" class=
"inputstyle" v-model=
"forminfo.password" placeholder=
"請輸入密碼" show-password @keyup.enter.native=
"submitform"
>
"forget_wrap"
>
"checked" class=
"checkbox_btn"
>記住密碼
<
!--
"forget_btn"
>忘記密碼
-->
<
!--
"primary" @click=
"onsubmit"
>立即建立
-->
"submitform('formref')" class=
"login_btn"
>
"goback" @click=
"goback"
>
"@/assets/image/goback_icon.png" alt=
"">
返回import
from "../assets/js/common"
;import
from "vuex"
;import
from "../assets/js/rule"
;export default ,
loading: null,
checked: false,
defaultprops: ,
formrules: ,
//
// ],
// password: }
};}, computed:
else
if(this.getuserlogintype ==
"2")
else
if(this.getuserlogintype ==
"3")
else}},
methods: ,
async loginin ())
;let obj =
; const res = await this.axios.pclogin(obj);if
(res.code ==
= 200)
else
else
if(res.data.userinfo)
else}}
}else
}, submitform (formname)
else})
;},//設定cookie
setcookie (c_name, c_pwd, exdays)
, //讀取cookie
getcookie: function()
else
if(arr2[0]
=="password")}
this.checked =
true;}
}, //清除cookie
clearcookie: function()
, /**
* 專案端獲取專案列表
*/async getprojectlist (id, router));
if(res.code ==
= 200)
else
}else
}, /**
* 獲取選單許可權
*/async getmenupermission (_userid, _groupid));
this.loading.close();
if(res.code ==
= 200)
// 去重
lethash=;
const newarr = res.data.reduce((preval, curval)
=>
, )let btnarr =
, menuarr =
; // 將返回的選單分為選單和按鈕
newarr.foreach(item =
>
}else})
let arr = tomenutree(menuarr, 0, this.defaultprops.children)
; this.$store.dispatch(
'setpermissionmenu', arr)
; this.$store.dispatch(
'setpermissionbtn', btnarr)
; switch (this.getuserlogintype)
else
break
;case
"3":
if(arr[0]
)else
break
;case
"4":
// this.$router.push(arr[0].href)
;break;}
}else
}, },
created ()}
;
vue專案實現記住密碼到cookie功能 附原始碼
1.記住密碼勾選,點登陸時,將賬號和密碼儲存到cookie,下次登陸自動顯示到表單內 2.不勾選,點登陸時候則清空之前儲存到cookie的值,下次登陸需要手動輸入 大體思路就是通過存 取 刪cookie實現的 每次進入登入頁,先去讀取cookie,如果瀏覽器的cookie中有賬號資訊,就自動填充到登...
vue專案實現記住密碼到cookie功能
1.記住密碼勾選,點登陸時,將賬號和密碼儲存到cookie,下次登陸自動顯示到表單內 2.不勾選,點登陸時候則清空之前儲存到cookie的值,下次登陸需要手動輸入 大體思路就是通過存 取 刪cookie實現的 每次進入登入頁,先去讀取cookie,如果瀏覽器的cookie中有賬號資訊,就自動填充到登...
php專案登陸功能
登陸幾乎是每個系統必備的,在這裡和大家分享兩種常用的登陸功能的設計。一 session登陸 網頁登陸一般是將登陸資訊存放在 session 中,最簡單的登陸,當驗證使用者名稱密碼成功後,將使用者的id儲存在 session中。例如 session login user user id 這時一般會有乙...