Showing first 121 files as there are too many
-
1 1 # build stage 2 2 FROM golang:alpine AS build 3 3 ARG VERSION 4 + ARG SHA 4 5 COPY .. /src 5 6 WORKDIR /src 6 7 ENV CGO_ENABLED 0 7 8 ENV VERSION=${VERSION} 8 9 ENV SHA=${SHA} 9 - RUN go build -ldflags "-X github.com/DVKunion/SeaMoon/system/xlog.Version=${VERSION} -X github.com/DVKunion/SeaMoon/system/xlog.Commit=${SHA}" -o /tmp/seamoon cmd/main.go 10 + #COPY ./seamoon /tmp/seamoon 11 + RUN go build -v -ldflags "-X github.com/DVKunion/SeaMoon/system/xlog.Version=${VERSION} -X github.com/DVKunion/SeaMoon/system/xlog.Commit=${SHA}" -o /tmp/seamoon cmd/main.go 10 12 RUN chmod +x /tmp/seamoon 13 + RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories && \ 14 + apk add upx && upx -9 /tmp/seamoon 11 15 # run stage 12 16 FROM alpine:3.19 13 17 LABEL maintainer="[email protected]" skipped 9 lines -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
pkg/tools/jwt.go pkg/system/tools/jwt.goContent is identical
-
pkg/tools/ptr.go pkg/system/tools/ptr.goContent is identical
-
-
-
-
-
-
pkg/service/options.go pkg/tunnel/service/options.goContent is identical
-
pkg/service/proto/Makefile pkg/tunnel/service/proto/MakefileContent is identical
-
-
pkg/service/proto/gost/gost_grpc.pb.go pkg/tunnel/service/proto/gost/gost_grpc.pb.goContent is identical
-
pkg/service/proto/gost.proto pkg/tunnel/service/proto/gost.protoContent is identical
-
-
pkg/service/proto/tunnel.proto pkg/tunnel/service/proto/tunnel.protoContent is identical
-
pkg/service/service.go pkg/tunnel/service/service.goContent is identical
-
-
-
-
-
-
-
-
-
-
1 + import { Request, Response } from 'express'; 2 + 3 + const waitTime = (time: number = 100) => { 4 + return new Promise((resolve) => { 5 + setTimeout(() => { 6 + resolve(true); 7 + }, time); 8 + }); 9 + }; 10 + 11 + async function getFakeCaptcha(req: Request, res: Response) { 12 + await waitTime(2000); 13 + return res.json('captcha-xxx'); 14 + } 15 + 16 + const { ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION } = process.env; 17 + 18 + /** 19 + * 当前用户的权限,如果为空代表没登录 20 + * current user access, if is '', user need login 21 + * 如果是 pro 的预览,默认是有权限的 22 + */ 23 + let access = ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION === 'site' ? 'admin' : ''; 24 + 25 + const getAccess = () => { 26 + return access; 27 + }; 28 + 29 + // 代码中会兼容本地 service mock 以及部署站点的静态数据 30 + export default { 31 + // 支持值为 Object 和 Array 32 + 'GET /api/currentUser': (req: Request, res: Response) => { 33 + if (!getAccess()) { 34 + res.status(401).send({ 35 + data: { 36 + isLogin: false, 37 + }, 38 + errorCode: '401', 39 + errorMessage: '请先登录!', 40 + success: true, 41 + }); 42 + return; 43 + } 44 + res.send({ 45 + success: true, 46 + data: { 47 + name: 'Serati Ma', 48 + avatar: 'https://gw.alipayobjects.com/zos/antfincdn/XAosXuNZyF/BiazfanxmamNRoxxVxka.png', 49 + userid: '00000001', 50 + email: '[email protected]', 51 + signature: '海纳百川,有容乃大', 52 + title: '交互专家', 53 + group: '蚂蚁金服-某某某事业群-某某平台部-某某技术部-UED', 54 + tags: [ 55 + { 56 + key: '0', 57 + label: '很有想法的', 58 + }, 59 + { 60 + key: '1', 61 + label: '专注设计', 62 + }, 63 + { 64 + key: '2', 65 + label: '辣~', 66 + }, 67 + { 68 + key: '3', 69 + label: '大长腿', 70 + }, 71 + { 72 + key: '4', 73 + label: '川妹子', 74 + }, 75 + { 76 + key: '5', 77 + label: '海纳百川', 78 + }, 79 + ], 80 + notifyCount: 12, 81 + unreadCount: 11, 82 + country: 'China', 83 + access: getAccess(), 84 + geographic: { 85 + province: { 86 + label: '浙江省', 87 + key: '330000', 88 + }, 89 + city: { 90 + label: '杭州市', 91 + key: '330100', 92 + }, 93 + }, 94 + address: '西湖区工专路 77 号', 95 + phone: '0752-268888888', 96 + }, 97 + }); 98 + }, 99 + // GET POST 可省略 100 + 'GET /api/users': [ 101 + { 102 + key: '1', 103 + name: 'John Brown', 104 + age: 32, 105 + address: 'New York No. 1 Lake Park', 106 + }, 107 + { 108 + key: '2', 109 + name: 'Jim Green', 110 + age: 42, 111 + address: 'London No. 1 Lake Park', 112 + }, 113 + { 114 + key: '3', 115 + name: 'Joe Black', 116 + age: 32, 117 + address: 'Sidney No. 1 Lake Park', 118 + }, 119 + ], 120 + 'POST /api/login/account': async (req: Request, res: Response) => { 121 + const { password, username, type } = req.body; 122 + await waitTime(2000); 123 + if (password === 'ant.design' && username === 'admin') { 124 + res.send({ 125 + status: 'ok', 126 + type, 127 + currentAuthority: 'admin', 128 + }); 129 + access = 'admin'; 130 + return; 131 + } 132 + if (password === 'ant.design' && username === 'user') { 133 + res.send({ 134 + status: 'ok', 135 + type, 136 + currentAuthority: 'user', 137 + }); 138 + access = 'user'; 139 + return; 140 + } 141 + if (type === 'mobile') { 142 + res.send({ 143 + status: 'ok', 144 + type, 145 + currentAuthority: 'admin', 146 + }); 147 + access = 'admin'; 148 + return; 149 + } 150 + 151 + res.send({ 152 + status: 'error', 153 + type, 154 + currentAuthority: 'guest', 155 + }); 156 + access = 'guest'; 157 + }, 158 + 'POST /api/login/outLogin': (req: Request, res: Response) => { 159 + access = ''; 160 + res.send({ data: {}, success: true }); 161 + }, 162 + 'POST /api/register': (req: Request, res: Response) => { 163 + res.send({ status: 'ok', currentAuthority: 'user', success: true }); 164 + }, 165 + 'GET /api/500': (req: Request, res: Response) => { 166 + res.status(500).send({ 167 + timestamp: 1513932555104, 168 + status: 500, 169 + error: 'error', 170 + message: 'error', 171 + path: '/base/category/list', 172 + }); 173 + }, 174 + 'GET /api/404': (req: Request, res: Response) => { 175 + res.status(404).send({ 176 + timestamp: 1513932643431, 177 + status: 404, 178 + error: 'Not Found', 179 + message: 'No message available', 180 + path: '/base/category/list/2121212', 181 + }); 182 + }, 183 + 'GET /api/403': (req: Request, res: Response) => { 184 + res.status(403).send({ 185 + timestamp: 1513932555104, 186 + status: 403, 187 + error: 'Forbidden', 188 + message: 'Forbidden', 189 + path: '/base/category/list', 190 + }); 191 + }, 192 + 'GET /api/401': (req: Request, res: Response) => { 193 + res.status(401).send({ 194 + timestamp: 1513932555104, 195 + status: 401, 196 + error: 'Unauthorized', 197 + message: 'Unauthorized', 198 + path: '/base/category/list', 199 + }); 200 + }, 201 + 202 + 'GET /api/login/captcha': getFakeCaptcha, 203 + }; 204 + -
-
-
web/public/favicon.ico
-
web/public/icon.svg
-
web/public/icon_black.svg
-
web/public/icons/icon-128x128.png
-
web/public/icons/icon-192x192.png
-
web/public/icons/icon-512x512.png
-
web/public/logo.png
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-