Compare commits

...

3 Commits

Author SHA1 Message Date
0d8c7476d9 feat: add btn 2022-04-24 14:38:55 +08:00
6127f45298 fix: config & Sidebar 2022-04-24 13:11:10 +08:00
fa4af5adef fix: route & viteconfig 2022-04-24 10:08:45 +08:00
12 changed files with 215 additions and 17 deletions

14
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,14 @@
# image: alpine:latest
# pages:
# stage: deploy
# script:
# - mkdir public
# - ls -al
# - mv -f ./assets public
# - mv -f ./index.html public
# - echo "Release Complete"
# artifacts:
# paths:
# - public
# only:
# - gh-pages

View File

@ -1,12 +1,14 @@
<!DOCTYPE html>
<html lang="">
<html lang="en">
<head>
<meta charset="utf-8" />
<!-- <link rel="icon" href="<%= BASE_URL %>favicon.ico" /> -->
<link rel="icon" href="/favicon.ico" />
<!-- <meta http-equiv="X-UA-Compatible" content="IE=edge"> -->
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" />
<!-- <link rel="icon" href="<%= BASE_URL %>favicon.ico" /> -->
<link rel="icon" href="/favicon.ico" />
<!-- <title><%= htmlWebpackPlugin.options.title %></title> -->
<title>JM Expense</title>
<script src="https://kit.fontawesome.com/ccfd93e9a7.js" crossorigin="anonymous"></script>

View File

@ -14,7 +14,7 @@ cd dist
git init
git add -A
git commit -m 'deploy'
git commit -m 'deploy: config & view'
# if you are deploying to https://<USERNAME>.github.io
# git push -f https://github.com/<USERNAME>/<USERNAME>.GitHub.io.git master

View File

@ -1,12 +1,13 @@
<!DOCTYPE html>
<html lang="">
<html lang="en">
<head>
<meta charset="utf-8" />
<!-- <link rel="icon" href="<%= BASE_URL %>favicon.ico" /> -->
<link rel="icon" href="/favicon.ico" />
<!-- <meta http-equiv="X-UA-Compatible" content="IE=edge"> -->
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" />
<!-- <link rel="icon" href="<%= BASE_URL %>favicon.ico" /> -->
<link rel="icon" href="/favicon.ico" />
<!-- <title><%= htmlWebpackPlugin.options.title %></title> -->
<title>JM Expense</title>
<script src="https://kit.fontawesome.com/ccfd93e9a7.js" crossorigin="anonymous"></script>

14
postcss.config.js Normal file
View File

@ -0,0 +1,14 @@
module.exports = {
plugins: [
{
postcssPlugin: 'internal:charset-removal',
AtRule: {
charset: (atRule) => {
if (atRule.name === 'charset') {
atRule.remove()
}
}
}
}
]
}

View File

@ -98,13 +98,13 @@ const openUserRP = () => {
aria-expanded="false"
>
<img
:src="store.firebaseUser?.photoURL || '../assets/capoo.gif'"
:src="store.currentUser.photoURL || '../assets/capoo.gif'"
alt="photo"
width="55"
height="55"
class="rounded-circle me-2"
/>
<strong>{{ store.firebaseUser?.displayName }}</strong>
<strong>{{ store.currentUser.displayName }}</strong>
</a>
<ul class="dropdown-menu dropdown-menu-dark text-small shadow" aria-labelledby="dropdownUser1">
<!-- <li><hr class="dropdown-divider" /></li> -->

View File

@ -156,6 +156,158 @@ export const routes: RouteRecordRaw[] = [
}
]
// new
// export const routes: RouteRecordRaw[] = [
// // {
// // path: '/',
// // redirect: `${root}/`
// // },
// {
// path: '/register',
// name: 'Register',
// component: () => import('../views/Register.vue'),
// meta: {
// pageTitle: '註冊頁',
// show: false
// }
// },
// {
// path: '/login',
// name: 'Login',
// component: () => import('../views/Login.vue'),
// meta: {
// pageTitle: '登入頁',
// show: false
// }
// },
// {
// path: '/',
// name: 'Home',
// component: () => import('../views/Home.vue'),
// meta: {
// pageTitle: '首頁',
// show: true
// }
// },
// {
// path: '/record',
// name: 'Record',
// component: () => import('../views/Record.vue'),
// meta: {
// pageTitle: '未結算紀錄',
// show: true
// }
// },
// {
// path: '/closedRecord',
// name: 'ClosedRecord',
// component: () => import('../views/ClosedRecord.vue'),
// meta: {
// pageTitle: '已結算紀錄',
// show: true
// }
// },
// {
// path: '/logs',
// name: 'Logs',
// component: () => import('../views/Logs.vue'),
// meta: {
// pageTitle: '更動紀錄',
// show: true
// }
// },
// {
// path: '/expense',
// name: 'Expense',
// component: () => import('../views/Expense.vue'),
// meta: {
// pageTitle: '豬涵記帳',
// show: true
// }
// },
// // {
// // path: '/tools',
// // name: 'Tools',
// // component: () => import('../views/Tools.vue'),
// // meta: {
// // pageTitle: '小工具',
// // show: true
// // }
// // },
// {
// path: '/game',
// name: 'Game',
// component: () => import('../views/Game.vue'),
// meta: {
// pageTitle: '小遊戲',
// show: true
// // auth: ['root', 'admin', 'member']
// }
// },
// // {
// // path: `${root}/admin`,
// // name: 'Admin',
// // redirect: { name: 'Admin-Role' },
// // component: AppLayout,
// // meta: {
// // pageTitle: '管理面板',
// // show: true
// // },
// // children: [
// // {
// // path: 'role',
// // name: 'Admin-Role',
// // component: () => import('../views/Role.vue'),
// // meta: {
// // pageTitle: '角色管理',
// // show: true
// // }
// // },
// // {
// // path: 'permission',
// // name: 'Admin-Permission',
// // component: () => import('../views/Permission.vue'),
// // meta: {
// // pageTitle: '權限管理',
// // show: true
// // }
// // }
// // ]
// // },
// // {
// // path: `${root}/admin/role`,
// // name: 'Admin-Role',
// // component: () => import('@/views/Role.vue'),
// // meta: {
// // pageTitle: '角色管理',
// // show: true
// // }
// // },
// // {
// // path: '/admin/role/:id/access',
// // name: 'Admin-Role-Access',
// // component: () => import('@/views/Access.vue'),
// // meta: {
// // pageTitle: '角色管理 / 設置權限[角色名稱]',
// // show: false
// // }
// // },
// // {
// // path: '/admin/permission',
// // name: 'Admin-Permission',
// // component: () => import('../views/Permission.vue'),
// // meta: {
// // pageTitle: '權限管理',
// // show: true
// // }
// // },
// {
// path: '/:pathMatch(.*)*',
// name: 'NotFound',
// component: () => import('../views/NotFound.vue')
// }
// ]
const router = createRouter({
history: createWebHistory(),
routes

View File

@ -2,7 +2,7 @@ import lineBotAPI from '@/apis/lineBot'
export const pushMsgToBoth = async (text: string) => {
try {
const input = {
const input: any = {
to: [import.meta.env.VITE_KAROL_USERID, import.meta.env.VITE_JIANMIAU_USERID],
messages: {
type: 'text',

View File

@ -5,7 +5,7 @@ import { useRoute } from 'vue-router'
const route = useRoute()
// created
if (import.meta.env.NODE_ENV === 'production') {
if (import.meta.env.MODE === 'production') {
onLoad()
}
</script>

View File

@ -4,6 +4,7 @@ import recordAPI from '@/apis/record'
import lineBotAPI from '@/apis/lineBot'
import { Record } from '@/models'
import { CallParent } from '@/cocos/config'
import { useStore } from '../store/index'
// components
import Spinner from '@/components/Spinner.vue'
import CreateRecordModalButton from '@/components/ModalButton/Record/CreateRecordModalButton.vue'
@ -16,6 +17,7 @@ class MonthData {
}
// data
const store = useStore()
const isLoading = ref<boolean>(true)
const records = ref<Record[]>([])
const thisMonthData = ref<MonthData>(new MonthData())
@ -72,7 +74,7 @@ fetchRecords()
//
const handle = async () => {
try {
const input = {
const input: any = {
to: [import.meta.env.VITE_KAROL_USERID, import.meta.env.VITE_JIANMIAU_USERID],
messages: { type: 'text', text: '卡比覺得促咪!' }
}
@ -82,6 +84,19 @@ const handle = async () => {
console.error('error', error)
}
}
// xx
const call = async () => {
try {
const input: any = {
to: [import.meta.env.VITE_KAROL_USERID, import.meta.env.VITE_JIANMIAU_USERID],
messages: { type: 'text', text: '呼叫呆喵! 聽到請回答!' }
}
await lineBotAPI.push(input)
} catch (error) {
console.error('error', error)
}
}
</script>
<template>
@ -89,6 +104,7 @@ const handle = async () => {
<div class="d-flex mb-3" style="width: 100vw">
<CreateRecordModalButton view="Home" class="me-3" />
<button type="button" class="btn btn-danger me-3" @click="handle">笨蛋才按我</button>
<button type="button" class="btn btn-primary me-3" @click="call">哈囉</button>
</div>
<div class="list-group list-group-checkable">
<label class="list-group-item py-3 mb-3">

View File

@ -14,5 +14,8 @@ export default defineConfig({
},
server: {
port: 8080
}
},
// base: import.meta.env.DEV ? '/' : '/jm-expense-vue-ts/'
base: '/jm-expense-vue-ts/'
// base: './'
})

View File

@ -1,4 +0,0 @@
module.exports = {
// publicPath: process.env.NODE_ENV === 'production' ? '/jm-expense-vue-ts/' : '/'
publicPath: import.meta.env.NODE_ENV === 'production' ? '/jm-expense-vue-ts/' : '/'
}