diff --git a/src/components/auth/Login.vue b/src/components/auth/Login.vue
index c4f7c0b..826a5ff 100644
--- a/src/components/auth/Login.vue
+++ b/src/components/auth/Login.vue
@@ -218,7 +218,7 @@ const getUserInfo = () => {
http('/api/user/profile', {}, 'get').then(res => {
localCache.set('userInfo', res.data);
userInfo.updateUserInfo(res.data);
- // window.location.reload();
+ window.location.reload();
}).catch(err => {
showToast(err.message);
})
diff --git a/src/layouts/Header.vue b/src/layouts/Header.vue
index 567d49e..fc8ac56 100644
--- a/src/layouts/Header.vue
+++ b/src/layouts/Header.vue
@@ -94,7 +94,7 @@ const onLogout = ()=>{
http('/api/auth/logout').then(res => {
localCache.remove('userInfo');
localCache.remove('auth');
- userInfo.updateUserInfo();
+ userInfo.updateUserInfo({});
showToast('已退出登录!');
// window.location.replace('/');
}).catch(err => {
diff --git a/src/router/index.js b/src/router/index.js
index 7c716d3..9f13d0a 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -35,7 +35,16 @@ const router = createRouter({
group: 'ucenter'
},
component: () => import("@/views/ucenter/userInfo.vue"),
- }
+ },
+ {
+ path: 'order',
+ name: 'order',
+ meta: {
+ title: '我的订单',
+ group: 'ucenter'
+ },
+ component: () => import("@/views/ucenter/order.vue"),
+ },
]
},
]
diff --git a/src/utils/format.js b/src/utils/format.js
new file mode 100644
index 0000000..a570de0
--- /dev/null
+++ b/src/utils/format.js
@@ -0,0 +1,58 @@
+export function DateFormat(date, format) {
+ var o = {
+ 'M+': date.getMonth() + 1,
+ 'd+': date.getDate(),
+ 'h+': date.getHours(),
+ 'm+': date.getMinutes(),
+ 's+': date.getSeconds(),
+ 'q+': Math.floor((date.getMonth() + 3) / 3),
+ 'S': date.getMilliseconds() //毫秒
+ };
+ if (/(y+)/.test(format))
+ format = format.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
+ for (let k in o)
+ if (new RegExp('(' + k + ')').test(format))
+ format = format.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)));
+ return format;
+}
+
+
+
+export function formatDate(dateTime = null, formatStr = 'yyyy-MM-dd HH:mm:ss') {
+
+ if (!dateTime) return ''
+ let date
+ // 若传入时间为假值,则取当前时间
+ if (!dateTime) {
+ date = new Date()
+ } else if (/^\d{10}$/.test(dateTime.toString().trim())) {
+ date = new Date(dateTime * 1000)
+ } else if (typeof dateTime === 'string' && /^\d+$/.test(dateTime.trim())) {
+ date = new Date(Number(dateTime))
+ } else {
+ date = new Date(
+ typeof dateTime === 'string' ?
+ dateTime.replace(/-/g, '/') :
+ dateTime
+ )
+ }
+
+ const timeSource = {
+ 'y': date.getFullYear().toString(), // 年
+ 'M': (date.getMonth() + 1).toString().padStart(2, '0'), // 月
+ 'd': date.getDate().toString().padStart(2, '0'), // 日
+ 'H': date.getHours().toString().padStart(2, '0'), // 时
+ 'm': date.getMinutes().toString().padStart(2, '0'), // 分
+ 's': date.getSeconds().toString().padStart(2, '0') // 秒
+
+ }
+
+ for (const key in timeSource) {
+ const [ret] = new RegExp(`${key}+`).exec(formatStr) || []
+ if (ret) {
+ const beginIndex = key === 'y' && ret.length === 2 ? 2 : 0
+ formatStr = formatStr.replace(ret, timeSource[key].slice(beginIndex))
+ }
+ }
+ return formatStr
+ }
\ No newline at end of file
diff --git a/src/views/ucenter/components/updateContactModal.vue b/src/views/ucenter/components/updateContactModal.vue
new file mode 100644
index 0000000..47e7902
--- /dev/null
+++ b/src/views/ucenter/components/updateContactModal.vue
@@ -0,0 +1,212 @@
+
+ 暂无订单