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 charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
<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 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">
|
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||||
<% for (var i in
|
<% for (var i in
|
||||||
htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.css) { %>
|
htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.css) { %>
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
import qs from 'qs'
|
import qs from 'qs'
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
import { api } from '@/config'
|
|
||||||
// 签名
|
// 签名
|
||||||
import _bale from '@/utils/package'
|
import _bale from '@/utils/package'
|
||||||
// api
|
// api
|
||||||
// 登录
|
// 登录
|
||||||
export function login(params) {
|
export function login(params) {
|
||||||
return request({
|
return request({
|
||||||
url: '/wechat/login.do',
|
url: '/wechat/login.do',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: qs.stringify(_bale('login', params))
|
data: qs.stringify(_bale('login', params))
|
||||||
})
|
})
|
||||||
@ -18,7 +17,7 @@ export function login(params) {
|
|||||||
*/
|
*/
|
||||||
export function loginByCode(params) {
|
export function loginByCode(params) {
|
||||||
return request({
|
return request({
|
||||||
url: '/wechat/auth2',
|
url: '/wechat/auth2',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: qs.stringify(_bale('auth2', params))
|
data: qs.stringify(_bale('auth2', params))
|
||||||
})
|
})
|
||||||
@ -29,7 +28,7 @@ export function loginByCode(params) {
|
|||||||
*/
|
*/
|
||||||
export function getUserInfo(params) {
|
export function getUserInfo(params) {
|
||||||
return request({
|
return request({
|
||||||
url: '/user/get_user',
|
url: '/user/get_user',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: qs.stringify(_bale('get_user', params))
|
data: qs.stringify(_bale('get_user', params))
|
||||||
})
|
})
|
||||||
@ -41,7 +40,7 @@ export function getUserInfo(params) {
|
|||||||
*/
|
*/
|
||||||
export function getAccountInfo(params) {
|
export function getAccountInfo(params) {
|
||||||
return request({
|
return request({
|
||||||
url: '/wechat/selectVipUserInfo',
|
url: '/wechat/selectVipUserInfo',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: qs.stringify(_bale('selectVipUserInfo', params))
|
data: qs.stringify(_bale('selectVipUserInfo', params))
|
||||||
})
|
})
|
||||||
@ -53,7 +52,7 @@ export function getAccountInfo(params) {
|
|||||||
*/
|
*/
|
||||||
export function sendCode(params) {
|
export function sendCode(params) {
|
||||||
return request({
|
return request({
|
||||||
url: '/wechat/send_phone_code',
|
url: '/wechat/send_phone_code',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: qs.stringify(_bale('send_phone_code', params))
|
data: qs.stringify(_bale('send_phone_code', params))
|
||||||
})
|
})
|
||||||
@ -65,7 +64,7 @@ export function sendCode(params) {
|
|||||||
*/
|
*/
|
||||||
export function bindPhoneNumber(params) {
|
export function bindPhoneNumber(params) {
|
||||||
return request({
|
return request({
|
||||||
url: '/wechat/addPhoneNumber',
|
url: '/wechat/addPhoneNumber',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: qs.stringify(_bale('addPhoneNumber', params))
|
data: qs.stringify(_bale('addPhoneNumber', params))
|
||||||
})
|
})
|
||||||
@ -77,9 +76,8 @@ export function bindPhoneNumber(params) {
|
|||||||
*/
|
*/
|
||||||
export function getDoorKey(params) {
|
export function getDoorKey(params) {
|
||||||
return request({
|
return request({
|
||||||
url: '/user/getDoorKey',
|
url: '/user/getDoorKey',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: qs.stringify(_bale('getDoorKey', params))
|
data: qs.stringify(_bale('getDoorKey', params))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<!-- ListEmpty.vue -->
|
<!-- ListEmpty.vue -->
|
||||||
<template>
|
<template>
|
||||||
<div class="list-empty">
|
<div class="list-empty">
|
||||||
<slot name='emptyImg'></slot>
|
<slot name="emptyImg"></slot>
|
||||||
<div class="empty-tips">{{tips}}</div>
|
<div class="empty-tips">{{ tips }}</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@ -13,7 +13,7 @@ export default {
|
|||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -16,7 +16,6 @@ export const constantRoutes = [
|
|||||||
keepAlive: false
|
keepAlive: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
path: '/coupon',
|
path: '/coupon',
|
||||||
name: 'coupon',
|
name: 'coupon',
|
||||||
|
@ -9,8 +9,17 @@ export function loadLoginStatus() {
|
|||||||
return cookies.get(LoginStatusKey) || 0
|
return cookies.get(LoginStatusKey) || 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// export function saveLoginStatus(status) {
|
||||||
|
// cookies.set(LoginStatusKey, status, { expires: 7 })
|
||||||
|
// return status
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
export function saveLoginStatus(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
|
return status
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,9 +78,7 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
// console.log(this.access)
|
|
||||||
this.init()
|
this.init()
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 获取初始数据
|
// 获取初始数据
|
||||||
|
Loading…
x
Reference in New Issue
Block a user