当前位置:网站首页>53: Chapter 5: develop admin management service: 6: develop [admin administrator exit login, interface]; (one point: when we want to modify a value with a certain coding method, the new value should b
53: Chapter 5: develop admin management service: 6: develop [admin administrator exit login, interface]; (one point: when we want to modify a value with a certain coding method, the new value should b
2022-07-28 02:08:00 【Small withered forest】
explain :
(1) The content of this blog : Development 【admin The administrator logs out , Interface 】;
(2) One point : When we want to modify a value with some coding method , The new value is best encoded in this way , Go ahead and revise ;
● namely , hypothesis a="df", Then the encoding method is “UTF-8”; then , We want to put a It is amended as follows "fg" When ,"fg" It's better to use "UTF-8" Encoding , Then pour this new value into a;
Catalog
Log out , It's mainly about " User login information " Scavenging ; namely , Clear to Redis Stored in token; Clear previously saved in cookie Users in aid and atoken Etc ;
stay 【39: The third chapter : Developing a pass service :22: Log out & Log off the session ;】 in , What we develop is that ordinary users log out ; It and the administrator user of this blog log out , almost ;
1. stay 【api】 Interface Engineering AdminMngControllerApi Interface , Definition 【admin The administrator logs out , Interface 】;
/** * 【admin The administrator logs out , Interface 】; * @param adminId * @param request * @param response * @return */ @ApiOperation(value = "admin The administrator logs out ", notes = "admin The administrator logs out ", httpMethod = "POST") @PostMapping("/adminLogout") // Set the routing , This needs to be agreed between the front and back ; public GraceJSONResult adminLogout(@RequestParam String adminId, HttpServletRequest request, HttpServletResponse response);explain :
(1) This interface's url、 Request mode 、 Parameters , It's not nonsense , The front and rear ends need to be consistent ;
2. stay 【admin】 Managed services AdminMngController Class , To achieve 【admin The administrator logs out , Interface 】;
/** * 【admin The administrator logs out , Interface 】; * @param adminId * @param request * @param response * @return */ @Override public GraceJSONResult adminLogout(String adminId, HttpServletRequest request, HttpServletResponse response) { redisOperator.del(REDIS_ADMIN_TOKEN + ":" + adminId);// First , Clear to Redis Stored in token; deleteCookie("atoken", request, response); deleteCookie("aid", request, response); deleteCookie("aname", request, response); return null; }explain :
(1) The logic here and 【39: The third chapter : Developing a pass service :22: Log out & Log off the session ;】 The practice in is exactly the same ; It's just , Delete cookie The logic of , We drew out a method alone ;
(2) Here we need to pay attention to a development time , Suggested points to follow :
● We are facing cookie When setting the value in , All of them adopt 【URLEncoder.encode( String to be encoded , “UTF-8“);】 It's encoded ; namely , here cookie The values in are in the above encoded format ;
● that , We are revising cookie When it's worth , This value , It's best to use 【URLEncoder.encode( String to be encoded , “UTF-8“);】 Encoding ;
● This helps , Avoid many possible 、 Strange questions ;( Especially in the production environment )
● For this point , I feel a little bit ; but , In fact, it is not very clear , Not thoroughly understood ;
3. effect ;
First, the whole situation install Look at the whole project ; then , Start the front-end project ; Remember to use SwitchHost Open virtual domain name mapping ; start-up 【admin】 The main startup class of the management service ;
……………………………………………………
边栏推荐
- Sample imbalance - entry 0
- 软件测试面试题:你认为做好测试用例设计工作的关键是什么?
- Software testing interview question: why should we carry out testing in a team?
- Gbase 8C annotation information function
- Unreal ue4.27 switchboard porting engine process
- DeviceXPlorer OPC Server支持哪些设备?本文已列举出来了
- LeetCode高频题128. 最长连续序列,经常被互联网大厂面试考到
- N32l43x FLASH read \ write \ erase operation summary
- 华为APP UI自动化测试岗面试真题,真实面试经历。
- After learning the loop, I came across the problem of writing factorial of N, which caused a series of problems, including some common pitfalls for beginners, and how to simplify the code
猜你喜欢

How to evaluate the effectiveness of R & D personnel? Software Engineer reports help you see everyone's contribution

二叉树的遍历和性质

Custom type: structure, enumeration, union

什么是方法,什么是方法论:了解自我精进提升的底层逻辑

Codeforces Round #807 (Div. 2) A-C题解

JS what situations can't use json Parse, json.stringify deep copy and a better deep copy method

go 学习02 基础知识

Huawei app UI automation test post interview real questions, real interview experience.

Fiddler mobile packet capturing agent settings (for Huawei glory 60s)
![Likeshop takeout ordering system [100% open source, no encryption]](/img/e6/a73aa817b5b30339d755aa53708072.png)
Likeshop takeout ordering system [100% open source, no encryption]
随机推荐
Software test interview question: please introduce the meaning of various test types in detail?
What is method and methodology: understand the underlying logic of self-improvement
什么是方法,什么是方法论:了解自我精进提升的底层逻辑
Unity universal red dot system
Use of classes in typescript
N32l43x FLASH read \ write \ erase operation summary
GBase 8c 事务ID和快照(三)
清除浮动的原因和六种方法(解决浮动飞起影响父元素和全局的问题)
数据安全与隐私计算峰会-可证明安全:学习
LeetCode第 83 场双周赛
Gbase 8C transaction ID and snapshot
都在说DevOps,你真正了解它吗?
二叉树的遍历和性质
结构伪类选择器—查找单个—查找多个—nth-of-type和伪元素
Leetcode's 83rd biweekly match
A happy old age
Gbase 8C transaction ID and snapshot (V)
Real time data warehouse: meituan's real-time data warehouse construction practice
Enterprise operation and maintenance practice - using aliyun container image service to pull and build images of overseas GCR and quay warehouses
每条你收藏的资讯背后,都离不开TA






