模拟考试获取当天日期精准至时分秒
This commit is contained in:
@@ -129,6 +129,7 @@
|
||||
<script setup>
|
||||
import { inject, ref, reactive } from 'vue';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import dayjs from "dayjs";
|
||||
const { $api, navTo, navBack,urls } = inject('globalFunction');
|
||||
import config from "@/config.js"
|
||||
const userInfo = ref({});
|
||||
@@ -152,13 +153,7 @@ onLoad(() => {
|
||||
});
|
||||
onShow(()=>{
|
||||
getDictionary()
|
||||
const date = new Date();
|
||||
let year = date.getFullYear();
|
||||
let month = date.getMonth() + 1; // 月份从0开始,需要加1
|
||||
let day = date.getDate();
|
||||
month=month>9?month:'0'+month
|
||||
day=day>9?day:'0'+day
|
||||
dates.value=year+'-'+month+'-'+day
|
||||
dates.value=dayjs().format('YYYY-MM-DD HH:mm:ss')
|
||||
Authorization.value=uni.getStorageSync('Padmin-Token')||''
|
||||
getHeart();
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user