api按模块单独配置文件

This commit is contained in:
sfmind
2022-05-01 22:39:16 +08:00
parent 083daa657d
commit f7d384e55d
10 changed files with 55 additions and 40 deletions

View File

@ -109,7 +109,7 @@
</template>
<script>
import { getBannerData, getNoticeData } from '../../common/api'
import { getBannerData, getNoticeData } from '../../api/index'
export default {
components: {},

View File

@ -48,7 +48,7 @@
</template>
<script>
import { passwordLogin, sendSmsCode, smsLogin } from '../../common/api'
import { passwordLogin, sendSmsCode, smsLogin } from '../../api/auth'
export default {
data() {

View File

@ -51,7 +51,7 @@
</template>
<script>
import { getUserInfo, updateAvatar, updateNickname } from '../../common/api'
import { getUserInfo, updateAvatar, updateNickname } from '../../api/user'
export default {
data() {

View File

@ -3,7 +3,7 @@
<view class="user-header">
<view class="user-info" @click="loginOrJump('/pages/profile/profile')">
<u-avatar size="80" :src="userInfo.avatar"></u-avatar>
<text class="nick-name">{{ hasLogin ? userInfo.nickname || '游客' : '点击登录' }}</text>
<text class="nick-name">{{ hasLogin ? userInfo.nickname || '游客' : '登录/注册' }}</text>
</view>
</view>
@ -90,10 +90,9 @@ export default {
content: '您确定要退出登录吗',
success: res => {
if (res.confirm) {
console.log('用户点击确定')
this.$store.dispatch('logout')
} else if (res.cancel) {
console.log('用户点击取消')
//console.log('用户点击取消')
}
}
})