add docker

This commit is contained in:
RainSun 2020-04-10 20:49:13 +08:00
parent fa3a51fab1
commit 52ed5e8d13
9 changed files with 78 additions and 28 deletions

3
Dockerfile Normal file
View File

@ -0,0 +1,3 @@
FROM nginx
COPY dist/ /usr/share/nginx/html/
COPY nginx/default.conf /etc/nginx/conf.d/default.conf

17
nginx/default.conf Normal file
View File

@ -0,0 +1,17 @@
server {
listen 80;
server_name localhost;
access_log /var/log/nginx/host.access.log main;
error_log /var/log/nginx/error.log error;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}

View File

@ -6,16 +6,16 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>曳光 控制台</title>
<title>曳光控制台</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon-precomposed" href="<%= BASE_URL %>favicon.ico">
<!-- 标题 -->
<meta itemprop="name" content="曳光控制台" />
<!-- 描述 -->
<meta itemprop="description" content="负责进行曳光内容审核" />
<meta itemprop="description" content="进行曳光内容审核" />
<!-- 图片 -->
<meta itemprop="image" content="http://canary.moe/img/canary.png" />
<meta itemprop="image" content="https://tracer.lacus.site/img/icons/android-chrome-512x512.png" />
<script>
try {
console.log('%cRainSun Copyright \xa9 2019-%s',

View File

@ -187,7 +187,7 @@ html[data-theme="light"] {
display: block !important;
}
.md-bottom-bar.md-type-shift .md-bottom-bar-item {
.md-bottom-bar.md-type-fixed .md-bottom-bar-item {
max-width: 1000px !important;
}
</style>

View File

@ -1,8 +1,8 @@
import axios from 'axios'
export const api = axios.create({
baseURL: 'https://yg.canary.moe/v1/admin/',
// baseURL: window.location.origin + '/api/',
// baseURL: 'https://yg.canary.moe/v1/admin/',
baseURL: window.location.origin + '/v1/admin/',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',

View File

@ -38,7 +38,7 @@ const routes = [
},
{
path: '*', // 页面不存在的情况下会跳到home
redirect: '/clear',
redirect: '/verify',
name: 'notFound',
hidden: true
}

View File

@ -38,7 +38,7 @@
<md-list-item>
<span class="md-list-item-text">身份码{{user_info.openid}}</span>
</md-list-item>
<md-subheader class="md-primary">管理员信息</md-subheader>
<md-subheader class="md-primary">应用设置</md-subheader>
<md-list-item>
<md-icon>brightness_6</md-icon>
<span class="md-list-item-text">黑暗模式</span>

View File

@ -29,21 +29,33 @@
></md-empty-state>
<!-- 审核卡片 -->
<md-card v-if="verify_content">
<md-card-media>
<img :src="`https://yg.canary.moe/photo/${verify_content.img_url}`" alt="showImg" />
</md-card-media>
<md-card-header>
<div class="md-title">{{verify_content.title}}</div>
<div class="md-subhead">{{formatDateTime(verify_content.create_time)}}</div>
</md-card-header>
<md-card-content>{{verify_content.content}}</md-card-content>
<md-card-content>{{verify_content.total_addr}} - {{verify_content.detail_addr}}</md-card-content>
<md-card-content v-if="verify_content.contact">联系方式 - {{verify_content.contact}}</md-card-content>
<md-card-content>用户名 - {{verify_content.user_info.nick}}</md-card-content>
<md-card v-if="verify_content" class="md-card-example">
<md-card-area md-inset>
<md-card-media>
<img :src="`https://yg.canary.moe/photo/${verify_content.img_url}`" />
</md-card-media>
<md-card-header>
<h2 class="md-title" style="margin-bottom: .3rem;">{{verify_content.title}}</h2>
<div class="md-subhead">
<md-icon>access_time</md-icon>
<span>{{formatDateTime(verify_content.create_time)}}</span>
</div>
<div class="md-subhead">
<md-icon>location_on</md-icon>
<span>{{verify_content.total_addr}}</span>
</div>
<div class="md-subhead">
<md-icon>gps_fixed</md-icon>
<span>{{verify_content.detail_addr}}</span>
</div>
<div class="md-subhead" v-if="verify_content.contact">
<md-icon>attach_file</md-icon>
<span>{{verify_content.contact}}</span>
</div>
</md-card-header>
<md-card-content>{{verify_content.content}}</md-card-content>
</md-card-area>
<md-card-actions>
<md-button class="md-accent" @click="veto_prompt_switch = true">否决</md-button>
<md-button class="md-primary" @click="pass_confirm_switch = true">通过</md-button>
@ -184,8 +196,8 @@ export default {
console.log("管理员信息校验失败");
return;
}
if(!verify_type) {
if(! (this.veto_reason = this.veto_reason.trim())){
if (!verify_type) {
if (!(this.veto_reason = this.veto_reason.trim())) {
console.log("否决原因校验失败");
this.message("请填写否决原因");
return;
@ -204,11 +216,11 @@ export default {
.put("/verify/res", data)
.then(res => {
this.verify_content = null;
this.veto_reason = '';
this.veto_reason = "";
console.log("请求成功,审核成功");
this.loading_switch = false;
this.message("审核完成");
this.getVerify()
this.getVerify();
})
.catch(err => {
console.log(err);
@ -252,8 +264,8 @@ export default {
components: {},
activated() {
if (Object.keys(this.user_info).length == 0) {
this.verify_content = null
console.log('无用户信息,空内容覆写完成')
this.verify_content = null;
console.log("无用户信息,空内容覆写完成");
}
}
};
@ -328,4 +340,21 @@ export default {
margin: 0;
margin-bottom: 16px;
}
.md-card-example {
.md-subhead {
margin-top: .1rem;
.md-icon {
$size: 16px;
width: $size;
min-width: $size;
height: $size;
font-size: $size !important;
margin-right: .3rem;
}
span {
vertical-align: middle;
}
}
}
</style>

View File

@ -1,5 +1,6 @@
module.exports = {
productionSourceMap: false,
// publicPath: process.env.NODE_ENV === 'production' ? '/verify/' : '/',
pwa: {
name: '曳光控制台',
themeColor: '#448aff',