diff --git a/src/App.vue b/src/App.vue index 798af9f..8763fb7 100644 --- a/src/App.vue +++ b/src/App.vue @@ -13,7 +13,7 @@ import { getValue } from './utils/common'; export default defineComponent({ setup(){ if(getValue('token')){ - store.commit("login") + store.commit("login", true) store.dispatch("setUserInfo"); } } diff --git a/src/api/base.ts b/src/api/base.ts index 9c19fd8..a859850 100644 --- a/src/api/base.ts +++ b/src/api/base.ts @@ -10,9 +10,9 @@ export interface Get { } axios.interceptors.response.use((response)=>{ + return response; },(error)=>{ - message.error(error.response.data.message) return Promise.reject(error) }) diff --git a/src/api/index.ts b/src/api/index.ts index f6c0134..920bcf3 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -23,7 +23,7 @@ export async function loginpass(phone: string, password: string){ message.error("存储错误, 请允许网页使用本地存储!") }else{ setToken(); - store.commit("login"); + store.commit("login", true); store.dispatch("setUserInfo"); router.push("/mine/archives") } @@ -144,11 +144,11 @@ export async function getlivelist(data?:any) { * 列表统计 */ - interface StatisticList{ - liveInfo: any; - videoInfo: any; - studentInfo: any; - } +interface StatisticList{ +liveInfo: any; +videoInfo: any; +studentInfo: any; +} export async function getstatisticlist() { const res = await get('statistics'); @@ -166,8 +166,31 @@ export async function getstatisticlist() { interface Liveaddrule{ code:number, msg:string - } - export async function liveadd(data:any) { +} +export async function liveadd(data:any) { const res = await post('live',data); console.log(res) - } \ No newline at end of file +} + + +/** + * 发送验证码 + * @param phone 手机号 + * @param type 国外1 国内0 + */ +interface SendSms{ + code: number; + msg: string; +} + +export async function sendsms(phone: string, type: number): Promise{ + const res = await post("SendSms", {phone, type}); + console.log(res); + if(res.code == 0){ + message.success(res.msg); + return true; + }else{ + message.error(res.msg); + return false; + } +} \ No newline at end of file diff --git a/src/components/Menu.vue b/src/components/Menu.vue index f179fde..1a22d07 100644 --- a/src/components/Menu.vue +++ b/src/components/Menu.vue @@ -21,7 +21,7 @@
-
+
帐号退出 @@ -190,12 +190,17 @@ export default defineComponent({ } + function logout(): void{ + store.commit("login", false) + router.replace("/"); + } return{ list, routeto, selnum, - userinfo + userinfo, + logout } } }) diff --git a/src/components/NavTop.vue b/src/components/NavTop.vue index e6bd34b..ba3bc9c 100644 --- a/src/components/NavTop.vue +++ b/src/components/NavTop.vue @@ -12,22 +12,86 @@
-
- -
{{userinfo.zoneStr}}
- -
-
- -
{{userinfo.currency}}
- -
-
- -
{{userinfo.language}}
- -
-
+ +
+ +
{{userinfo.zoneStr}}
+ +
+ +
+ + +
+ +
{{userinfo.currency}}
+ +
+ +
+ +
+ +
{{userinfo.language}}
+ +
+ +
+
日历
@@ -80,15 +144,17 @@ align-items: center; flex-shrink: 0; padding: 0 16px; + .selitem{ + text-align: center; + font-size: 11px; + color: #111; + } .item{ display: flex; align-items: center; border-right: 1px solid #eee; padding: 0 23px; height: 18rpx; - &:last-child{ - border-right: none; - } .icon{ width: 16px; height: 16px; diff --git a/src/static/images/smilet.png b/src/static/images/smilet.png new file mode 100644 index 0000000..2659c02 Binary files /dev/null and b/src/static/images/smilet.png differ diff --git a/src/store/index.ts b/src/store/index.ts index 6461189..6e09a39 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -4,8 +4,44 @@ import { createStore } from 'vuex' export default createStore({ state: { userinfo:{ - username: "username", - head: "" + accesstoken: "", + api_token: "", + birthday: "", + country: "", + cover: "", + created_at: "", + currency: 2, + deleted_at: null, + desc: "", + email: "", + img: "", + interest: "", + language: "中文", + live: "", + livetime: "", + login_type: 0, + memberid: 0, + mobile: "", + money: "", + msg: "", + mtongue: "", + name: "", + password: "", + position: 0, + publish: 0, + score: "", + status: true, + tlanguage: "", + type: 0, + uid: "", + updated_at: "", + video: "", + willsay: [{ + "name": "请选择", + "level": 0 + }], + zoneStr: "中途岛GMT-11:00", + zoneid: 0 }, islogin: false }, @@ -13,8 +49,8 @@ export default createStore({ setUserInfo(state, userinfo){ state.userinfo = userinfo }, - login(state){ - state.islogin = true; + login(state, islogin: boolean){ + state.islogin = islogin; } }, actions: { diff --git a/src/views/login/Login.vue b/src/views/login/Login.vue index af9261e..014d145 100644 --- a/src/views/login/Login.vue +++ b/src/views/login/Login.vue @@ -7,7 +7,7 @@ 您好,欢迎来到 Beelink
- 还没有账号? 成为一名Beelink老师 + 还没有账号? 成为一名Beelink老师
@@ -260,7 +260,7 @@ export default defineComponent({ margin-top: 17px; margin-bottom: 35px; } - .tosign { + .tosign > a { color: #0dbba4; cursor: pointer; } diff --git a/src/views/login/Sign.vue b/src/views/login/Sign.vue index d0d62e0..63df4cb 100644 --- a/src/views/login/Sign.vue +++ b/src/views/login/Sign.vue @@ -1,6 +1,6 @@