mirror of
https://github.com/sunniejs/vue-h5-template.git
synced 2025-09-22 17:15:50 +08:00
修改过期时间
This commit is contained in:
parent
1b8ac74fe5
commit
389595840b
@ -4,6 +4,9 @@
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate"/>
|
||||
<meta http-equiv="Pragma" content="no-cache" />
|
||||
<meta http-equiv="Expires" content="0" />
|
||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||
<% for (var i in
|
||||
htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.css) { %>
|
||||
|
@ -1,13 +1,12 @@
|
||||
import qs from 'qs'
|
||||
import request from '@/utils/request'
|
||||
import { api } from '@/config'
|
||||
// 签名
|
||||
import _bale from '@/utils/package'
|
||||
// api
|
||||
// 登录
|
||||
export function login(params) {
|
||||
return request({
|
||||
url: '/wechat/login.do',
|
||||
url: '/wechat/login.do',
|
||||
method: 'post',
|
||||
data: qs.stringify(_bale('login', params))
|
||||
})
|
||||
@ -18,7 +17,7 @@ export function login(params) {
|
||||
*/
|
||||
export function loginByCode(params) {
|
||||
return request({
|
||||
url: '/wechat/auth2',
|
||||
url: '/wechat/auth2',
|
||||
method: 'post',
|
||||
data: qs.stringify(_bale('auth2', params))
|
||||
})
|
||||
@ -29,7 +28,7 @@ export function loginByCode(params) {
|
||||
*/
|
||||
export function getUserInfo(params) {
|
||||
return request({
|
||||
url: '/user/get_user',
|
||||
url: '/user/get_user',
|
||||
method: 'post',
|
||||
data: qs.stringify(_bale('get_user', params))
|
||||
})
|
||||
@ -41,7 +40,7 @@ export function getUserInfo(params) {
|
||||
*/
|
||||
export function getAccountInfo(params) {
|
||||
return request({
|
||||
url: '/wechat/selectVipUserInfo',
|
||||
url: '/wechat/selectVipUserInfo',
|
||||
method: 'post',
|
||||
data: qs.stringify(_bale('selectVipUserInfo', params))
|
||||
})
|
||||
@ -53,7 +52,7 @@ export function getAccountInfo(params) {
|
||||
*/
|
||||
export function sendCode(params) {
|
||||
return request({
|
||||
url: '/wechat/send_phone_code',
|
||||
url: '/wechat/send_phone_code',
|
||||
method: 'post',
|
||||
data: qs.stringify(_bale('send_phone_code', params))
|
||||
})
|
||||
@ -65,7 +64,7 @@ export function sendCode(params) {
|
||||
*/
|
||||
export function bindPhoneNumber(params) {
|
||||
return request({
|
||||
url: '/wechat/addPhoneNumber',
|
||||
url: '/wechat/addPhoneNumber',
|
||||
method: 'post',
|
||||
data: qs.stringify(_bale('addPhoneNumber', params))
|
||||
})
|
||||
@ -77,9 +76,8 @@ export function bindPhoneNumber(params) {
|
||||
*/
|
||||
export function getDoorKey(params) {
|
||||
return request({
|
||||
url: '/user/getDoorKey',
|
||||
url: '/user/getDoorKey',
|
||||
method: 'post',
|
||||
data: qs.stringify(_bale('getDoorKey', params))
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
<!-- ListEmpty.vue -->
|
||||
<template>
|
||||
<div class="list-empty">
|
||||
<slot name='emptyImg'></slot>
|
||||
<div class="empty-tips">{{tips}}</div>
|
||||
<slot name="emptyImg"></slot>
|
||||
<div class="empty-tips">{{ tips }}</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
@ -13,7 +13,7 @@ export default {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
@ -16,7 +16,6 @@ export const constantRoutes = [
|
||||
keepAlive: false
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
path: '/coupon',
|
||||
name: 'coupon',
|
||||
|
@ -9,8 +9,17 @@ export function loadLoginStatus() {
|
||||
return cookies.get(LoginStatusKey) || 0
|
||||
}
|
||||
|
||||
// export function saveLoginStatus(status) {
|
||||
// cookies.set(LoginStatusKey, status, { expires: 7 })
|
||||
// return status
|
||||
// }
|
||||
|
||||
|
||||
export function saveLoginStatus(status) {
|
||||
cookies.set(LoginStatusKey, status, { expires: 7 })
|
||||
//storage.set(LoginStatusKey, status)
|
||||
var date=new Date();
|
||||
date.setTime(date.getTime()+5*60*1000); //设置date为当前时间+5分
|
||||
document.cookie=LoginStatusKey+"="+status+"; expires="+date.toGMTString(); //将date赋值给expires
|
||||
return status
|
||||
}
|
||||
|
||||
|
@ -78,9 +78,7 @@ export default {
|
||||
computed: {
|
||||
},
|
||||
mounted () {
|
||||
// console.log(this.access)
|
||||
this.init()
|
||||
|
||||
},
|
||||
methods: {
|
||||
// 获取初始数据
|
||||
|
Loading…
x
Reference in New Issue
Block a user