Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2afa184

Browse files
author
kevin
committed
feat: add test api
1 parent2fa1343 commit2afa184

File tree

5 files changed

+14
-9
lines changed

5 files changed

+14
-9
lines changed

‎.env.development

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VITE_API_BASE_URL=''
1+
VITE_API_BASE_URL=https://res.abeim.cn

‎.env.production

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VITE_API_BASE_URL=http://github.com/api
1+
VITE_API_BASE_URL=https://res.abeim.cn

‎src/api/manager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
importservicefrom'./service'
22

33
exportconstget=(url,params)=>{
4-
returnservice.requese({url:url,params:params,method:'GET'})
4+
returnservice.request({url:url,params:params,method:'GET'})
55
}
66

77
exportconstpost=(url,data)=>{

‎src/api/user.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import{post,get}from'./manager'
1+
import{get}from'./manager'
22

3-
exportconstinfo=(params)=>get('/user/info',params)
4-
exportconstlogin=(data)=>post('/user/login',data)
3+
exportconsttext=(params)=>{
4+
returnget('/api-text_yiyan',params)
5+
}

‎src/pages/Home.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
<template>
2-
<divclass="w-screen h-screen bg-amber-600">Home</div>
2+
<divclass="w-screen h-screen flex justify-center items-center bg-amber-600">
3+
<divv-if="userInfo">
4+
<pclass="font-mono text-white text-2xl">{{ userInfo.content }}</p>
5+
</div>
6+
</div>
37
</template>
48

59
<script>
610
import {ref,onBeforeMount }from'vue'
7-
import {info }from'../api/user'
11+
import {text }from'../api/user'
812
913
exportdefault {
1014
setup() {
1115
constuserInfo=ref(null)
1216
onBeforeMount(async ()=> {
13-
constres=awaitinfo({id:1 })
17+
constres=awaittext({export:'json' })
1418
userInfo.value= res
1519
})
1620
return {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp