获取时区

This commit is contained in:
2020-11-18 10:10:48 +08:00
parent 97a5090e0f
commit 49edb01a3f
3 changed files with 28 additions and 3 deletions

View File

@@ -3,6 +3,7 @@ import store from '@/store';
import { LiveList, LivelistInfo, LoginData, UserInfo } from '@/types';
import { getValue, saveValue } from '@/utils/common';
import { message } from 'ant-design-vue';
import dayjs from 'dayjs';
import { del, get, post, put, setToken } from './base'
@@ -885,6 +886,14 @@ export async function checksmscode(phone: string, smscode: string){
export async function register(data: any){
/* eslint-disable */
const utc = require('dayjs/plugin/utc') // dependent on utc plugin
/* eslint-disable */
const timezone = require('dayjs/plugin/timezone')
const days: any = dayjs;
dayjs.extend(utc)
dayjs.extend(timezone)
const res = await post<any>("register",{
mobile: data.phone,
code: data.quhao,
@@ -894,7 +903,9 @@ export async function register(data: any){
email: data.emil,
mtongue: data.muyu,
tlanguage: data.jiaoshou,
language: getValue("Lanvuage") || 'zh'
language: getValue("Lanvuage") || 'zh',
zoneid: days.tz.guess()
})
if(res.code == 0){
message.success(res.msg)